![]() |
|
|
Article Options |
|
Custom Hooks
by
Rating:
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. The following members like this post: phpdesk
|
||||
|
Views: 10429
|
||||
| Comments |
|
#2
|
|||
|
|||
|
thats a great idea. that will come in handy sometime
No members have liked this post.
|
|
#3
|
||||
|
||||
|
Good grief, I'd forgotten I even posted this .....
![]()
__________________
Cable Forum - DigiGuide Please Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum. Senior vBulletin Developer : Please do not PM me about custom work - I work for Internet brands and no longer have the time to undertake any. No members have liked this post.
|
|
#4
|
|||
|
|||
|
lol. how could you?!
No members have liked this post.
|
|
#5
|
|||
|
|||
|
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. No members have liked this post.
Last edited by timetunnel : 29 Nov 2006 at 20:16. Reason: UPDATE |
|
#6
|
||||
|
||||
|
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. No members have liked this post.
|
|
#7
|
|||
|
|||
|
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? No members have liked this post.
|
|
#8
|
||||
|
||||
|
If your modification allows flexibility where Administrators can extend the modification, hooks will allow them to do without editing the files.
No members have liked this post.
|
|
#9
|
|||
|
|||
|
thanx for the info
No members have liked this post.
|
|
#10
|
||||
|
||||
|
No members have liked this post.
|
|
#11
|
||||
|
||||
|
Originally Posted by Paul M
Thanks again for this tip, Paul M!
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! No members have liked this post.
|
|
#12
|
|||
|
|||
|
Theres only one XML folder in all of vBulletin. :P
No members have liked this post.
|
|
#13
|
||||
|
||||
|
How do you know when to use a hook and when not to. I'm very new to vb programming.
![]() Jim No members have liked this post.
|
|
#14
|
||||
|
||||
|
Maybe someone should mention were these hooks are added?
No members have liked this post.
|
|
#15
|
||||
|
||||
|
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!!!
__________________
Yotsume Kaydev Media Productions Check out my mods: EYO-AIM, FlashChat Combo-Module for vBadvanced 3.6x or 3.7x No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
| Article Options | |
|
|
| New To Site? | Need Help? |
All times are GMT. The time now is 01:02.





