Multiple sigs..

Moonwraith

OSNN Veteran Addict
Joined
22 Oct 2004
Messages
1,133
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
 
Hmm... SPeedY_B had a great tutorial posted about random sigs. I can't find it at the moment.
 
~bk said:
Hmm... SPeedY_B had a great tutorial posted about random sigs. I can't find it at the moment.

Yeah, i thought there was one.. i just can't find it either :(
 
I've searched but can't seem to find it *shrug*
 
i have it (cuz im using it right now). just let me get my email popped open and i'll post back soon!
 
okay use notepad and paste this junk in there and save it as index.php
PHP:
<?php
ob_start( 'ob_gzhandler' );
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 );
?>

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
 
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
 
I uploaded the php file, it just didn't work.. tried to open/download it.. was most perculiar
 
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
    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 );
} 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
 
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:
 

Attachments

  • untitled.JPG
    untitled.JPG
    21.6 KB · Views: 108
Geocities doesn't support PHP, you need a real host.
 
SPeedY_B said:
Geocities doesn't support PHP, you need a real host.

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
 
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.
 
prodj88 said:
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.

freeprohost was $11.99 for a "free account" .. anyone know of a free free one that allows php? ta
 
Lukas said:
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

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
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,623
Latest member
AndersonLo
Back