![]() |
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... |
I'd put it in global.php
|
phpinclude_start (template) would be better
|
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!
|
in vb2 it's called just phpinclude :)
|
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? :( |
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> |
Thank you Xenon! You're the man!!!
It works perfectly fine now. |
you're welcome :)
|
All times are GMT. The time now is 02:59 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|