Multiple sigs..

Discussion in 'Graphic Design' started by Moonwraith, Feb 27, 2005.

  1. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Now.. I know i've seen a thread at sometime, and i've searched around.. but how do people have diff sigs on refresh?

    I know, probably deserve a slap.. but i was thinking of messin' around with it :)

    Cheers all
     
  2. ~bk

    ~bk I Political User

    Messages:
    3,768
    Location:
    Canada
    Hmm... SPeedY_B had a great tutorial posted about random sigs. I can't find it at the moment.
     
  3. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Yeah, i thought there was one.. i just can't find it either :(
     
  4. Jewelzz

    Jewelzz OSNN Godlike Veteran

    Messages:
    10,977
    Location:
    California
    I've searched but can't seem to find it *shrug*
     
  5. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    In that case, anyone know how to do this? :)
     
  6. the_music_man

    the_music_man aka prodj88 =P

    Messages:
    2,401
    Location:
    USA
    i have it (cuz im using it right now). just let me get my email popped open and i'll post back soon!
     
  7. the_music_man

    the_music_man aka prodj88 =P

    Messages:
    2,401
    Location:
    USA
    okay use notepad and paste this junk in there and save it as index.php
    PHP:
    <?php
    ob_start
    'ob_gzhandler' );
    srandtime() );
    $files = array();
    if (
    $dir = @opendir(".")) {
    while ((
    $file readdir($dir)) !== false) {
    if ( 
    eregi'.(jpg|gif)$'$file ) ) {
    $files[] = $file;
    }

    closedir($dir);
    }
    $file $files[rand() % sizeof$files )];

    if ( 
    eregi'.jpg$'$file ) ) {
    header"Content-Type: image/jpeg" );
    } else {
    header"Content-Type: image/gif" );
    }
    header"Content-Length: " filesize$file ) );
    readfile$file );
    ?>
    once u've done that upload the index.php to a folder in ur hosting place and add all the pics u want to be refreshed in that same folder.

    edit by Geffy - switched QUOTE tags to PHP tags
     
    Moonwraith likes this.
  8. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Doesn't seem to work for me :(
     
  9. the_music_man

    the_music_man aka prodj88 =P

    Messages:
    2,401
    Location:
    USA
    Ok so lets say that ur using freeprohost.com. ur gonna go to the WWW folder and put that index.php file and like 5 JPEG's. then on osnn when u put hte link for the sig ur gonna do prodj.freehost.com/index.php
    does that help? tell me what u don't understand
     
  10. muzikool

    muzikool Act your wage. Political User

    Geffy is a pro when it comes to this.
     
  11. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    I uploaded the php file, it just didn't work.. tried to open/download it.. was most perculiar
     
  12. Geffy

    Geffy Moderator Folding Team

    Messages:
    7,805
    Location:
    United Kingdom
    I'll post a link to my old sig code in a moment or two

    ok then, found my old random sig code.

    Basic Random Image File
    PHP:
    <?php
    srand
    time() );

    $files = array();
    if (
    $dir = @opendir(".")) {
        while ((
    $file readdir($dir)) !== false) {
            if ( 
    eregi'.(jpg|gif)$'$file ) ) {
                
    $files[] = $file;
            }
        }
        
    closedir($dir);
    }

    $file $files[rand() % sizeof$files )];

    if ( 
    eregi'.jpg$'$file ) ) {
        
    header"Content-Type: image/jpeg" );
    } else {
        
    header"Content-Type: image/gif" );
    }

    header"Content-Length: " filesize$file ) );

    readfile$file );
    ?>
    Reckon Prodj88 got this piece waaay back when the old 'Dynamic Signature' thread properly existed

    Advanced Random Image File with IP address based Blocking
    PHP:
    <?php
    /**
    * MySQL Table Definition
    *
    * CREATE TABLE `sig` (
    *     `id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
    *     `ip` VARCHAR( 16 ) NOT NULL ,
    *     PRIMARY KEY ( `id` ) ,
    *     UNIQUE (
    *         `ip`
    *     )
    * );
    *
    * Script first checks to see if the IP address has been added to
    * a list of addresses which have requested not the see a random image.
    * If they have then the blocked image is shown, if not then the
    * contents of the folder which this file is in is read and an image
    * is randomly selected, the proper headers sent and then the image
    * data.
    */
    mysql_pconnect("localhost","username","password");
    mysql_select_db("database");

    $addr $_SERVER['REMOTE_ADDR'];
    $query mysql_query("SELECT `id` FROM sig WHERE `ip`='{$addr}'");
    $rows mysql_num_rows($query);

    if(
    $rows != 0) {
        
    // No rows, ip address has not requested blocking
        
    srandtime() );

        
    $files = array();
        if (
    $dir = @opendir(".")) {
            
            while ((
    $file readdir($dir)) !== false) {
                if ( 
    eregi'.(jpg|gif)$'$file ) ) {
                    
    $files[] = $file;
                }
            }
            
            
    closedir($dir);
        }

        
    $file $files[rand() % sizeof$files )];

        if ( 
    eregi'.jpg$'$file ) ) {
            
    header"Content-Type: image/jpeg" );
        } else {
            
    header"Content-Type: image/gif" );
        }

        
    header"Content-Length: " filesize$file ) );

        
    readfile$file );
    } else {
        
    header"Content-Type: image/jpeg" );
        
    header"Content-Length: " filesize("blocked.jpg"));
        
    readfile"blocked.jpg" );
    }
    ?>
    This one is not the exact code I used to use, I have upgraded it slightly to use only one SQL statement and it doesnt have to loop through all the results in the table anymore to decide if its doing blocking.

    Hope these help
     
    Moonwraith likes this.
  13. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Well... I've uploaded it trying both.. and still I must be doing something stupid..

    I upload the file, and if i try to open the page i get the following:
     

    Attached Files:

  14. Kush

    Kush High On Life!

    Messages:
    4,590
    Location:
    Montreal, Quebec
    place the link of the php inside img tags
     
  15. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Geocities doesn't support PHP, you need a real host.
     
    Moonwraith likes this.
  16. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Touché

    That might explain a bit :p
    .. Hmmm, i'll have a root around, see if i can't throw it onto my dad's site somewhere

    Cheers for now

    Edit: Well, registered for a free thing at 50megs.com, dunno how to check whether they support .php or not..

    Am i supposed to change anything in that file, or literally, copy, paste - save, upload? 'cause that's all i've done.. still doesn't want it
     
  17. the_music_man

    the_music_man aka prodj88 =P

    Messages:
    2,401
    Location:
    USA
    erm i had a feeling ur service didn't support PHP. 50megs is alright but freeprohost.com is better. and all u do is upload the index.php file. u don't have to edit anyhthing.
     
    FishBoy likes this.
  18. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    freeprohost was $11.99 for a "free account" .. anyone know of a free free one that allows php? ta
     
  19. Lukas

    Lukas Real Name No Gimmicks

    Messages:
    421
    If you want mail me the files @ lukas.s@skynet.be, I'll put it on my domainhosting...
    Dont make em too big tho :D


    Grtz


    Lukas
     
    Moonwraith likes this.
  20. Moonwraith

    Moonwraith Moderator Folding Team

    Messages:
    1,131
    Location:
    UK
    Cheers mate; Well I think it was a bit of a passing phase but if i get round to the idea again, you'll be getting a lovely email begging nicely :)


    Cheers to all