The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to include HTML file
In 3.x version, I can add a plugin. $test=implode (file, dir).
Then add $test in a template. How to do this in 4.x version? |
#2
|
|||
|
|||
You can pre-register the variable in the template where you will use it, like this:
Code:
vB_Template::preRegister('template_name', array('test' => $test)); and then of course you'd use one of HTML Code:
{vb:raw test} or {vb:var test} |
#3
|
|||
|
|||
I pre-registered:
Code:
$include_defaultpage = implode('', file('/bbs/CCED/float/default.html')); vB_Template::preRegister('footer',array('include_defaultpage' => $include_defaultpage)); I put {vb:raw include_defaultpage} into the footer template. However, it does not work. |
#4
|
|||
|
|||
I tried what you posted above, except that I just used $include_defaultpage = "Foo"; as a test, and it showed up in my footer. Are you sure you're looking at the style with the edited footer? Otherwise, maybe it's not finding your html file?
Edit: also, are you sure you set the plugin to active? I've been known to forget that occasionally. |
#5
|
|||
|
|||
I also tried $include_defaultpage = "Foo";, It still does not show up.
--------------- Added [DATE]1309229656[/DATE] at [TIME]1309229656[/TIME] --------------- Here is how I write: Code:
Plugin PHP Code $include_defaultpage = implode('', file('/bbs/CCED/float/default.html')); $include_defaultpage = "test"; vB_Template::preRegister('FOOTER',array('include_defaultpage' => $include_defaultpage)); |
#6
|
|||
|
|||
'footer' needs to be lower case. You had it that way before so I guess you probably were trying things.
|
#7
|
|||
|
|||
I just did a test. If I put this plugin in header template. It works.
vB_Template:reRegister('header',array('include_d efaultpage' => $include_defaultpage)); --------------- Added [DATE]1309230334[/DATE] at [TIME]1309230334[/TIME] --------------- it works now. I changed /bbs/CCED/float/default.html to CCED/float/default.html You are right. It did not find the file. Thanks. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|