Log in

View Full Version : I want VB to run a query when I delete a User


upirate
03-25-2007, 01:28 PM
where can I put such a query ?

thankyou

calorie
03-25-2007, 01:58 PM
Try hooks...

useradmin_prune
userdata_delete

upirate
03-25-2007, 02:09 PM
calorie,
thanks soooooo much for replying.

Im new to VB. How do I get about playing with hooks ?

thanks again

calorie
03-25-2007, 02:32 PM
Take a read through the following to get a sense of how it works, and then find the hooks in the vB code to see what is available to you for use in your plugins:

http://www.vbulletin.com/docs/html/main/what_is_hook
http://www.vbulletin.com/docs/html/main/what_is_plugin
http://www.vbulletin.com/docs/html/main/plugin_system
http://www.vbulletin.com/docs/html/main/creating_a_product
http://www.vbulletin.com/docs/html/main/writing_plugin_code

That is, if you want to run a query in a plugin located at hook X, you need to know what is available, what to use, and what to avoid:

// Example...

$db
$vbulletin->db
$this->dbobject
$this->registry->db

upirate
03-25-2007, 03:00 PM
thanks calaorie. youre awesome!

so

useradmin_prune
userdata_delete

are hooks thata re already in VB ?

I understand userdata_delete. what is useradmin_prune ?

calorie
03-25-2007, 03:15 PM
The useradmin_prune hook is in the /admincp/user.php file.

upirate
03-25-2007, 03:30 PM
I see!

Is there a place with a list of hooks and their location documented somewhere ? I tried a search on forums but no luck.

calorie
03-25-2007, 03:34 PM
The /includes/xml/hooks_vbulletin.xml file contains a hook list with location hint.

upirate
03-25-2007, 09:52 PM
cool thanks a lot.

I think it makes most sense to use the useradmin_prune hook