The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
A plugin I released seems to be causing some errors for people, although I can not duplicate it. Can anyone find an issue with this code:
Code:
<plugins>
<plugin active="1">
<title><![CDATA[Inactivity Timer [Optional]]]></title>
<hookname>global_start</hookname>
<phpcode><![CDATA[$headerstime = time();]]></phpcode>
</plugin>
<plugin active="1">
<title><![CDATA[Welcome Headers [Alteration]]]></title>
<hookname>parse_templates</hookname>
<phpcode><![CDATA[
eval('$welcomeheaders = "' . fetch_template('welcome_headers') . '";');
]]></phpcode>
</plugin>
<plugin active="1">
<title><![CDATA[Welcome Headers [Template Cache]]]></title>
<hookname>fetch_userinfo</hookname>
<phpcode><![CDATA[
global $globaltemplates;
$globaltemplates = array_merge($globaltemplates, array('welcome_headers'));
]]></phpcode>
</plugin>
</plugins>
Quote:
|
|
#2
|
||||
|
||||
|
Try changing this:
<hookname>fetch_userinfo</hookname> to the cache_templates hook. |
|
#3
|
||||
|
||||
|
and after changing the hook location, change the code for that hook to this ;
$globaltemplates[] = 'welcome_headers'; |
|
#4
|
|||
|
|||
|
Thanks guys!
|
|
#5
|
||||
|
||||
|
Yes. array_merge() for a template that surely isn't already in $globatemplates isn't really necessary; use the assignment as Paul M suggested.
|
|
#6
|
|||
|
|||
|
Will do! I'll post back if this solves the isse. Thanks again!
|
|
#7
|
||||
|
||||
|
Quote:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|