View Full Version : pm when member is promoted
creedmaniac
05-14-2006, 07:08 AM
I'm trying to make a hack (plugin if possible) that will send a pm to a member when they are promoted to the next higher rank.
I don't even know where to start at though...any ideas?
Alan @ CIT
05-14-2006, 08:06 AM
The first step would be to find the block(s) of code that are run when a member is promoted, either via automatic promotion because they've hit x number of posts, or manually by an admin.
Once you've found that, look for the closest hook, and write the plugin that will send a PM. If memory serves, there's a tutorial in the 3.5 Mod Tutorials section by Kirby or Marco (I forget which) that shows you how to send a PM.
Thanks,
ALan.
creedmaniac
05-14-2006, 08:50 AM
ok, little more info about me...
never done a plugin or anything before...
what does a hook look like?
Alan @ CIT
05-14-2006, 08:55 AM
When looking through the vBulletin code, a hook looks like:
($hook = vBulletinHook::fetch_hook('threadmanage_update')) ? eval($hook) : false;
This corosponds to the "threadmanage_update" hook in the AdminCP -> Plugins section.
To get started, take a look at some of the tutorials here: https://vborg.vbsupport.ru/showpost.php?p=807303&postcount=1
Start with the basics, then move up.
Thanks,
Alan.
creedmaniac
05-14-2006, 09:35 AM
thanks a bunch alan...
now to go get started on my first hack :)
Alan @ CIT
05-14-2006, 09:37 AM
Good luck :)
creedmaniac
05-14-2006, 10:26 AM
is there a list of hooks, their locations, and a general synopsis of what they do anywhere?
Alan @ CIT
05-14-2006, 10:32 AM
A list of hooks can be found in /includes/xml/hooks_vbulletin.xml
Most of them should be fairly self-explanatory. The <hooktype type> is the general area they are run (editpost, calendar, etc), with each hook having a more specific location.
When I'm looking for a hook to add some code to, I find the easiest way is look in the vB PHP files themselves.
For example, if I wanted to ruin some code whenever a thread is deleted, I'd go to postings.php which handles the thread tools options, then browse through it until I found the section of code which deletes threads, then find the closest hook.
Thanks,
Alan.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.