My dirlist isn't showing images in Mozilla and it is just showing red x's in IE.
The page is http://mother2.net/eb/sprites/
Heres the code....
<script>
// Used on the texture generator page
function buttonDown( event ) {
if (navigator.appName == 'Netscape'||navigator.appName=='Mozilla Firefox') button=event.which;
if (navigator.appName == 'Microsoft Internet Explorer') button = event.button;
}
function buttonUp( event ) {
button = 0;
}
</script>
</head>
<body>
<body background="/bg.gif">
<?
#<!-- Directory Listing Powered By Mother2.net With Fix2 => http://www.mother2.net -->
$show_select="true"; // put "true" to show display box or "no" to hide.
$show_search = "true"; // put "true" to show search or "no" to hide.
$show_filenames = "no"; /* when the display is on Titles, put "true" to have text at the top of
the Tite with the filename, put "no" to hide the filename only for non image files.*/
$otherpath=""; // put the path where you want the directory to view, no slashes before or after the path.
$thum_width=100;
$thum_height=90;
$rows=6; // When in titled display, this is how many pictures will be in a row.
//do not edit anything below this line
$mode = $HTTP_GET_VARS["image"];
$S = $HTTP_GET_VARS["S"];
$view = $HTTP_GET_VARS["view"];
$mode= $HTTP_GET_VARS["mode"];
$showonly= $HTTP_GET_VARS["showonly"];
$path =str_replace(basename($_SERVER['PHP_SELF']), '', $_SERVER['PHP_SELF']);
if("$otherpath" == ""){
$dir="./";
}else{
$path=$path.$otherpath;
$foldertoher="$otherpath/";
$dir="$otherpath";
}
if("$mode" !== "image"){
echo "<title> Directory of $path</title>";
if (!isset($view)){ $view = details; }
if (!isset($S)){ $S =N; }
function wsort($letter,$ww){
global $S,$A,$view,$showonly;
if($A == "" && $S == $letter){ $extra="&A=D"; }
echo "<A HREF=\"?S=$letter&view=$view$extra&showonly=$showonly\">$ww</A>";
}
function viewoption($value,$wrd){
global $view;
if("$view" == "$value" ){ $sel = selected; }
echo "<option value=\"$value\" $sel>$wrd \n";
}
$dh = @opendir($dir);
$i=0;
while (false !== ($dirfile = @readdir($dh))) {
if($dirfile !== '..' && $dirfile !== '.' ){
if($showonly){
if(@eregi("$showonly", $dirfile )){ $dirfile =$dirfile; } else { $dirfile = ""; }
}
if("$dirfile" !== ""){
switch ($S) {
case N:
$files[$i][name] = $dirfile;
$files[$i][fd] = @filemtime("$dir/$dirfile");
$files[$i][size] = @filesize("$dir/$dirfile");
break;
case M:
$files[$i][fd] = @filemtime("$dir/$dirfile");
$files[$i][size] = @filesize("$dir/$dirfile");
$files[$i][name] = $dirfile;
break;
case S:
$files[$i][size] = @filesize("$dir/$dirfile");
$files[$i][name] = $dirfile;
$files[$i][fd] = @filemtime("$dir/$dirfile");
break;
}//end case
$sumsize[] =@filesize("$dir/$dirfile");
$i++;
}
}
}
if(empty($files)){ $isempty = "yes"; }
function filesizepre($filesize){ return round( ($filesize / 1024),1 ).k; }
?>
<? if($show_search == true){ ?>
<? } ?>
<H1>Index of <? echo $path ?> </H1>
<? if("$show_search" == "true"){ ?>
<form name="form1" method="get" action="">
<input type="submit" name="Submit" value="File Search ">
<input name="showonly" type="text" id="showonly" size="15" value="<? echo $showonly ?>">
<br>
<? }else{
echo "<input name=showonly type=hidden value=\"$showonly\">";
} ?>
<input name="A" type="hidden" value="<? echo $A ?>">
<input name="S" type="hidden" value="<? echo $S ?>">
<? if("$show_select" == "true"){ ?>
<select name="view" onChange="document.form1.submit()">
<? viewoption(image,"Image Preview"); ?>
<? viewoption(details,"Details"); ?>
<? viewoption(titles,"Titles"); ?>
</select>
<? } ?>
<font color="#000000" size=4><em><? if("$showonly" ==""){ echo 'Files in directory:'; }else{ echo "Files Showing:"; } ?> <? echo sizeof($files); ?> <? if("$showonly" ==""){ echo 'Directory Size:'; }else{ echo "Sorted Size:"; } ?> <? echo filesizepre(@array_sum($sumsize)) ?> <? if("$showonly" && "$isempty" !==""){ echo " - File Search Provided 0 Results."; } ?>
<br>
</em></font>
</form>
<PRE><? wsort(N,Name); ?> <? wsort(M,"Last Modified"); ?> <? wsort(S,"Size"); ?> <table border="10" width="100%" bordercolor="red">
<tr>
<td style="background-image:url(/check.GIF)">
<HR size="8" wdith="90%" color="darkred">
<?
if($A == ""){
@sort($files);
}else{
@rsort($files);
}
if(!$isempty){
$rt=1;
foreach($files as $filename){
$getname22 = substr("$filename[name]", 0, 22);
if(strlen($filename[name]) > 22){ $prefilename = "$getname22..."; }else{ $prefilename = $getname22; }
if($view == image ){
echo "<br><a href=\"$foldertoher$filename[name]\"><img src=\"".$_SERVER['PHP_SELF']."?view=$view&mode=image&image=$filename[name]\" width=$thum_width height=$thum_height border=0></a><br>";
}
if($view == details){
echo "<br><IMG SRC=\"/icons/portal.gif\" ALT=\"[$exten]\"> ";
}
if($view == titles){
$br='';
if($rt == $rows){ $br="<br>"; $rt =0; }
echo "<a href=\"$foldertoher$filename[name]\"><img src=\"".$_SERVER['PHP_SELF']."?view=$view&mode=image&title=yes&image=$filename[name]\" width=$thum_width height=$thum_height border=0></a> $br";
}else{
echo "<A HREF=\"$foldertoher$filename[name]\">$prefilename</A> ". str_repeat(" ",(25 - strlen($prefilename))) ." ".date("j-M-y h:iA", $filename[fd])." ".(filesizepre($filename[size]) )." ";
}
$rt++;
}
}//is empty
?>
</PRE><HR size="8" wdith="90%" color="darkred">
</td>
</tr>
</table>
<? echo $_SERVER['SERVER_SIGNATURE']; ?>
<?
}//end of mode if nothing
if("$mode" == "image"){
$image = $foldertoher.$HTTP_GET_VARS["image"];
$view = $HTTP_GET_VARS["view"];
$exten = strtoupper(strstr($image, '.'));
switch ($exten) {
case '.JPEG':
$imgd = @imagecreatefromjpeg($image);
break;
case '.JPG':
$imgd= @imagecreatefromjpeg($image);
break;
case '.gif':
$imgd = @imagecreatefromgif($image);
break;
case '.PNG':
$imgd = @imagecreatefrompng($image);
break;
}
$im = imagecreatetruecolor($thum_width,$thum_width);
$size = @getimagesize($image);
$getname22 = substr(@eregi_replace("$exten","",$image) , 0, ($thum_width / 10));
if( (strlen(@eregi_replace("$exten","",$image))) > ($thum_width / 10) ){ $w_er = "$getname22..$exten"; }else{ $w_er = $getname22.$exten; }
if("$imgd" == ""){ $w_er = "$image"; $white = imageColorallocate($im, 255,255,255); $filetype="file"; }else{
$rr=@imagecolorat($imgd, 10, 4);
$cn = @imagecolorsforindex($imgd, $rr);
if("".$cn[red].$cn[green].$cn[blue]."" < "200200200"){ $white = imageColorallocate($im, 255,255,255); }
}
@imageCopyResampled($im, $imgd , 0, 0, 0, 0, $thum_width,$thum_width, $size[0], $size[1]);
if("$view" == "titles" && "$show_filenames" == "no" && "$filetype" !== "file"){
}
if("$view" !== "image" ){
if(strlen($foldertoher) > 5 && $thum_width > 200 or "$foldertoher" == ""){
imagestring($im,2 ,1 ,2, $w_er, $white);
imagestring($im,2,1 ,2, $w_er, $white);
}
}
imagejpeg($im);
imagedestroy($im);
}//end of mode
?>