Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 28

Thread: Rotating Avatar

  1. #11
    h1
    Guest
    Actually, I spent most of last night playing with a bag of crystal meth and a 10 millimeter...

  2. Internet, Programming and Graphics   -   #12
    BANNED
    Join Date
    Apr 2003
    Posts
    1,143
    Originally posted by haxor41789@26 March 2004 - 01:31
    Actually, I spent most of last night playing with a bag of crystal meth and a 10 millimeter...
    blunt....

  3. Internet, Programming and Graphics   -   #13
    Originally posted by NightStalker@21 March 2004 - 16:20
    avatar.gif

    Code:
    <?php
    $dh = opendir(".");
    while (false !== ($file = readdir($dh)))
    {
    if (preg_match('/\.gif$/i', $file) and $file != "avatar.gif")
    {
      $filelist[] = $file;
    }
    }
    
    srand((double)microtime()*1000000);
    $picnum = rand(0, sizeof($filelist) - 1);
    
    header("Location: " . $filelist[$picnum]);
    
    closedir($dh);
    ?>
    .htaccess
    Code:
    AddType application/x-httpd-php .gif
    Now you will need to upload .gif images to the selected directory that you have placed both avatar.gif and .htaccess, once you have done so, you can link to "avatar.gif" and your avatar will refresh whenever someone refreshes their browser.

    Example:

    Good!! Your create a very good tutorial..

    I would create a tutorial of this.. but you create 1st!!

    Bye Bye.....

  4. Internet, Programming and Graphics   -   #14
    Goood. Just one little niggle. I DON'T HAVE PHP!!

  5. Internet, Programming and Graphics   -   #15
    StealthAssassin
    Guest
    ive been trying to do this for a while now and cant find a free host that has .htaccess support, so can you right exactly what i would need to do if i didnt want to use .htaccess but still have the php file "avatar.jpg"?

    Stealth

  6. Internet, Programming and Graphics   -   #16
    vivitron 15's Avatar Poster
    Join Date
    Jan 2003
    Location
    North East England, UK
    Posts
    1,741
    i have something similar to this with which im playing, but id like for the image to be refreshed every 10 seconds: either updating the pic, or even the page would be fine, but it must be done through the gif file which calls the images.

    heres the code which im using (successfully)
    avatar.gif:
    Code:
    <?php
    $dh = opendir(".");
    while (false !== ($file = readdir($dh))) 
    {
    if (preg_match('/.(jpg|gif|png)$/i', $file) and $file != "avatar.gif")
    { 
      $filelist[] = $file;
    }
    }
    
    srand((double)microtime()*1000000);
    $picnum = rand(0, sizeof($filelist) - 1);
    $pictype = substr($filelist[$picnum], -3);
    
    $fn='http://www.ianrhodgson.co.uk/images/avatar/avatar.php';
    header('Cache-control: no-cache, must-revalidate, no-store');
    header('Content-disposition: filename='.$fn);
    header('Pragma: no-store');
    
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Content-type: image/$pictype");
    @readfile($filelist[$picnum]);
    
    closedir($dh);
    ?>
    .htaccess
    Code:
    <FilesMatch avatar.gif>
    SetHandler application/x-httpd-php
    </FilesMatch>
    <insert signature here>

  7. Internet, Programming and Graphics   -   #17
    h1
    Guest
    Originally posted by vivitron 15@14 April 2004 - 12:28
    Code:
    header&#40;&#34;&#60;meta http-equiv=&#092;&#34;refresh&#092;&#34; content=&#092;&#34;10&#092;&#34;&#62;&#34;&#41;;
    Too bad that&#39;s not a valid header.

  8. Internet, Programming and Graphics   -   #18
    vivitron 15's Avatar Poster
    Join Date
    Jan 2003
    Location
    North East England, UK
    Posts
    1,741
    yeah, i know - just started playing with this, and was just trying the obvious first

    didnt wanna spend hours trying to get it to work if it was that easy...clearly it isn&#39;t, and that wasnt supposed to be in the posted code

    anyhow, ignoring that line (gonna edit now ) - is there a way i can get it to do the refresh thing?
    <insert signature here>

  9. Internet, Programming and Graphics   -   #19
    h1
    Guest
    Dunno, if all else fails, try Google.

  10. Internet, Programming and Graphics   -   #20
    vivitron 15's Avatar Poster
    Join Date
    Jan 2003
    Location
    North East England, UK
    Posts
    1,741
    thanks for the tip - not sure about this goggle though - whats that??









    i did, but couldnt find it - thought youd be the best source, being the man with this shit
    <insert signature here>

Page 2 of 3 FirstFirst 123 LastLast

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
  •