drupal-module

Date errors upon programatically inserting multiple nodes in Drupal

I am building a Drupal module that (among other things) creates multiple nodes of type 'individual_match' when a node of type 'team_match' is created. A team_match is a collection of related individual matches. I used the method explained on Advomatic, which I found in an old Stack Overflow post. It works great (meaning it creates the n...

Drupal get module info?

Is there any function in Drupal like get_module_info('MODULE_NAME') or I should parse info file? ...

Reading node field values in module code using Drupal 6

I have created a custom module and am using hook_block to programmatically create some blocks. My question is how can I access field values including CCK fields for the current node within my module? I basically want to get a value from a CCK field and use the value when building my block for that page. ...

Drupal FB-Connect and IE

i have installed the fbconnect module under drupal 6. i have added <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language ?>" lang="<?php print $language->language ?>" dir="<?php print $language->dir ?>"> to every pag...

Imagefield Crop – use existing file

Is there a way to make a few images with Image Crop out of one uploaded file? Currently i have to upload the same, big pic to get new pics with various dimensions. Unfortunately the "Imagefield sources"-module doesn´t support Image Crop. Is there an alternative? ...

how do i filter out content from a default Drupal View, based on what content is pulled into the attached view?

currently: i have a page view that is displaying all content that is flagged as "not featured" with a simple CCK dropdown. the attachment to the view displays all content that is "featured" and is styled to be a little more impressive. what i'd like to be able to do is have a few, say 3, featured items display at the top in the attach...

how to make a filter for View which find nodes that have a user_reference field referring current user?

I have a content type, named "Task". It has a cck user reference field named "assigned_user". I want to filter Tasks, which their assigned_user is current user. how can I use "Token Filter" for this for my view? I installed this module but I didn't find anywhere for inserting tokens in view filter. Does exist any better way? ...

Passing arguments using drupal_get_form()

Here is my custom module using hook, Assume if I want to pass argument to custom1_default_form function call, how should i pass the argument? <?php function custom1_block($op,$delta=0){ if($op=='list'){ $block = array(); $block[0]['info']=t('hello world'); return $block; }else if($op=='view'){ $...

Separating a Drupal module logic and UI

I wrote a D6 module which provide user with the ability to communicate, config params and test a 3rdparty API service. The module works as intended but I want to separate the communicator class and bundle it as foo module. Then pack the rest (admin page) as the foo-ui module. Just like views and views-ui. I have no idea about what's the...

How to change Drupal user password programmatically?

We are going to deploy a Drupal site inside company's intranet. There is a requirement for user to reset password. We have a centralized password reset mechanism (for single sign on): user submits a password change request in system the request is sent to a password server the password server will reset the user's password in all syste...

How could I have a cck field get the computed value of another cck field?

Lets say I have a cck field called foo. It is a text field with php input. Say the php code in foo field results in the value of 1,256 when computed. I need cck field called bar to pick up/obtain/have the VALUE (1,256) of cck field foo. Node XYZ Foo:*some php code* ===>results in value of 1,256 Bar:1,256 If I just have cck fi...

Drupal: passing arguments to drupal_get_form form function

Is there any way to pass arguments into a function called via drupal_get_form function something like drupal_get_form('form_func', array('arg1' => 1, ...));? ...

hook_theme() does not pass arguments

I currently write a module that generates a block. The output should be defined by a template. Nothing special, yet the arguments don't seem to get passed properly. This is the theme-method: /* # Theme {{{*/ function browse_by_taxonomy_theme() { return array( 'browse_by_taxonomy_block' => array( 'template' => 'browse_by_tax...

Serving multiple site with one drupal (not using multi site)

Hi All, I am looking for expert advice on how to best serve multiple sites with one Drupal instance (using Pressflow 6.x). Let's consider the company needing this is called "ABC Group of Companies" and it has 3 sister concerns. So, altogether there will be four sites: www.abcgroup.com www.company-a.com www.company-b.com www.company-c....

Generating secondary menu based on node titles

I would like to generate a secondary menu based on the first letter of all of my nodes that have a certain content-type, however I am unsure how to go about doing this. Basically, I will be generating an alphabetical list of all nodes that I have (for a given content-type). For instance, I would like to have my secondary menu generate ...

Drupal page route URL

Hi, I m using the pageroute module to create a multistep registration form. When the user goes through the registration proccess the URL remains same for each page in the pageroute. for example my path for the route is user/signup and i have page1, page2 and page3 added in the route, so now when the user goes to page1 or page2 the url ...

Sharing data with blocks

I have a page that displays some data. The source of the data is not Drupal nodes, so Views is of no use me: function mymodule_main_page($arg1, $arg2, $arg3) { $results = call_remote_api_and_get_lots_of_results($arg1, $arg2, $arg3); return theme('mymodule_page', $results, $arg1, $arg2, $arg3); } My module also displays a block. Th...

Do disabled Drupal modules affect performance?

Does having Drupal modules installed but not enabled have any effect on the performance of a Drupal site? To put it another way.. Would removing disabled modules from a Drupal site have a positive affect on performance? ...

what is the purpose of Id in drupal .info

in in drupal , what is ; $Id: i know for when we use this ; $Id:,strong text for create block , we should first create .info module, this tell to drupal about the our module/ block / menu inform , my question what is necessary of ; $Id: What is the use , In which place it is calling , ...