SPeedY_B
I may actually be insane.
- Joined
- 31 Mar 2002
- Messages
- 15,807
A few people have asked me about this one since I first used it a while back, and now that I've had my play, I'm going to share it with everyone else
Requirements :
There are two (2) ways to get this done, either upload everything as we go along, or create the folder locally then upload it all at once, either way, the concept is still the same.
Step 1
Create a new folder, for the purpose of demonstration we'll call it sig
So once uploaded, this will be accessable via http://yoursite.com/sig/
Step 2
next create an empty text file, and copy the following code into it.
-------------start code------------------
<?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 );
?>
--------------end code------------------
Re-name that file to index.php and put it in the folder we created, so that it can eventually be accessed via http://yoursite.com/sig/index.php
Step 3
Next upload a few images with either .gif or .jpg extensions into the /sig/ folder
so for example the folder contents now look something like this:
Step 4
Now on the forums, open up your User CP and use the tags as you usually would, but instead link to the .php file like so
[b][img]http://yoursite.com/sig/index.php[/b]
If everything has gone according to plan, then your signature should change nearly every time the page is refreshed/viewed.
Note : Because I don't trust the forums parsers, the source code has been attached in a text file, if you want to you can simply save this file ane remove the .txt extension to save copy pasting into a new file
-
Requirements :
- A mild knowledge of php helps, but isn't essential
- More than one signature image in gif or jpeg format
- Webhost supporting the php hypertext processor language
- Pie
There are two (2) ways to get this done, either upload everything as we go along, or create the folder locally then upload it all at once, either way, the concept is still the same.
Step 1
Create a new folder, for the purpose of demonstration we'll call it sig
So once uploaded, this will be accessable via http://yoursite.com/sig/
Step 2
next create an empty text file, and copy the following code into it.
-------------start code------------------
<?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 );
?>
--------------end code------------------
Re-name that file to index.php and put it in the folder we created, so that it can eventually be accessed via http://yoursite.com/sig/index.php
Step 3
Next upload a few images with either .gif or .jpg extensions into the /sig/ folder
so for example the folder contents now look something like this:
- index.php
- sig01.jpg
- picture.gif
- something.gif
- pie.jpg
Step 4
Now on the forums, open up your User CP and use the tags as you usually would, but instead link to the .php file like so
[b][img]http://yoursite.com/sig/index.php[/b]
If everything has gone according to plan, then your signature should change nearly every time the page is refreshed/viewed.
Note : Because I don't trust the forums parsers, the source code has been attached in a text file, if you want to you can simply save this file ane remove the .txt extension to save copy pasting into a new file
-