-
Random image display
alright, after a bit of trial and error I wrote up a working Javascript that allows me to display a random image on a standard HTML-based website. It refreshes to a different image when you view it on the website. Now that I've made that, I'm wondering how, if even possible, I can use this script and the images it's rotating and put it on a forum using standard BBcode. Anyone got some suggestions or able to tell me straight up if it's possible or not?
-
In theory it's possible, but the forum would have to either a)allow Javascript (huge security risk) or b) have a routine written into the parser file to run Javascript code (huge security risk).
For forum use, your best best is to use a rotation routine written in PHP. Here's a link to an image rotation code written in PHP: http://www.alistapart.com/d/randomizer/rotate.txt
Save it as something like "rotate.php" and then call it with the IMG tags. My signature is now set up using the rotation script. I just put the randomizer script i nto a folder called "sigs" in the images folder of my site. The address of the file is http://masterquan.com/images/sigs/rotate.php. I didn't change any of the scripts. In the same folder ("sigs") as the the rotation script I put the images I wanted to rotate. Then I just called the script with [*img]http://http://masterquan.com/images/sigs/rotate.php[*/img] (without the *'s of course) and now with each refresh, the image should rotate to the next picture.
Send me a PM if you have any problems. :thumb:
-
Yeah I would have to agree with Zui PHP is better because you can add what images you want and it will add them in no problem