One good idea [message #3273] |
Sat, 15 June 2002 12:28 |
Ecxeleron
Messages: 187 Registered: January 2002 Location: Australia
Karma: 0
|
Senior Member |
|
|
a maximum size for avatars, anywayz the thing I was gonna say is avatar rotation! I found this tiny scripts on hotscripts:
<?php
//read folder
$folder=opendir(".");
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;
for ($i=0;$names[$i];$i++){
$ext=strtolower(substr($names[$i],-4));
if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$e xt==".png"){$names1[$tempvar]=$names[$i];$tempvar++;}
}
//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);
if (isset($pic)){header ("Location: $slika");}
else {echo "<img src=\"$slika\" $dimensions[3]>";}
?>
|
|
|
Re: One good idea [message #3277 is a reply to message #3273] |
Sat, 15 June 2002 16:41 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Why rotate avatars? This would only cause unnecessary bandwidth load not to mention not worok 80% of the time due to browser caching the avatar image.
FUDforum Core Developer
|
|
|
|
|
|
|
|