The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Organising user postbit info using hook
Hi All!
Don't shoot me down as I've not really ever looked closely at how to use the plugin/hook system as yet. I noticed since 3.6.8 that there's a new hook location in the user postbit below "posts" called "postbit_userinfo_right_after_posts". How could I go about creating a template called "postbit_extras" or something similar where I can place all the junk I've added to the user postbit over the years in one easy location, then having that template called into the postbit at the hook location? This would then allow me to keep all my junk in the postbit without having to revert the template and manually add the code each forum upgrade. I know how to do this without the hook, but It'd still require manual template edits every time the template is reverted. I'm sure this a simple one, but I searched everywhere and no one seems to have utilised this hook in this way yet? Cheers in advance! |
#2
|
||||
|
||||
Go into the postbit (and/or postbit_legacy) template and add this where you want to add your stuff:
Code:
$template_hook[postbit_junk] Now, create a plugin at "postbit_display_complete" and put in: Code:
eval('$template_hook[postbit_junk] .= " ' . fetch_template('postbit_extras') . '";'); |
#3
|
|||
|
|||
Thanks ever so much Lynne!!!
I didn't follow it exactly as you put though. Rather than creating $template_hook[postbit_junk] I simply used the existing $template_hook[postbit_userinfo_right_after_posts] and ran the following at "postbit_display_complete" as you said:- Code:
eval('$template_hook[postbit_userinfo_right_after_posts] .= " ' . fetch_template('postbit_extras') . '";'); |
#4
|
||||
|
||||
Yep, I do love this whole hook/plugin system. I only upgraded to 3.6.8 (from 3.0.12) in December and am still learning a lot about it. But, it sure is making my site a lot easier to work on.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|