|
|
![]() |
|
|
Top | #1 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
![]() 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 [img] tags as you usually would, but instead link to the .php file like so [img]http://yoursite.com/sig/index.php[/img] 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 - |
|
|
|
|
|
Top | #2 |
|
Tech Junkie
Joined: April 2002
Location: New York City
Posts: 13,256
Reputation: 4260
Power: 294 |
Excellent! Thanks SpeedY
|
|
|
|
|
|
Top | #3 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
No problem, I did say that I'd give everyone the source once I'd had my play, so I have
![]() If people decide to use this tho, bear in mind that the images will not be cached, so try and use a reletively small sized image so that the dial-up users don't have to download a large file everytime they view a thread with your sig on. |
|
|
|
|
|
Top | #4 |
|
OSNN Veteran Addict
Joined: March 2002
Location: United Kingdom
Posts: 7,805
Reputation: 1490
Power: 213 |
This is SPeedY_Bs sig code with sig blocker, if other people want to be able to do this
PHP Code:
PHP Code:
PHP Code:
|
|
|
|
|
|
Top | #5 |
|
Tech Junkie
Joined: April 2002
Location: New York City
Posts: 13,256
Reputation: 4260
Power: 294 |
Someone sticky this thread
|
|
|
|
|
|
Top | #6 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
Done.
|
|
|
|
|
|
Top | #7 |
|
*
Joined: December 2001
Location: USA
Posts: 6,490
Reputation: 2808
Power: 217 |
Really nice tutorial.
|
|
|
|
|
|
Top | #8 |
|
Prodigal Son
Joined: February 2002
Location: Texas, USA
Posts: 8,542
Reputation: 1410
Power: 221 |
|
|
|
|
|
|
Top | #9 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
It was?
|
|
|
|
|
|
Top | #10 |
|
The Last High
Joined: December 2001
Location: London
Posts: 18,506
Blog Entries: 51
Reputation: 3652
Power: 346 |
Yeah definatly use the attachment..
|
|
|
|
|
|
Top | #11 |
|
The Last High
Joined: December 2001
Location: London
Posts: 18,506
Blog Entries: 51
Reputation: 3652
Power: 346 |
Hmm, still doing the same... what the jimmy j have I done ?
|
|
|
|
|
|
Top | #12 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
You've broke it all
![]() It's working fine here
|
|
|
|
|
|
Top | #13 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
Try, this one, saved in UTF-8, should work without any problems
|
|
|
|
|
|
Top | #14 |
|
*
Joined: December 2001
Location: USA
Posts: 6,490
Reputation: 2808
Power: 217 |
|
|
|
|
|
|
Top | #15 |
|
OSNN Senior Addict
Joined: November 2002
Location: netherlands
Posts: 707
Reputation: 180
Power: 121 |
kewl
lol im so newbie with this php code
|
|
|
|
|
|
Top | #16 |
|
OSNN Veteran Addict
Joined: March 2002
Location: The Netherlands
Posts: 2,626
Reputation: 270
Power: 150 |
|
|
|
|
|
|
Top | #17 |
|
Beware the G-Man
Joined: March 2002
Location: XP-erience, NTFS, OSNN, Bay Area, California
Posts: 18,474
Reputation: 4070
Power: 345 |
Now I gotta make up some Sigs and try it out
|
|
|
|
|
|
Top | #18 |
|
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307 |
Just get a huge collection of all your sigs over from the past
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Guide: Dynamic Signatures. | SPeedY_B | Graphic Design | 8 | November 7th, 2007 3:00pm |
| php: Dynamic Titles... | penguin | Web Design & Coding | 3 | August 4th, 2005 9:19pm |
| Buyers Guide: My guide to 64 bit | patrick | General Hardware | 4 | April 20th, 2004 6:47am |
| Dynamic IP server | A.T | Windows Desktop Systems | 3 | October 11th, 2002 11:42pm |
| Dynamic Disk??? | bheagle | General Hardware | 10 | April 7th, 2002 3:46pm |