Adding a hook so other module can react to a vote

roychri - September 19, 2008 - 03:22
Project:DrupalIt
Version:5.x-1.4-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

If the drupalit was using module_invoke_all('drupalit') when a vote is casted, other module could be notified of a vote and react to it.

Other modules would simply have to implement a hook_drupalit($nid, $data) function to do whatever they want when a user votes.

For example, the userpoints_contrib module could have a module that give points to users which votes on a node using drupalit module. I wrote such module but I cannot contribute it back unless the drupalit module uses a hook.

Here's my proposed solution (attached).

What do you think?

AttachmentSize
hook_drupalit.patch726 bytes

#1

ergelo - February 2, 2009 - 02:42

i would be very interested in this functionality, especially if it would allow integration with the actions module.. unfortunately i rather not test as my site is live already and wouldn't want to interfere with current functionality.. will give it a go as soon as i have time to create an empty setup.. plz let me know how its going
b.

 
 

Drupal is a registered trademark of Dries Buytaert.