PCTechTalkhttp://www.pctechtalk.com/forums/

Go Back   PCTechTalk > PC Tech > Web Related

Reply
 
LinkBack Thread Tools Display Modes
Old 12-30-2004, 02:21 PM   #1 (permalink)
Tune Raider
 
DreamCaster's Avatar
 
Join Date: Dec 2001
Location: New England
Posts: 1,353
DreamCaster is on a distinguished road
Synchronized rotating avatar and signature script?

Just curious if anyone has come across anything like this that will allow me to rotate matching signatures/avatars (like 9 or 10 sets)...

~Peace
DC
__________________


Boston Red Sox - 2004 World Champions
New England Patriots - '02, '04, '05 Superbowl Champions
DreamCaster is offline   Reply With Quote
Old 12-30-2004, 02:44 PM   #2 (permalink)
PCTT Administrator
 
berks's Avatar
 
Join Date: Mar 2003
Location: Las Vegas
Posts: 3,735
berks is on a distinguished road
didn't rasta have something like that?
__________________
Vote For Us!!!
berks is offline   Reply With Quote
Old 12-30-2004, 03:05 PM   #3 (permalink)
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
it's called PHP and if you want it you'll have it.

(an example is our nice firefox banner, which shows 7 different ones, fully loaded with GreffTechnology(tm) )
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote
Old 12-30-2004, 07:26 PM   #4 (permalink)
Tune Raider
 
DreamCaster's Avatar
 
Join Date: Dec 2001
Location: New England
Posts: 1,353
DreamCaster is on a distinguished road
YAY!
__________________


Boston Red Sox - 2004 World Champions
New England Patriots - '02, '04, '05 Superbowl Champions
DreamCaster is offline   Reply With Quote
Old 12-31-2004, 04:30 AM   #5 (permalink)
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
I assume you want something in HTML like:
Code:
<img src="http://myhost.com/~me/mybanner.php" alt="my random banner!" />
then mybanner.php will output an image (JPEG, GIF, PNG, whatever format you like).

So, various routes are possible here, but one might be the simplest for both you, the webserver and me.

So here is the script I propose, with comments:
PHP Code:
<?php
    
// first of all: the banners we want to have displayed at random
    
$banners = array();
    
array_push($banners'path/to/my/image.jpeg');
    
array_push($banners'path/to/my/other/image.gif');
    
// you can add as many as you like here

    // let's pick one at random
    
$banner $banners[rand(0count($banners) - 1)];

    
// tell the browser were going to send it an image, instead of text
    // since we support many different image formats, we have to be
    // specific here
    
if (preg_match ("/.jpeg$/i"$banner)) {
        
header("Content-type: image/jpeg");
    } else if (
preg_match ("/.jpg$/i"$banner)) {
        
header("Content-type: image/jpeg");
    } else if (
preg_match ("/.gif$/i"$banner)) {
        
header("Content-type: image/gif");
    } else if (
preg_match ("/.png$/i"$banner)) {
        
header("Content-type: image/png");
    } else {
        die(
"$banner is not recognised as a valid image format!");
    }
    
// you might want to add image formats if you have ones that are not
    // JPEG, GIF or PNG and want to send them to the browser.

    // now, lets do the actual work by sending the browser the image
    
readfile($banner);
?>
Make sure there is absolutely NO spaces before and after the <?php and ?>!!!

ohw and ask Pasty901 about the variable declaration, I don't recall how to do that correctly if the webserver is configured to be strict...
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote
Old 06-18-2005, 07:34 AM   #6 (permalink)
Something is broken
 
Calyxa's Avatar
 
Join Date: Jan 2003
Posts: 305
Calyxa is on a distinguished road
I've got two avatars that DC made for me and one i made myself I'd love to get a rotating avatar (and sig) did this work for you when you used it?
__________________
"We are a spirit, we are a natural part of the earth, and all of our ancestors, all of our relations who have gone to the spirit world, they are here with us. That's power." - John Trudell

Calyxa is offline   Reply With Quote
Old 06-19-2005, 04:39 AM   #7 (permalink)
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
well, I don't think I've tested this, but I'm sure it will work (perhaps with some little fixes)
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 06:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
2001 PCTechTalk