The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to to force the templates to parse a php script and then call it like '$script'
This is what I have in my phpinclude_start file in the template section of the admin cp:
Code:
// Example of how to include a seperate file: // ob_start(); // require("yourheader.html"); // $header = ob_get_contents(); // ob_end_clean(); $numrows = 19; if ($numrows > 1) {$numrows = $numrows-1; mt_srand((double)microtime()*1000000); $bannum = mt_rand(0, $numrows); } else $bannum = 0; $banneraddress="/home/actuary/public_html/banners/banner".$bannum.".html"; $bannerurl = file_get_contents($banneraddress); $bannerurl and one of my banners would show up, but now I get nothing. Is there a change in vB 3.5 with the syntax that I'm missing or is there a better way to server up random html code in the header that I don't know about? |
#2
|
||||
|
||||
vb 3.5 does not use the phpinclude template, you need to move that code to a plugin, using the global_start hook.
btw, the logic of that code is a bit strange, you set numrows=19, and then immediately test if its > 1, which obviously it will be .......... |
#3
|
||||
|
||||
Right on Paul. That worked like a charm, thanks.
What I did in Laymen's terms plugin system >> add new plugin added title (bannerurl) and call it in navbar using $bannerurl and used hook location 'global_start' under 'vBulletin; General" My banner ads rotate just fine now. Thanks. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|