Image Rotator
Results 1 to 11 of 11

Thread: Image Rotator

  1. #1
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113

    Image Rotator

    okay, just wondering if anyone knows of a script or something to rotate an image on a website. I know there are lots out there, but I need one that rotates a link for the picture. I want each time someone accesses the link (www.mypage.com/mypic.jpg for example) I want it to display a different picture.

    I know there are lots of javascripts etc. that will rotate the image on a page, but thats not what I want

    any help or suggestions would be greatly appreicated
    Never let the facts get in the way of a carefully thought out bad idea!

  2. #2
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    can you sue php? I have some code already to do this, its very ez


    PHP Code:
      <?
      
    //Set random engine
      
    srand((double)microtime()*1000000); 
      
    //Set what to make random
      
    $random_img = array("<img src=\"img1.jpg\" alt=\"this is image 1\" border=\"0\">",
      
    "<img src=\"img2.jpg\" alt=\"this is image 2\" border=\"0\">",
      
    "<img src=\"img3.jpg\" alt=\"this is image 3\" border=\"0\">",
      
    "<img src=\"img4.jpg\" alt=\"this is image 4\" border=\"0\">",
      
    "<img src=\"img5.jpg\" alt=\"this is image 5\" border=\"0\">");
      
    //Calc the random images
      
    srand(time());
          
    $sizeof count($random_img);
          
    $random = (rand()%$sizeof);
          
      
    //Display Random Image
      
    echo $random_img[$random];
      
    ?>
    Last edited by +Daemon+; March 23rd, 2004 at 07:50 PM.

  3. #3
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113
    yah I can use php code, just as long as when someone clicks on the link to the picture (a link not on my page) it loads a different picture
    Never let the facts get in the way of a carefully thought out bad idea!

  4. #4
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113
    I don't think that will work, it just rotates pictures on a page

    I have webspace, but I need to link to a bunch of pictures from another website, so when someoen loads the image www.mypage.com/mypic.jpg or whatever the link is, I want it to display a different picture
    Never let the facts get in the way of a carefully thought out bad idea!

  5. #5
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    oooh like a angelfire thing

  6. #6

  7. #7
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113
    Quote Originally Posted by +Daemon+

    Um, maybe, I could be wrong, but isnt' that script just to prevent people from linking to your picture on your website?? The Thing is I Want people to link to a certain picture on my site, but everytime they load that link a different picture will appear. The way this other site is set up is it will only allow a link to a picture (.jpg, .gif), and it was originally only designed to link to one picture, but I want it to rotate the image. So when it loads www.mysite.com/picture.jpg like it normally does, I want the picture ot be different each time

    I know this sounds confusing, but I think it should be able to be done, I'm hosting the images off a good host, not just geocites or whatever if free
    Never let the facts get in the way of a carefully thought out bad idea!

  8. #8
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    so like a javascript image click rotation, but have the link the same?


    somthing in the means of
    http://www.codebelly.com/javascript/...gechange.html#

  9. #9
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113
    Quote Originally Posted by +Daemon+
    so like a javascript image click rotation, but have the link the same?


    somthing in the means of
    http://www.codebelly.com/javascript/...gechange.html#

    Sorry, I know my request is really confusing, and I suck at explaining

    This is sorta what I want to do (same idea)

    It would sorta be the same as having an avatar for a messageboard, in the messageboard you specify the address for your avator (www.mysite.com/avatar.jpg), normally it would display the same pic everytime. My goal is to have a directory of images hosted off my website, that would display a new picture each time the messageboard loads the avatar from the location you specify, instead of the same picture each time.

    This might be impossible, but I sorta think it can be done
    Never let the facts get in the way of a carefully thought out bad idea!

  10. #10
    Registered User +Daemon+'s Avatar
    Join Date
    Jan 2002
    Location
    RC, Ca
    Posts
    3,406
    you would have to use that php random code and set the server extitions to use jpg as a php file then put in that code and have it open a random image and them rewrite the image and spit it out. So the avatar.jpg looks like a image file but its really a big php file named as a jpg... get it ?

    kinda like this (the image create part)

    http://daemonprojects.com/imgcreate/go.php

    note it refreshes to the image, thats because im lazy and didnt setup my apache.conf file to use jpg files as a page.

  11. #11
    Registered User
    Join Date
    Jan 2001
    Location
    Middle of Nowhere and 1 mile north, in Alberta, CANADA
    Posts
    113
    Quote Originally Posted by +Daemon+
    you would have to use that php random code and set the server extitions to use jpg as a php file then put in that code and have it open a random image and them rewrite the image and spit it out. So the avatar.jpg looks like a image file but its really a big php file named as a jpg... get it ?

    kinda like this (the image create part)

    http://daemonprojects.com/imgcreate/go.php

    note it refreshes to the image, thats because im lazy and didnt setup my apache.conf file to use jpg files as a page.

    Cool, thanks Daemon, you've been a ton of help
    Never let the facts get in the way of a carefully thought out bad idea!

Similar Threads

  1. $2000+ image.....lost forever?
    By Archangel42069 in forum Tech-To-Tech
    Replies: 26
    Last Post: April 25th, 2003, 11:16 PM
  2. Ghosting a Drive
    By TheCardMan in forum Tech-To-Tech
    Replies: 2
    Last Post: December 29th, 2002, 09:29 PM
  3. [RESOLVED] w2k image creation
    By nechronius in forum Windows NT/2000
    Replies: 4
    Last Post: October 12th, 2001, 05:34 PM
  4. Bootable image? Repair utils?
    By PitaBred in forum Tech-To-Tech
    Replies: 3
    Last Post: May 30th, 2001, 06:56 AM
  5. [RESOLVED] Need help with burning a Linux ISO image.
    By quinn1981 in forum CD-ROM/CDR(-W)/DVD Drivers
    Replies: 1
    Last Post: August 3rd, 2000, 05:03 PM

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
  •