vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   pm when member is promoted (https://vborg.vbsupport.ru/showthread.php?t=115540)

creedmaniac 05-14-2006 07:08 AM

pm when member is promoted
 
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:

PHP Code:

($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....03&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.


All times are GMT. The time now is 10:53 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00982 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete