Closed Thread
Results 1 to 4 of 4

Thread: 15 points for rotate image script

  1. #1
    Josh is offline Uber No0b Josh is an unknown quantity at this point
    Join Date
    Jan 2005
    Posts
    197

    15 points for rotate image script

    Hi I'll give 15 points to the person who can find me a FAST rotating image script like http://www.arcadetap.com/b/rotate.php

    I would like it to be as fast and simple as possible.

  2. #2
    Spartan Erik's Avatar
    Spartan Erik is offline Retired Spartan Erik is an unknown quantity at this point
    Join Date
    Aug 2005
    Posts
    3,382

    Re: 15 points for rotate image script


  3. #3
    The_Magistrate's Avatar
    The_Magistrate is offline x10 Elder The_Magistrate is an unknown quantity at this point
    Join Date
    May 2005
    Location
    PA
    Posts
    559

    Re: 15 points for rotate image script

    Spartan Erik, your script doesn't rotate images... it randomizes images. I'm trying to write one in PHP using a cookie... gimme a few minutes.

    Here ya go... crude, but effective. Requires you to add the image filenames into the array and specify the path.

    P.S. If you could throw a few more than 15 point my way, it would be appreciated.
    PHP Code:
    <?
    // Image Rotator Script
    // By Alex Cline (http://alex.elementfx.com)
    // Displays the next image in the array based on a cookie which stores the previous image
    // If the cookie doesn't exist, the first image is shown.

    // Create the array of images.  This must contain the names of all the images.
    $imgArray = array("image1.jpg""image2.gif""image.png");
    // Path to where your images are stored
    $hostDir "http://www.somedomain.com/path/to/images/"// Don't forget that ending '/'

    $imgArraySize count($imgArray); // Store the size of the array (starts at 1)
    $imgToShow 0// We'll default to always show the first image.

    // Check to see if the cookie has already been created.
    if ($_COOKIE['imagerotate'] != "") {
      
    // The cookie existed
      
    $imgToShow $_COOKIE['imagerotate'];
      if(
    $imgToShow >= $imgArraySize) {
        
    // The image we were supposed to show next would have been out of bounds in the array.
        
    $imgToShow 0;  // We'll show the first image
      
    }
      else  
    // The image to be shown is not out of bounds.
        
    $imgToShow++;  // Increment the image counter
    }

    // Write the new cookie with the new image we are showing
    setcookie ("imagerotate"$imgToShowtime()+1000);

    //Print the image from the directory.
    echo "<img src=\"".$hostDir.$imgArray[$imgToShow]."\" alt=\"An Image\" />";
    ?>
    Last edited by The_Magistrate; 05-27-2006 at 12:33 AM.
    Getting Started | Terms of Service | Paid Hosting | Forum Rules | Free Server Status | Banned Countries

    If I have helped you through one of my posts, please click the
    blue checkbox on the right below my avatar to add to my reputation.

  4. #4
    Josh is offline Uber No0b Josh is an unknown quantity at this point
    Join Date
    Jan 2005
    Posts
    197

    Re: 15 points for rotate image script

    Quote Originally Posted by The_Magistrate
    Spartan Erik, your script doesn't rotate images... it randomizes images. I'm trying to write one in PHP using a cookie... gimme a few minutes.

    Here ya go... crude, but effective. Requires you to add the image filenames into the array and specify the path.

    P.S. If you could throw a few more than 15 point my way, it would be appreciated.
    PHP Code:
    <?
    // Image Rotator Script
    // By Alex Cline (http://alex.elementfx.com)
    // Displays the next image in the array based on a cookie which stores the previous image
    // If the cookie doesn't exist, the first image is shown.

    // Create the array of images.  This must contain the names of all the images.
    $imgArray = array("image1.jpg""image2.gif""image.png");
    // Path to where your images are stored
    $hostDir "http://www.somedomain.com/path/to/images/"// Don't forget that ending '/'

    $imgArraySize count($imgArray); // Store the size of the array (starts at 1)
    $imgToShow 0// We'll default to always show the first image.

    // Check to see if the cookie has already been created.
    if ($_COOKIE['imagerotate'] != "") {
      
    // The cookie existed
      
    $imgToShow $_COOKIE['imagerotate'];
      if(
    $imgToShow >= $imgArraySize) {
        
    // The image we were supposed to show next would have been out of bounds in the array.
        
    $imgToShow 0;  // We'll show the first image
      
    }
      else  
    // The image to be shown is not out of bounds.
        
    $imgToShow++;  // Increment the image counter
    }

    // Write the new cookie with the new image we are showing
    setcookie ("imagerotate"$imgToShowtime()+1000);

    //Print the image from the directory.
    echo "<img src=\"".$hostDir.$imgArray[$imgToShow]."\" alt=\"An Image\" />";
    ?>
    points comming your way!

Closed Thread

Similar Threads

  1. Need Image cut 35 Points!
    By Fire Wolf in forum The Marketplace
    Replies: 3
    Last Post: 05-03-2006, 03:21 AM
  2. URGENT: 80 points for a CGI script
    By Chirantha in forum The Marketplace
    Replies: 13
    Last Post: 12-28-2005, 11:24 AM
  3. errors while attaching
    By mattspec in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12-19-2005, 01:50 PM
  4. November Desktop
    By n4tec in forum Off Topic
    Replies: 12
    Last Post: 11-08-2005, 07:18 AM
  5. [REQ] phpnuke/postnuke module or php script 100+ points
    By 03moscropl in forum The Marketplace
    Replies: 5
    Last Post: 09-30-2005, 10:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers