PDA

View Full Version : New Sig!


Squeeky
2003-05-03, 11:59 AM
I got a new sig, It randomly changes the image in my sig. I love it! 2 more sigs from Airlift soon to come. I like to keep my sig fresh, what do you guys think? For those who want the code, here it is


//read folder
$folder=opendir("." );

$names = Array();

while ($file = readdir($folder))
$names[count($names)] = $file;

closedir($folder);

//sort file names in array
sort($names);

//remove any non-images from array
$tempvar = 0;
foreach ($names as $name)
{
$ext = strtolower(substr($name,-4));
if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png" )
$names1[] = $name;
}
//random
srand ((double) microtime() * 10000000);
$rand_keys = array_rand ($names1, 2);
//random image from array
$slika = $names1[$rand_keys[0]];
//image dimensions
$dimensions = GetImageSize($slika);
header ("Location: http://staff.planetside-universe.com/squeeky/Sigs/$slika" )

�io
2003-05-03, 01:02 PM
Ummm... yeah that's good and all but we aren't all staff man, no HTML for us. Stupid Hamma not making me staff, it's all his fault! ;)

powdahound
2003-05-03, 01:16 PM
1st: It's PHP not HTML.

2nd: You put that script on some host somewhere, change the URLs to the images, and then in your sig you put: http://www.whatever.com/randomsig.php

Squeeky
2003-05-03, 01:27 PM
Originally posted by powdahound
1st: It's PHP not HTML.

2nd: You put that script on some host somewhere, change the URLs to the images, and then in your sig you put: http://www.whatever.com/randomsig.php


Indeed!

�io
2003-05-03, 01:59 PM
You can [img] a link?

....weird

Nevertheless i'll use this baby once i can get some sigs made. :D

Squeeky
2003-05-03, 02:23 PM
Technically yes, If the .php file contains raw image data you can