The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I run a PHP script in my templates? (VB 3.03)
I have written my own code to randomly display a banner that is PHP/mySQL based. What I am trying to figure out is how to get the code which works great when I call it myself to work with Vbulletin.
The code is PHP Code:
<script src="http://www.newcelica.org/banners/display.php"></script> But it does not display anything. Any help is truly appreciated as I'm stumped on this one. |
#2
|
||||
|
||||
<script> tags are used for client-side scripting. PHP is server-side. Have you tried editing the core files directly?
|
#3
|
|||
|
|||
you mean edit index.php rather then the templates. I suppose thats an option but figuring out how to get the placement exactly where you want it with out using the templates is a pita.
|
#4
|
||||
|
||||
Just copy the script into the correct php file and ommit the "echo". And then just put $banner where you want it in the templates.
|
#5
|
|||
|
|||
I tried that and it did not work; It doesn't display anything.
I added the following to the index.php file require_once('/pathto/display_ar.php'); And in the display_ar.php file I simply set the variable $banner and I tried calling it in my header template and it did nothing. |
#6
|
|||
|
|||
Why dont you make a plugin?
Hook Location global_start ob_start(); include('/pathto/display_ar.php''); $banner = ob_get_contents(); ob_end_clean(); and put $banner in your template |
#7
|
|||
|
|||
tried that too.. I put it in the PHP Include Start Template. And it did nothing either.
|
#8
|
||||
|
||||
Errr, vBulletin 3.0.3 has not got a plugin system.
|
#9
|
|||
|
|||
also don't forget to set your variable global in plugin - if you will make plugin!
global $banner; $banner = ..... otherwise you will not see your variable in some templates. |
#10
|
||||
|
||||
Do you not understand vBulletin 3.0.3 doesn't have a plugin system?
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|