Sig Rotater

Discussion in 'Gaming' started by Holla, Jul 14, 2005.

  1. Holla

    Holla Well-Known Member

    Posts:
    1,914
    Likes Received:
    0
    Joined:
    Apr 23, 2005
    DOES ANYONE HAVE A SIG ROTATER LYING AROUND? IF SO CAN U ADD ME ON MSN OR AIM AND TELL ME HOW TO USE IT. TY. [email protected] AIM=canadianmvp2
     
  2. wilciu

    wilciu Well-Known Member

    Posts:
    1,095
    Likes Received:
    0
    Joined:
    Jul 13, 2005
    photoshop maybe ? ? ? ? :D
     
  3. Michael

    Michael Well-Known Member

    Posts:
    4,060
    Likes Received:
    0
    Joined:
    Jan 31, 2005
    Location:
    England
    you can make one real easy. Click the starter kit and get a free host. Thats how I had my first one. Really easy to set up.
     
  4. 4nub1s

    4nub1s Senior Member

    Posts:
    3,476
    Likes Received:
    0
    Joined:
    Feb 24, 2005
    Location:
    Beyond Reality
    <?php
    //////////////////////////////////////////////////////////////////////
    /* Suho1004's PHP Sig Rotator V2.0 */
    /* */
    /* This script takes an inventory of all image files in a directory */
    /* and displays one at random. All you need to do is save this code */
    /* in a directory that contains your images (name it what you will, */
    /* but make sure it has a ".php" extension). Then just link to this */
    /* script to get your random image. */
    /* */
    /* I would recommend naming this file "index.php," and then you can */
    /* just link to the directory itself (like I do in my example). */
    /* */
    /* Once you've read these instructions, feel free to delete them to */
    /* cut down on the file size. I claim no rights to this code, which */
    /* means you can do whatever you like with it. Have fun. */
    /* */
    /* Thanks to TP for the gentle nudging... */
    //////////////////////////////////////////////////////////////////////

    if ($dir = opendir("."))
    {
    $list = buildimagearray($dir);
    displayrandomimage($list);
    }

    // This function reads all the files in the current directory and adds all image files to the array $list[]
    function buildimagearray($dir)
    {
    while (false !== ($file = readdir($dir)))
    {
    if (!is_dir($file) && getimagesize($file))
    {
    $list[] = $file;
    }
    }
    return $list;
    }

    // This function selects a random image, determines the mime type, opens the file for reading,
    // and then outputs the image
    function displayrandomimage($list)
    {
    srand ((double) microtime() * 10000000);
    $sig = array_rand ($list);

    $size = getimagesize ($list[$sig]);
    $fp = fopen($list[$sig], "rb");

    if ($size && $fp)
    {
    header("Content-type: {$size['mime']}");
    fpassthru($fp);
    exit;
    }
    }
    ?>


    That's the script you need. ;) Place it in the folder with your pics, and link to this file. It will call the sigs in your rotation. ;)
     

Share This Page