drupal-6

Drupal Views Content Profile User as an argument

I have a normal Drupal User. I have used the content_profile module to create a profile content type. This content type contains a node reference to another content type company. The company node then references a type of node called Task. I want to create a view that list all the tasks for a given user id. So I imagine I would create a...

Bring node field (event_date) data into ubercart

I need to be able to bring an Event_Date field into the checkout box in Ubercart. ...

Restrict access to a webform node to only a particular role in Drupal

Hello, Im using Drupal 6.19 and have used the webform module in Drupal to create a form on my Drupal site.The form shows up in the navigation menu. Is it possible to restrict access to the form to only a particular role ?. That is, i want only users belonging to a particular role to be able to see the form link in the navigation menu a...

How to programatically create a Drupal node as user X not Y when Y is logged on

Is there a way for me to do the following: Create a new content object of type 'A': //The global user is user Y $node = new Object(); $node->type = 'A' //etc.. //Save node - but I want the node to look like it was created by user X node_save($node); This is a case where user Y does not have 'create A content' permission, but user X...

Theming Webform in Drupal

I'm trying to theme my webform but I can't seem to get the new webform_form_#.tpl.php to load properly. When I go to the node page I get a blank page on firefox with an empty body. So in Template.php i've added the following line (my webform is on node 4) function phptemplate_webform_form_4 ($form) { return _phptemplate_callback('web...

Serving WMV on a drupal site?

I have a WMV file that I need to host on my drupal 6.13 site (on ubuntu 9.x). Is a there a relatively painless way to do this. Do I need the "Video" module to do this? Or can I just install a video player and point my WMV file to it? My other concern is the user should be able to view this video on my site without needing to download a...

Drupal cck checkbox with global setting

Hi, I am creating a "sticky" checkbox for my content type "news". this means that one news node is sticky, and is used in a banner like box. This is marked by a checkbox int the cck create content form. The checkbox is handled by the node_api, so I check: if $op = 'update' and $node->type = 'news' then ... logic. I don't know why bu...

Additional submit event handler for webform in Drupal 6

Hello, Im using Drupal 6.19 and the webform module on my site.On a particular form,i want to do some additional processing with the values entered,so i created a module and implemented hook_form_alter, and added my own function called mymodule_webform_submit to the list of submit event handlers. Suppose i have two fields in the form ha...

Drupal 6 Form Api adding an item to an existing form.

Please delete duplicate question ...

Drupal 6 Form Api adding an item to an existing form.

I want to add a new item into an existing form. I have the ID of the form and I know I need to use hook form_alter but not sure how to add it. function modulename_form_alter(&$form, $form_state, $form_id) { switch ($form_id) { case 'form id goes here': // Need to do something here.... break; ...

Load external script in <head> in Drupal 6

I want to load an external script in <head>. It is module specific so I want my module to take care of the loading. In Drupal 6, function drupal_add_js() does not allow to add an external script in <head>. It will be available in Drupal 7 passing the "external" argument to the function. In D6, I can use drupal_set_html_head() instead, b...

Drupal 6 editing the submit function on a content type

I have a content type and I wish to edit the submit function. I thought the way you would do this would be as follows: function moduleName_contentType_node_form_submit($form, &$form_state){ drupal_set_message(t('Test')); } I cleared the cached but the message is not being displayed on the screen. Am I doing this correctly or do I ...

Drupal 6 getting the node title from a submitted form

I am using form_alter to edit the submit function when editing content. In my custom function I wish to edit a custom message to the screen with the title name. I thought a way I could do this is something as follows function mymodule_myfunction(&$form) { drupal_set_message(t('Some text ' . $form['#node']->title)); } The title is ...

Remove required attribute from a CCK FileField

Hello. I have a node with a required CCK filefield. I want to remove the field requirement on certain pages, so I added a hook_form_alter in my module and tried the following: $form['field_image_file']['#required'] = false; which doesnt work! Printing the $form I see that there are loads of places where the #required value is set to...

Globally filter the whole site by tag

Hello! I am looking for an easy way to allow visitors of our Drupal 6-based website to filter all displayed obejcts globally by a tag from a given taxonomy ("featured topics"). This way a user could eg. select the tag "marketing" from a drop-down-list, which is located somewhere near the navigation, and the system would filter all pages...

Bring field content from "parent" node to "child" node in Drupal

What I need to do is bring data from a field in a "parent" node to a "child" node. Something like the following: $myactive_trail = menu_get_active_trail(); $parent = $myactive_trail['2']['link_path']; print $parent->field_video['0']['filepath']; I know that there is not such thing as a parent not hence me trying to use menu_get_active...

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. ...

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(); ...

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 6, add taxonomy terms in search results

Hello I want to add taxonomy terms in every search item of search results. All I know that I can use hook_search, but for me it's too hard to use this hook. Could anybody give me advice, maybe other hooks exists? Regards ...