How to make Rotational Sigs!

Discussion in 'Computers and Technology' started by Rider, Aug 6, 2009.

  1. Rider

    Rider Level IV

    Joined:
    Jun 25, 2008
    Messages:
    941
    Likes Received:
    72
    Location:
    Canada =D
    [​IMG]

    In this guide you'll learn how to make something like this (Refresh and look at the image to see what's happening) :

    [​IMG]

    Start off by making a account at http://ripway.com

    After you've made the account, select the "Create a New Text File" button.

    Name it RotationalSig.php and add this code into the textbox :

    Code (Text):
    1. <?php
    2. /*
    3. */// Make this the relative path to the images, like "../img" or "random/images/".
    4. // If the images are in the same directory, leave it blank.
    5. $folder = '';
    6.  
    7. // Space seperated list of extensions, you probably won't have to change this.
    8. $exts = 'jpg jpeg png gif';
    9.  
    10. $files = array(); $i = -1; // Initialize some variables
    11. if ('' == $folder) $folder = './';
    12.  
    13. $handle = opendir($folder);
    14. $exts = explode(' ', $exts);
    15. while (false !== ($file = readdir($handle))) {
    16. foreach($exts as $ext) { // for each extension check the extension
    17. if (preg_match('/\.'.$ext.'$/i', $file, $test)) { // faster than ereg, case insensitive
    18. $files[] = $file; // it's good
    19. ++$i;
    20. }
    21. }
    22. }
    23. closedir($handle); // We're not using it anymore
    24. mt_srand((double)microtime()*1000000); // seed for PHP < 4.2
    25. $rand = mt_rand(0, $i); // $i was incremented as we went along
    26.  
    27. header('Location: '.$folder.$files[$rand]); // Voila!
    28. ?>
    29.  
    Code By Matt Mullenweg > http://photomatt.net

    Now upload whatever images you want to be in your rotational sig and your done!

    To put the rotational image in your signature, just add this code (Replace INSERTUSERNAMEHERE with your username) :
    Code (Text):
    1. [img]http://h1.ripway.com/INSERTUSERNAMEHERE/RotationalSig.php[/img]
    If you'd like to request some signatures for your rotational sig, feel free to request here :
    graphics-requests-f42/taking-request-for-sig-s-t27467.html
     
  2. Rhett

    Rhett Level IV

    Joined:
    Dec 2, 2007
    Messages:
    1,429
    Likes Received:
    76
  3. Rider

    Rider Level IV

    Joined:
    Jun 25, 2008
    Messages:
    941
    Likes Received:
    72
    Location:
    Canada =D
    Most sites like those get shut down.
    That's why i wrote this alternative guide.
    Two of the services i used got closed down.
    And this is easier.
    Ripway account, new file, load images.
    Same thing basically except it won't get closed down.
     
  4. Cacklenub

    Cacklenub Level IV

    Joined:
    May 10, 2008
    Messages:
    1,345
    Likes Received:
    58
    Here is the code I use as a shorter alternative.

    I think Zer0 made it, or ricky. I dunno. :p

    It's shorter, but you got to update it everytime you have a new file.

    Speaking of, I need to upload the Steven Jackson one someone made me the other day lol.
    Code (Text):
    1. <?php
    2. $files[0] = 'http://h1.ripway.com/cackle/signatures/cackle.jpg';
    3. $files[1] = 'http://h1.ripway.com/cackle/signatures/cacklev1.png';
    4. $files[2] = 'http://h1.ripway.com/cackle/signatures/cacklev2.png';
    5. $files[3] = 'http://h1.ripway.com/cackle/signatures/ip2h46.png';
    6. $files[4] = 'http://h1.ripway.com/cackle/signatures/chicagoclubsjx2.png';
    7. $files[5] = 'http://h1.ripway.com/cackle/signatures/stevenjackson.png';
    8. header('Location: ' . $files[ mt_rand( 0, sizeof( $files )-1 ) ]);
    9. ?>
     
  5. piggybepink

    piggybepink Level II

    Joined:
    Jul 15, 2009
    Messages:
    316
    Likes Received:
    11
    Oooh, great!

    *sets up RotaSig*

    Thanks for the guide, Rider, and everyone else for their codes. P: