vBulletin ModsThe Official vBulletin Modifications Site
http://www.vbulletin.org/forum/showthread.php?t=83390 |
I've not seen this mentioned anywhere yet - but you don't need to edit the hooks_vbulletin.xml file to add custom hooks, you can create your own files in the same manner as cpnav files.
For instance, you could create a file called hooks_custom.xml file (as below) and just drop it in the xml folder.
They appear at the top of your hooks list in ACP. This way your custom hooks will not get overwritten each time you upgrade. You could also supply a hooks_<hackname>.xml with custom plugins if required. |
||||||
thats a great idea. that will come in handy sometime
|
Good grief, I'd forgotten I even posted this ..... :)
|
lol. how could you?!
|
Hello.
What does this mean: Fatal error: Cannot break/continue 1 level... I've added a custom hook. It's located in a 'foreach' statement. All I did was move a chunk of code that tested fine to a new plugin and added a custom hook location in its place. I used a custom 'Product' instead of vBulletin. That chunk of code started off with a conditional statement that pertained to a usergroup permission. For the usergroup that didn't meet the condition, that error message mentioned above appeared. The usergroup that met the condition had no error. This error did not exist before the custom hook-to-code replacement. Any ideas? I love this thread's instructions. Thanks in advance. Edit: The answer is found at: http://www.vbulletin.com/forum/showthread.php?t=168513 It basically says that hooks can't be added to 'foreach'... That thread does make a suggestion, though. |
Thanks Paul, that's an awesome Info. Now my custom Hooks will be not overwritten if i will make an vb update again ;)
I didn't realize before that custom hooks could be also in a separate File. |
What adventages have the hook over the includes?
I could think than the hooks give more resources usages or not? or these are saved in the datastore? |
Quote:
|
thanx for the info
|
Quote:
|
Quote:
Would you please edit your first post to specify the includes\xml folder so it don't have to hunt for it each time? Thanks! |
Quote:
|
How do you know when to use a hook and when not to. I'm very new to vb programming. :)
Jim |
Maybe someone should mention were these hooks are added?
|
Ok Paul your my Code God! With this simple xml file I am now able to quickly make my own hooks to call vbblog, experience, or any other mod that was using the $template_hook[profile_left_last] hook and putting importnat tabs lost in that left side garbade pale location on profile pages!
No I just make my custom hook name plce in the the MEMBERSINFO template, change the plugin hook location from: $template_hook[profile_left_last] to my cutom hook and poof! I have complete profile tab control once and for all! TANK YOU!!! |
| All times are GMT. The time now is 22:43. |
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2001 - , vbulletin.org. All rights reserved.