The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
php modification for a page
I got this part of php code I wanna incorporate in a .php file...it selects a random image:
<?php global $value; srand((double)microtime()*1000000); $value = rand(0,1); if($value==0){ $img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor1.gif"; } if($value==1){ $img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor2.gif"; } ?> and, lower <a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a> I'm just trying to figure out where I should put this because the whole thing is ran by templates... |
#2
|
|||
|
|||
I'd put it in global.php
|
#3
|
||||
|
||||
phpinclude_start (template) would be better
|
#4
|
|||
|
|||
Hi Xenon! I just looked under my vB2 and I do not have a phpinclude_start template. Is this something that needs to be added manually or perhaps it was accidently removed? I hope by not having this phpinclude_start template in my vB2 forum does not cause any serious problems or issues with the database!
|
#5
|
||||
|
||||
in vb2 it's called just phpinclude
|
#6
|
|||
|
|||
I tried to put the top part in the "phpinclude" template:
global $value; srand((double)microtime()*1000000); $value = rand(0,1); if($value==0){ $img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor1.gif"; } if($value==1){ $img="http://hiphopfranco.rapidenet.ca/sponsors/sponsor2.gif"; } And I tried to put the other part in the "forumdisplay" template (I wanna put the image in the "forumdisplay template"): <a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a> But it doesn't work. Sombody knows the problem? |
#7
|
||||
|
||||
change
Code:
<a href="blop.html" target="_blank"><img src=<? echo($img); ?> width="468" height="60" border="0"></a> Code:
<a href="blop.html" target="_blank"><img src="$img" /> width="468" height="60" border="0"></a> |
#8
|
|||
|
|||
Thank you Xenon! You're the man!!!
It works perfectly fine now. |
#9
|
||||
|
||||
you're welcome
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|