The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Plugin Help Please
please can someone provide support with the plugin system
i wish to add a template condition in the header using $find, the code i iwsh to insert is Code:
<vb:if condition="$vboptions['ie6fix_onoff']"> {vb:rawphrase ie6fix_english} </vb:if> Code:
<div class="above_body"> <!-- closing tag is in template navbar --> |
#2
|
||||
|
||||
You will need to do your condition first. Then spit the results into a variable, like $add_before. Then do something like this:
PHP Code:
|
#3
|
|||
|
|||
this is how far i have got and hope it worked, but i have done something wrong but dont now where
Code:
if ($vbulletin->options['ie6fix_onoff']){ $ie6fix = '<vb:if condition="$vboptions['ie6fix_onoff']"> {vb:rawphrase ie6fix_english} </vb:if>'; $find = '<div class="above_body">'; $add_before = "$ie6fix". PHP_EOL; $output = str_replace($find,$add_before.$find, $output); } Parse error: syntax error, unexpected T_STRING in /home/ereptalk/public_html/includes/functions.php(6851) : eval()'d code on line 8 i know its my plugin but dont understand where it is wrong |
#4
|
||||
|
||||
If you are testing for whether the option is true already, then why are you wanting to test it again in the template? You should only need to test it in the plugin. And $output was just my example of a variable name, you probably want to use $vbulletin->templatecache['templatename'] instead.
|
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
This:
Code:
$add_before = "$ie6fix". PHP_EOL; should be: Code:
$add_before = '"$ie6fix". PHP_EOL'; |
#7
|
|||
|
|||
Quote:
Parse error: syntax error, unexpected T_STRING in /home/ereptalk/public_html/includes/functions.php(6851) : eval()'d code on line 8 what i want to try do is create a customer template then insert this template into the headr do you know how to do that ? |
#8
|
||||
|
||||
raw phrases don't work with str_replaces like it did in vb 3. It would have to be done a whole different way.
|
#9
|
|||
|
|||
Quote:
i would like to call the template inside another |
#10
|
||||
|
||||
You would have to preregister the template you wanted to call.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|