Constant Changing Images
Breakthrough
Texture Artist (ns_prometheus) Join Date: 2005-03-27 Member: 46620Members, Constellation
<div class="IPBDescription">Specifically, Forum Signatures</div> <img src='http://www.tacticalgamer.com/sig/signature.jpg' border='0' alt='user posted image' />
I took that signature, as it was the first I saw when I remembered. Basically, I was wondering how I would go about doing what he did - making a .jpg refresh every time the client downloads it again.
I have a web host and a domain, so I'm set there - I just need to know the script, or how to make it dynamically update (according to a timer, let's say, or a random number - so when people refresh, they see a different image).
I'm thinking of doing this for my own signature, so that when people refresh the page, or see a differnet post by me, I'll have a different signature (and/or avatar for that matter).
Edit: I remember someone recently did this, where everyone submitted a random phrase and when you refreshed the page, you would see a different phrase that was submitted.
Edit 2: Found the guy = <a href='http://www.unknownworlds.com/forums/index.php?showuser=24475' target='_blank'>Curve</a>.
I took that signature, as it was the first I saw when I remembered. Basically, I was wondering how I would go about doing what he did - making a .jpg refresh every time the client downloads it again.
I have a web host and a domain, so I'm set there - I just need to know the script, or how to make it dynamically update (according to a timer, let's say, or a random number - so when people refresh, they see a different image).
I'm thinking of doing this for my own signature, so that when people refresh the page, or see a differnet post by me, I'll have a different signature (and/or avatar for that matter).
Edit: I remember someone recently did this, where everyone submitted a random phrase and when you refreshed the page, you would see a different phrase that was submitted.
Edit 2: Found the guy = <a href='http://www.unknownworlds.com/forums/index.php?showuser=24475' target='_blank'>Curve</a>.
Comments
I'm sure you can do it with a PHP Script - all I've found is the rotator script, which I didn't find worked for me...
Regardless, a quick Google search turned up this: <a href='http://automaticlabs.com/products/rotator' target='_blank'>http://automaticlabs.com/products/rotator</a>
Like so?
random.jpg is actually random.php There's a file called .htaccess that fools the server into thinking that the php file in that directory is actually a jpg file.
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->RewriteEngine On
Redirect /sigs/random.jpg http://s93553449.onlinehome.us/sigs/random.php<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Here's the random.php btw
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--><?php
$image_array = array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg');
$image_filetype_array = array(0, 0, 0, 0, 0);
// 0=jpg, 1=gif, 2=png etc
$length = count($image_array);
$random_image = rand(0, $length);
//checks filetype, sets
if($image_filetype_array=0){
Header ("Content-type: image/jpg");
}
if($image_filetype_array=1){
Header ("Content-type: image/gif");
}
if($image_filetype_array=2){
Header ("Content-type: image/png");
}
//prints
$image_name = $image_array[$random_image];
$image = @readfile($image_name);
print $image;
?><!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Edit: So Caboose, just add that bit to my server's files, and I'm set to go? Thanks for the help <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->
Redirect /sigs/random.jpg http://s93553449.onlinehome.us/sigs/random.php<!--c2--></td></tr></table><div class='postcolor'><!--ec2--> <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
Do I have to include the full URL, or can I just use a directory format, like "/sigs/random.jpg"?
Example:
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->RewriteEngine On
Redirect /sigs/random.jpg /sigs/random.php<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
As you can see, I came up with a different solution in the meantime <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->
As you can see, I came up with a different solution in the meantime <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo--> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
Heh I thought you were condizzle for a second.
4 people, counting Condizzle himself. He's losing big time right now. I wonder if he has any way to take the fight back to them?
You should really fix your sig.
::EDIT::
Do the avatar as well.