I have 5 images that I want to randomly rotate as the logo and they are all the same size. The code as to go in the theme.php file. Does anybody know how to do this?
dsnail2000 Site Admin
Joined: Mar 17, 2003
Posts: 331
Location: Northern VA
Posted:
Sat Apr 12, 2003 2:13 pm
Code:
<?php
//Edit this line to the url of your image folder to randomize
//Must be a relative URL in your server, do not put in a forward
//or trailing slash for it to work.
$url='images/logos';
//Stop editing, that is all. Call the image with <img src=url/filename.php> That's all, enjoy. :D
I can't figure out exactly where to put this code and how to make it work.
sixonetonoffun Major
Joined: Jan 13, 2003
Posts: 892
Posted:
Sat Apr 12, 2003 2:21 pm
Put your file in the includes directory then use the code as you posted. Replace the logo.gif with filename.php see if that works.
//Stop editing, that is all. Call the image with <img src=url/filename.php> That's all, enjoy.
That didn't work, does anybody have any original code or code that they made work?
I want to be able to call a random image function from anywhere on the site, I would need to send the function the absolute URL of the images so it can choose the images from that directory.
ex: I call the function with the parameter of an absolute URL
the function then randomly chooses an image from that directory and sends back the file name and extension
Anybody know how to make an include file that will do this?
P.S. can this be called from inside an echo command?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum