Results 1 to 3 of 3

Thread: Random image display

  1. #1
    Untouchable Raven Omega may be famous one day Raven Omega may be famous one day Raven Omega's Avatar
    Join Date
    Oct 2004
    Location
    Pennsylvania, US.
    Posts
    765
    Thanks
    0
    Thanked 1 Time in 1 Post

    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?

  2. #2
    M A S T E R Zui Quan may be famous one day Zui Quan may be famous one day Zui Quan's Avatar
    Join Date
    Oct 2004
    Location
    A Vastly Superior Place
    Posts
    1,726
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Clan? What Clan?
    I'm the Master. I need no Clan.

  3. #3
    Legendary Otaku Sinistra may be famous one day Sinistra may be famous one day Sinistra's Avatar
    Join Date
    Oct 2004
    Location
    Radford VA
    Posts
    2,528
    Thanks
    0
    Thanked 3 Times in 2 Posts
    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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts