1. Hello! You are currently viewing our community as a guest. Register today and apply to be a member of one of the longest standing gaming communities around. Once you have registered learn about our team and how to apply!

Random sig

Discussion in 'General Open/Public Discussion' started by Praetor-Vong, 2 Nov 2005.


  1. Someone had a sig that would call a php or something and then would randomly pick from a set for display.

    Who did it and how do I do it?

    GAAAAAACK!!!
    Such a newb,
    plz help.
     
  2. <P>Are you talking about my sig?</P>
    <P>&nbsp;</P>
    <P>If you are, it is part of an array hooked to a Database this site setup, but if you want, here is the actual code:</P>
    <P>&nbsp;</P>
    <P></RANDOM></P>
    <P>
    Code:
    </P>
    <P>&nbsp;</P>
    <P>&lt;!-- Random stock background image --&gt;<BR>&lt;random&gt;<BR>&lt;select&gt;&lt;image url="<A href="http://img489.imageshack.us/img489/1094/squad0av.png">http://img489.imageshack.us/img489/1094/squad0av.png</A>" x="0" y="0" width="400" height="180"/&gt;&lt;/select&gt;<BR>&lt;select&gt;&lt;image url="<A href="http://img481.imageshack.us/img481/553/heli11zu.png">http://img481.imageshack.us/img481/553/heli11zu.png</A>" x="0" y="0" width="400" height="180"/&gt;&lt;/select&gt;<BR>&lt;select&gt;&lt;image url="<A href="http://img481.imageshack.us/img481/8963/jet21cv.png">http://img481.imageshack.us/img481/8963/jet21cv.png</A>" x="0" y="0" width="400" height="180"/&gt;&lt;/select&gt;<BR>&lt;select&gt;&lt;image url="<A href="http://img481.imageshack.us/img481/7191/jet7gi.png">http://img481.imageshack.us/img481/7191/jet7gi.png</A>" x="0" y="0" width="400" height="180"/&gt;&lt;/select&gt;<BR>&lt;select&gt;&lt;image url="<A href="http://img479.imageshack.us/img479/6968/tankgunner3fh.png">http://img479.imageshack.us/img479/6968/tankgunner3fh.png</A>" x="0" y="0" width="400" height="180"/&gt;&lt;/select&gt;<BR>&lt;/random&gt;<BR></P>
    <P>
    </RANDOM></P>
     
    Last edited: 2 Nov 2005
  3. Or in PHP
    PHP:
    <?php 
    //read folder 
      
    $folder=opendir("." ); 

      
    $names = Array(); 

      while (
    $file readdir($folder)) 
          
    $names[count($names)] = $file

      
    closedir($folder); 

    //sort file names in array 
      
    sort($names); 

    //remove any non-images from array 
      
    $tempvar 0
      foreach (
    $names as $name
      { 
          
    $ext strtolower(substr($name,-4)); 
          if (
    $ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png" 
              
    $names1[] = $name
      } 
    //random 
      
    srand ((double) microtime() * 10000000); 
      
    $rand_keys array_rand ($names12); 
    //random image from array 
      
    $slika $names1[$rand_keys[0]]; 
    //image dimensions 
      
    $dimensions GetImageSize($slika); 
      
    header("Location: http://www.yourhost.com/sigs/$slika");
    ?>
    Place all your sigs you want in rotation in the sig folder. Call this php file as your sig. Done.

    (if you are on a forum not allowing html, name the sig folder sig.png and this file index.php - calling the folder (which appears like an image file) should make it work).
     
  4. First, thx everyone!

    Second, I think I was remembering someone here that has a lot of anime sigs (Kaikou maybe?).

    Third...So um, this php thing assumes that I already have a website I suppose?
     
  5. ORANGE

    ORANGE DragonWolf

    if you e-mail me the script and your sigs I could host it for ya.
     
  6. Well, yes...I do want to do it for sigs, but I would also like to have a random header image for my myspace profile. The image header is like 435x300 jpg images. Right now, I change it every night as like a 'ooo look at me' type of thing.

    GaaaK!

    Pathetic aren't I?
     

Share This Page