quote:
Originally posted by Absorbation
It's a php script
code:
<?php
error_reporting(E_ALL ^ E_NOTICE);
$folderdir = "./images"; //EDIT THIS
$types = array('jpeg','.png','.bmp','.jpg','.gif');
//------ dont edit--------
$dir = array();
$folder=opendir($folderdir);
while ($file = readdir($folder)) $dir[] = $file;
closedir($folder);
$files = array();
for ($i=0;$dir[$i];$i++){
$ext=strtolower(substr($dir[$i],-4));
if (in_array($ext,$types)){
$files[]=$dir[$i];
}
}
$image = $files[rand(0,count($files)-1)];
$ext=strtolower(substr($image,-4));
$ext = str_replace('.','',$ext);
Header ("Content-type: image/$ext");
readfile($folderdir . '/' .$image);
?>
im kinda confused, do i have to put in this code into a .php fil then insert the url of the php file in the avatar url???