PDA

View Full Version : custom hook - hooks_custom.xml - how to reference?


Rik Brown
14 Mar 2007, 01:59
I need to create a custom hook to move the location of a 3rd party hack. So that the hook won't get overwritten in any future vb upgrade, I created a file named hooks_custom.xml in the forums/includes/xml directory. I've created a plugin named TEST that simply has a one-line php echo statement for testing purposes and I've been able to assign that plugin via the following dropdown menu:

Plugin Manager > Product : vBulletin > TEST > Hook Location ...

... to a new hook location named "left_column_top". So the hooks_custom.xml file is being read correctly.

However, I'm not sure how to reference the hook in the template in which we are placing it. Other messages about hooks show a reference such as:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



... which doesn't work.

Would "vBulletinHook" need to changed to something like "customhooks" (I've tried several variation of that)?

Anyone know what I'm doing wrong?

Thanks. -- Rik

Zachariah
25 Mar 2007, 15:45
<hooks> - anything between this tag and </hooks> will be included in the drop down

<hooktype type="name"> - The name of your hook group, you should group all common hooks under a group so you can find them quickly. Make sure you don't use a name already used by a default hooktype.

<hook> - The name of your hook, this must be the same as the hook's name in the php code


XML file:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------





I am assuming that you are working in a PHP file that includes /forums/includes/global.php.

PHP


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

Marco van Herwaarden
25 Mar 2007, 21:06
However, I'm not sure how to reference the hook in the template in which we are placing it. Other messages about hooks show a reference such as:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------




You can not place PHP code in a template.

Rik Brown
26 Mar 2007, 03:20
Zachariah & Marco:

I'll give it a try again. Thanks for your comments and help. -- Rik