This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Overhead of hook system in module calls

My fellow drupal developers,

I am planning to extend a module to include aditional functionalities. I am pondering between inserting this new functionality either in a extra php file which the module includes, or to add new hooks to the module that then calls the implementing module.

I am aware the second option seems the most desirable, but how much overhead does the hook system adds, if the hook is made in a place where multiple call to it can be made per page request (up to 20 requests)?

Could someone give me an advice on the best approach?

_user hook: when does a uid get assigned?

I'm creating a module that needs to know the uid of a new user to update a db table. I've tried placing my SQL call in the 'validate' and 'insert' sections of hook_user, but neither work: in validate I get a uid of 0, in insert I don't get a uid at all.

Any help on this? The life-cycle documentation for many of the hooks with operation arguments is pretty poorly documented. I'm not even sure that $user or $edit is valid in a hook_user 'insert'.

Thanks

does anyone have a php function - to build a CSS ID selector from a node name?

Does anyone have php code to build a CSS ID selector from a simple node url?

it would convert a node in the form

"node/subnode/subsubnode/subsubsubnode"

into:

"node-subnode-subsubnode-subsubsubnode"

So that the resultant string could be inserted into the output html with a css ID selector on every node drupal displays.

This function would go into the

node.tpl.php file of a phptemplate theme

So that certain desired nodes in pages produced by the theme could be styled in the style.css with the node unique ID selectors:

Ecommerce and Generic modules

Ecommerce and Generic modules

I have installed Ecommerce and Generic Module.

I would like the Generic module to automatically grant roles to users who pay through PayPal.

Node discussion: 46724 assigning users to roles programmatically

All comments greatly appreciated.

Thanks, Darly

adSense & PHP Template

i use the PHP Template witch method is the best for implement the adSense Module ? add a php block ?

cheer

Flexinode - a field_select issue

I'm trying to use the field select that comes with the contrib folder in flexinode.

I'm trying to edit my own node-flexinode-x.tpl.php, and I'm trying to fetch all sorts of fields, using $node->flexinode_y (where y is the field ID).
For the most part it works fine. But with the select field, I only get the option number, and not the text.

For example, say I defined a select field (lets say, with field ID 7) with the options:
OptionOne
OptionTwo
OptionThree
OptionFour

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions