• 09-06-2006, 02:55 PM
    Thor Erik
    [PHP GD] make your own dynamic Avatar =D
    this is the actual "image"
    Code:

    <?php
    // the header saying that it's a php script :)
    @header ('application/x-httpd-php');
    // Name of your image directory
    $mydir = "images";

    // Make true random
    srand( time() );

    // Open image directory and put images in an array
    if ($dir = @opendir($mydir)) {
     ? while (($file = readdir($dir)) !== false) {
      if ( eregi( '.(jpg&#124;gif)$', $file ) ) { $files[] = $file; }
     ? }
     ? closedir($dir);
    }

    // Find a random image
    $file = $files[rand() % sizeof( $files )];

    // Send headers for the random image
    if ( eregi( '.jpg$', $file ) ) {
     ? header( "Content-Type: image/jpeg" );
    } else {
     ? header( "Content-Type: image/gif" );
    }
    header( "Content-Length: " . filesize( $mydir."/".$file ) );
    readfile( $mydir."/".$file );
    ?>

    save this as image.php in a separte folder. (folder tree at the bottom)

    Folder tree(names without extentions are folders):
    Code:

    *-root
    &#124;
    *----avatar
        ? ?&#124;
        ? ?*----image.php (main image file)
        ? ?&#124;
        ? ?*----images (store the images of your choise here (.jpg and .gif)

    how to:
    to make it work on a forum;
    the link must be similar to: http://www.yourdomain.com/avatar/image.php/image.gif (/image.gif to fool the forum, to belive that is a image and not a php script xD)

    simple demo:
    http://www.thor.p4h.biz/avatar/images.php/image.gif (for a forum)
    http://www.thor.p4h.biz/avatar/images.php (dosen't work on a forum, but displayes the image ;))


    if you don't manage to make it work, post here ;)

    note: the one i use is the same code ;)(some tweaks that makes it more secure)
  • 09-06-2006, 03:03 PM
    LiNuX
    [PHP GD] make your own dynamic Avatar =D
    lmao wow, thats pretty cool lol, i like the first demo pic, lol i never made one like that, pretty cool, nice ;D :)
  • 09-07-2006, 04:55 AM
    Thor Erik
    Re: [PHP GD] make your own dynamic Avatar =D
    Quote:

    lmao wow, thats pretty cool lol, i like the first demo pic, lol i never made one like that, pretty cool, nice ?;D :)
    if you refresh them, you will get a new pic <.<
  • 09-07-2006, 03:11 PM
    LiNuX
    [PHP GD] make your own dynamic Avatar =D
    yea i just noticed that, its awesome lol, i gotta learn how to do that later lol, nice ;D
  • 09-08-2006, 02:07 PM
    diablo
    [PHP GD] make your own dynamic Avatar =D
    lol coding is so fun, i gotta get into this thing lol, im working on making websites but php thing looks way more fun lol
  • 09-11-2006, 07:00 AM
    Thor Erik
    Re: [PHP GD] make your own dynamic Avatar =D
    Quote:

    lol coding is so fun, i gotta get into this thing lol, im working on making websites but php thing looks way more fun lol
    php is fun ^^ but you need to learn alot, i recon starting with HTML, JS and pascal (pascal can be Delphi too ;) pascal is a programming language but it share many similaritys with php :))

    btw if you want to try out some php:
    http://yurx.com/showthread.php?p=9765 i posted a werry simple php code :P
  • 10-14-2006, 07:15 PM
    LiNuX
    Re: [PHP GD] make your own dynamic Avatar =D
    hey thor u think u can make a php script that rotates banners randomly? and another question. on a .php file, in the coding, whats the command to include a file in with the script ? like another .php file, thanks in adv
  • 10-18-2006, 02:37 PM
    mooki
    Re: [PHP GD] make your own dynamic Avatar =D
    once i have over 8 images in the folder its often seems to refer page not found but why?
  • 11-29-2006, 12:51 AM
    Thor Erik
    Re: [PHP GD] make your own dynamic Avatar =D
    Quote:

    Originally Posted by LiNuX
    hey thor u think u can make a php script that rotates banners randomly? and another question. on a .php file, in the coding, whats the command to include a file in with the script ? like another .php file, thanks in adv

    include
    if the file is going to be included into another file do include_once on all includes :p

    @ mooki: no idea, never seen it, my current avatar got 22 pics :p
  • 12-28-2006, 12:26 PM
    souljaa
    Re: [PHP GD] make your own dynamic Avatar =D
    Lol. Nice. Thanks Thor...I gotta try this out one day :D.
  • 01-01-2007, 08:28 PM
    Jarritos
    Re: [PHP GD] make your own dynamic Avatar =D
    Nice script. The only problem is most forums don't let you use dynamic avatar or signatures anymore since people took advantage of that
  • 01-01-2007, 08:47 PM
    LiNuX
    Re: [PHP GD] make your own dynamic Avatar =D
    Quote:

    Originally Posted by Jarritos
    Nice script. The only problem is most forums don't let you use dynamic avatar or signatures anymore since people took advantage of that

    well u can do that here lol, and how do they take advantage of that?
  • 01-01-2007, 09:35 PM
    souljaa
    Re: [PHP GD] make your own dynamic Avatar =D
    Quote:

    Originally Posted by LiNuX
    Quote:

    Originally Posted by Jarritos
    Nice script. The only problem is most forums don't let you use dynamic avatar or signatures anymore since people took advantage of that

    well u can do that here lol, and how do they take advantage of that?

    I guess..put like..porn stuff?..Iono lol.
  • 01-01-2007, 09:55 PM
    LiNuX
    Re: [PHP GD] make your own dynamic Avatar =D
    lol then the admin can just remove that one, but thats not really taking advantage of it tho
  • 01-01-2007, 09:59 PM
    souljaa
    Re: [PHP GD] make your own dynamic Avatar =D
    Ahh, true, Iono then...Only Jarritos can answer:P
  • 01-19-2007, 06:58 PM
    Jarritos
    Re: [PHP GD] make your own dynamic Avatar =D
    You can run a script that would help you hack into the site...not that i would ever do something like that ::)
  • 04-05-2007, 07:49 AM
    candylove15
    Re: [PHP GD] make your own dynamic Avatar =D
    I better try this! =p this looks good

» Site Navigation

» Home
» FAQ

» Log in

User Name:

Password:

» Sponsors