calorie
12 Jun 2005, 00:38
In hooks_vbulletin.xml you will see things like the following:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The hooktype is just a unigue name for the hook tags within. The hook tags refer specifically to PHP code in the vB files.
The PHP code in the vB files looks like the following:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Note how global_start is in a hook tag in hooks_vbulletin.xml and also in the vB PHP code.
To make a plugin hooked to global.php, you create an XML file as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The place in vB PHP code where your global_start plugin runs is where the following occurs in global.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Basically, you make plugins via XML and your plugins hook to vB PHP code
via <hookname>hook_name</hookname> from the plugins,
which needs to match the fetch_hook('hook_name') in the vB PHP code,
which needs to match <hook>hook_name</hook> in hooks_vbulletin.xml.
You can even make a plugin that hooks to multiple vB PHP files as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This latter example runs the first batch of PHP code where the following occurs in global.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
And runs the second batch of PHP code where the following occurs in index.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Again, note how <hookname>hook_name</hookname> in the XML plugin
matches fetch_hook('hook_name') in the vB PHP code
matches <hook>hook_name</hook> in hooks_vbulletin.xml.
Further readings...
What is a hook:
- http://www.vbulletin.org/forum/showpost.php?p=665079&postcount=11
How to make a plugin:
- http://www.vbulletin.org/forum/showpost.php?p=664115&postcount=14
How to add a new hook location:
- http://www.vbulletin.org/forum/showpost.php?p=663701&postcount=1
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The hooktype is just a unigue name for the hook tags within. The hook tags refer specifically to PHP code in the vB files.
The PHP code in the vB files looks like the following:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Note how global_start is in a hook tag in hooks_vbulletin.xml and also in the vB PHP code.
To make a plugin hooked to global.php, you create an XML file as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The place in vB PHP code where your global_start plugin runs is where the following occurs in global.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Basically, you make plugins via XML and your plugins hook to vB PHP code
via <hookname>hook_name</hookname> from the plugins,
which needs to match the fetch_hook('hook_name') in the vB PHP code,
which needs to match <hook>hook_name</hook> in hooks_vbulletin.xml.
You can even make a plugin that hooks to multiple vB PHP files as follows:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This latter example runs the first batch of PHP code where the following occurs in global.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
And runs the second batch of PHP code where the following occurs in index.php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Again, note how <hookname>hook_name</hookname> in the XML plugin
matches fetch_hook('hook_name') in the vB PHP code
matches <hook>hook_name</hook> in hooks_vbulletin.xml.
Further readings...
What is a hook:
- http://www.vbulletin.org/forum/showpost.php?p=665079&postcount=11
How to make a plugin:
- http://www.vbulletin.org/forum/showpost.php?p=664115&postcount=14
How to add a new hook location:
- http://www.vbulletin.org/forum/showpost.php?p=663701&postcount=1