The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I have a mini mod on my site that looks something like this:
Code:
Hook Location : global_start Execution Order : 5 PHP Code : require_once('./includes/_taglinemessages.php'); Code:
<? $taglines = array(); $taglines[] = 'Text 1'; $taglines[] = 'Text 2'; $taglines[] = 'Text 3'; $rand_keys = array_rand($taglines, 1); $template_hook['tagline'] = $taglines[$rand_keys]; ?> Code:
<span>Message : <i>{vb:raw template_hook.tagline}</i></span> So, does anybody have any ideas on how to solve this? |
#2
|
|||
|
|||
![]()
Anybody?
|
#3
|
||||
|
||||
![]()
First, don't use global_start, it's deprecated (do a search on it in your files and you'll see). I'd actually suggest global_bootstrap_init_complete otherwise you'll need to preregister template_hook (again, you'll see this if you look at the code).
I put the php directly into the plugin and it worked fine for me. Did you try that? |
#4
|
|||
|
|||
![]()
Fantastic, the hook suggested worked a treat.
Regarding the location of the php code, I prefer to put hook php into file. Doing it this way means that the opcode cachers can work on the file - if the php is in the hook itself then it can't be cached in the same way. For a couple of hooks here and there it makes little difference, but once you have a number of hooks the difference is noticeable. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|