drupal

Something as easy as drupal_write_record for reading

Does drupal have a simple version for reading like drupal_write_record. I want to read a record from a table called {allcategories} and find the record that has a category field of value computers. It's a custom table defined with schema. ...

CiviCRM - get custom data for user

I've set up CiviCRM and created a custom data fieldset. I'm now trying to get this raw data and output as I wish. I've got code that displays the basic user info (contact id, display_name, image_URL, etc), but it does not include my custom fields (for example, twitter_username). How do I get to the custom data I've added? ...

Programmatically handling a view in Drupal

I'm using custom module to handle this view. I did many try nothing works and also sorting too. Only arguments code works charm. Guide me to right way / help me with solutions. and here is the exported view link http://pastebin.com/YzzzLEbW function custom_module(){ views_include("view"); $view = new view(); ...

PHP sites as subfolders in a Drupal installation

I have a drupal site that was on shared hosting with other non-drupal sites. Of course there's a primary domain and subfolders. I recently moved the drupal site to be the primary domain, so all the other non-drupal sites are as subfolders. Since I've done this however, none of the other non-drupal sites is displaying. But when I di...

@ (at sign) in drupal

In another question someone posted with this reply to my question. drupal_set_message(t('Some Message @title'), array('@title' => $form_state['values']['title']))); It looks to me that the @title is substituted for the line below. What is this called and what are the advantages and disadvantage of it? From a quick look I see the @...

Drupal hook fired after node created

When I create a node I want it to programmatically create some nodes that reference the node just created. I though I would just need to change form_alter submit function for my form to call a custom function to create the nodes. Examining the output $form_state I can see that the NID is Null. This would mean to me that my node is crea...

Drupal Attachments (FileField) file path

What function in Drupal gets file attachment path? Edit: the attachments provided by Upload module in system section. But since you mentioned there may be another way around it. Maybe I could achieve may goals using FileField module so if you could tell me how to get a direct link of a file uploaded by FileField module that may also be ...

How to give access to users at page level in Drupal?

Through "create page", I have created various pages via different users. Now my task is to make pages users specific. That is, the one who is creating the page should only able to access and edit that page. How can this be accomplished? ...

How can I make this appear on ancestor pages?

Hi! I'm still learning Drupal and I want a block to appear on ancestor pages of specific terms. I'm no good in Drupal but I got this code from somwehere and try to customize it. Any help from you will be very much appreciated. This is the code //Deal with current node and ancestory if ( arg(0) == 'node' and is_numeric(arg(1...

Drupal Message control?

Is there a module or a way to manage Drupal Message. I.e. THe message you see after creating content, e.g. "Car listing titled bla has been created". I want a central point to control these messages. Most of them I do not want to display. ...

How to change search tab titles with title callback and title arguments using hook_menu_alter()

I am trying to modify the displayed title of the realname and node search tabs under drupal search using hook_menu_alter in drupal 6. However I can't figure out how to use the title calback and title arguments for my purpose unlike simpler tabs the search tabs doesn't just have a title. function sn_misc_menu_alter(&$items) { // hide...

Drupal Create Dynamic Menu with an Active Trail Property

Hi there, I want to create a dynamic menu that will get it's items from a certain node type. I thought I could do this by creating a view of the titles and putting it in a block. However, when someone clicks on one of these titles I want to highlight it, and so want a way of adding an active class to the link. I know Drupal does this au...

Drupal Content Manger module that approve content, Track changes....

Hello Guys, I know for a fact that Drupal is a content management software. What I would like to know is, is their any module in drupal that does content management? Like approving a submitted contents, post or comments, Track changes and so on and so forth. If you visit this site http://www.formstack.com/forms/envato-tuts_net_content_s...

Drupal: what permission to assign to "files" folder

On the Drupal website is suggested to use 755 as permissions for the "Files" folder. However I sometimes had issues when uploading the website to a server with it, because the owner of the files was the ftp client and not drupal itself. Consequently, I've asked to some people and I've been told that assigning 777 to "only" the files fo...

drupal multiple view arguments with PHP code validation for empty arguments

I have a view set up to accept 2 arguments. The url is like this: playlists/video5/%/%/rss.xml It works fine if I supply the url with 2 arguments like playlists/video5/front/coach/rss.xml. I have 2 arguments of "Taxonomy: Term" But I need it to run even if 1 or no arguments are supplied. It looks like you can do this with PHP Code under...

drupal theming filter for a view

Hello, I am trying to change the theme for my exposed filters for a particular view by overriding the views-exposed-form.tpl.php. The problem I am having is that I cannot seem to get the naming convention of the view set up correctly - I have been trying to use views-exposed-form--viewname--displayname.tpl.php, but that is not being foun...

Can multiple Django sites share memory?

I'm using Apache + mod_wsgi daemon mode for running a Django site. When another site is added (new virtualhost), a second daemon appears. Is there any way to let those sites share the same proces / memory? It seems to wasteful to have ~20MB persistently in use per site. Bonus points: how does this compare to PHP hosting? (especially Dr...

Drupal Mask Email Addresses and Replace With Image

Hi All, I've created my own business directory using CCK but I now need to mask the email addresses so they are unreadable by email spam bots. I also need to hide displaying the address by replacing it with an image. Are there any modules out there that can do this? Or can anybody provide some code or examples or suggest any ideas. An...

Dynamically updating config files in Linux

If I want to have, say, a PHP application update one of my config files in /etc, is there a generally agreed-upon best way to do that? What I specifically want to do is to have Drupal update /etc/postfix/virtual. My app has a certain list of users and I want each one of those users to be under an alias because I want [email protected]...

Do not allow a user to delete a node but allow to delete through Views Bulk Operations

Hi, I have the following scenario: Editor Role should not be allowed to delete nodes. Therefore the corresponding permission is de-selected in the permissions page. However Editor should be able to to delete nodes from Views Bulk operations. Using Rules an action is created called "safe delete" that checks things like if the node is ...