jackwanders Posted July 8, 2003 Share Posted July 8, 2003 I've seen a number of forum members who have a series of sig pictures that change at regular intervals... How can I do this? I'd like to have a number of avatar and sig pics that are paired up and rotate at a regular interval. Anyone? Link to comment Share on other sites More sharing options...
0 Treebor Posted July 8, 2003 Share Posted July 8, 2003 Hmmm that would be sooo cool, But i don't know how to do that. Sorry. Treebor Link to comment Share on other sites More sharing options...
0 IlliniPi Posted July 8, 2003 Share Posted July 8, 2003 Send a PM to BxBoy, he'll help you out. ;) Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 There various ways to do it, here's one way.. <?PHP $URL1="sig1.jpg"; $URL2="sig2.jpg"; $URL3="sig3.jpg"; $URL4="sig4.jpg"; $URL5="sig5.jpg"; srand((double) microtime() * 1000000); $random = rand(1,5); if($random == 1) ? @header ("Location: $URL1"); elseif ($random == 2) ? @header ("Location: $URL2"); elseif ($random == 3) ? @header ("Location: $URL3"); elseif ($random == 4) ? @header ("Location: $URL4"); elseif ($random == 5) ? @header ("Location: $URL5"); ?> Link to comment Share on other sites More sharing options...
0 IlliniPi Posted July 8, 2003 Share Posted July 8, 2003 Whats up with your sig now BxBoy? Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 Whats up with your sig now BxBoy? nothing wrong with it. :whistle: (just a poke at yesterday's defacer challenger) :shifty: Link to comment Share on other sites More sharing options...
0 IlliniPi Posted July 8, 2003 Share Posted July 8, 2003 Care to elaborate? I'm lost with whatever you're talking about. :blink: Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 So if I create a php page, called randsig.php, how do i display my signature? What would I put in the tag? @ IlliniPi: Sunday there was supposed to be this big contest where hackers were going to see who could take down the most/best sites. Turned out to be a flop. In fact, one of the only sites that got hit was the site where you report hacked websites. :D Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 So if I create a php page, called randsig.php, how do i display my signature? What would I put in the tag? yep, just use tags around the .php script Link to comment Share on other sites More sharing options...
0 IlliniPi Posted July 8, 2003 Share Posted July 8, 2003 @ IlliniPi: Sunday there was supposed to be this big contest where hackers were going to see who could take down the most/best sites. Turned out to be a flop. In fact, one of the only sites that got hit was the site where you report hacked websites. :D Oh yah, I remember hearing that story the other day. Thx for the info. :rofl: Link to comment Share on other sites More sharing options...
0 Joel Posted July 8, 2003 Share Posted July 8, 2003 Here's one that doesn't care how many images are in the sig folder, nor what type (gif, jpg or png). Just put the images in a subfolder names sig and reference the php file with the tags. <?php Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); Header("Pragma: no-cache"); Header("Content-Type: image/gif"); srand((double)microtime()*1000000); $i = 0; $dir = opendir("sig/"); while(($im = readdir($dir))) { if($im != ".." && $im != "."){ $image[$i]= $im; $i++; } } closedir($dir); $len = count($image)-1; $n = rand(0,$len); if(!readfile("sig/".$image[$n])){ readfile("icons/error.gif"); } ?> Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 Hmm... well i've created picksig.php in my main folder with my images in the subfolder 'Assets/Images/Banners/bxx.gif'... here's the code for the page: <?php Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); Header("Pragma: no-cache"); Header("Content-Type: image/gif"); srand((double)microtime()*1000000); $i = 0; $dir = opendir("Assets/Images/Banners/"); while(($im = readdir($dir))) { ? ?if($im != ".." && $im != "."){ ? ? ? $image[$i] = $im; ? ? ? $i++; ? ?} }? closedir($dir); $len = count($image)-1; $n = rand(0,$len); if(!readfile("Assets/Images/Banners/".$image[$n])){ ? readfile("icons/error.gif"); } ?> But as you can see from my sig, all i get is a red x with the location of the image it can't find being 'picksig.php' The code in my sig is as such <IMG>http://eecs.cwru.edu/~jwa4/design/picksig.php</IMG> (with square brackets, obviously) I'm doing something wrong...what is it? Link to comment Share on other sites More sharing options...
0 Joel Posted July 8, 2003 Share Posted July 8, 2003 I think you need not use so many directories, but I'm no expert. Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 well i changed it so it only needs to refer down one directory...still no go. anyone got an idea why? i know I have PHP on the server, so that's not it. ;) Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 dunno, it works for me (and my smilies).. <-- http://bxboy.com/sigtest/similies.php check the permissions on the files in the directory.. Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 Is making a PHP script any different than just making a PHP web page? Right now in my picksig.php page, i just have the php code....no <html> tags or anything...just the php code seen above. that's correct, no? Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 that's fine, all you need is the php code.. don't see why it's not working for you.. how about a simple example to test your php.. <?PHP header ("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/banners2.gif"); ?> Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 Well I got one that works now. It must have been in the code that silly_walk provided ( no offense ;) ) It's tailored to my exact case, but it works and that's what matters. <?php Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); Header("Pragma: no-cache"); Header("Content-Type: image/gif"); srand((double)microtime()*1000000); $n = rand(1,14); if($n < 10) { header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b0".$n.".gif"); } else header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b".$n.".gif"); ?> Nice and simple. In fact, throw in a variable for the max number of banners, and this would work for up to 99 different banners. Thanks for the help, guys. Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 Here's the kicker now... The script I have will choose a sig randomly. How 'bout a sig that will choose one based on time, so I can change it, say every 5 minutes or so. If I know the intervals at which the sig changes, then I can set up an avatar script that pics the avatar to match the banner....know what I mean? Any ideas? Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 heh, this is beyond my scope.. never done this before.. maybe someone else can help you.. ;) Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 perhaps i've overstepped what's possible...i dunno :huh: thanks a bunch, bxboy. Link to comment Share on other sites More sharing options...
0 BxBoy Posted July 8, 2003 Share Posted July 8, 2003 don't give up, it's definately do-able.. Link to comment Share on other sites More sharing options...
0 sanctified Veteran Posted July 8, 2003 Veteran Share Posted July 8, 2003 Well I got one that works now. It must have been in the code that silly_walk provided ( no offense ;) )It's tailored to my exact case, but it works and that's what matters. <?php Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); Header("Pragma: no-cache"); Header("Content-Type: image/gif"); srand((double)microtime()*1000000); $n = rand(1,14); if($n < 10) { header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b0".$n.".gif"); } else header("Location: http://eecs.cwru.edu/~jwa4/design/Assets/Images/Banners/b".$n.".gif"); ?> Nice and simple. In fact, throw in a variable for the max number of banners, and this would work for up to 99 different banners. Thanks for the help, guys. Im using that exact code and mine is not working, why? Link to comment Share on other sites More sharing options...
0 sanctified Veteran Posted July 8, 2003 Veteran Share Posted July 8, 2003 who can host my php script? Link to comment Share on other sites More sharing options...
0 jackwanders Posted July 8, 2003 Author Share Posted July 8, 2003 Hey SD...PM it to me and I'll put it up for you. The pictures will have to be hosted elsewhere, of course. Link to comment Share on other sites More sharing options...
0 Joel Posted July 8, 2003 Share Posted July 8, 2003 ,Jul 8 2003, 04:13] who can host my php script? I can if you still need it. I can host your pics, too. Link to comment Share on other sites More sharing options...
Question
jackwanders
I've seen a number of forum members who have a series of sig pictures that change at regular intervals...
How can I do this? I'd like to have a number of avatar and sig pics that are paired up and rotate at a regular interval.
Anyone?
Link to comment
Share on other sites
48 answers to this question
Recommended Posts