\n"; global $disp_type; global $dir; global $self; global $home; if (preg_match("/\.\./","$dir")){ $lock ='1';} if((!$lock)&&($dir)){echo "Index of $dir";} if(($lock)&&($dir)){echo "Wrong Action !";} if (!$dir) {echo "! Parent Dir";} else { $dd = explode("/",$dir); echo " | Foward to Parent Dir"; if ($dd[2]){ $tdir=array_pop($dd); $back_dir = explode("/$tdir",$dir); echo " | Foward to Upper Dir"; } } echo " | Home

\n"; } function showmenu_w(){ global $disp_type; global $dir; global $self; global $home; echo "
\n\n"; if (preg_match("/\.\./","$dir")){ $lock ='1';} echo "\n"; echo "\n
"; if((!$lock)&&($dir)){ echo "
$dir"; } else { echo "
Parent Dir.";} echo "
\n
\nFoward to:

\n"; if(($lock)&&($dir)){ echo "Wrong Action !

\n";} if ($dir){ $dd = explode("/",$dir); echo "Parent Dir.

\n"; if ($dd[2]){ $tdir=array_pop($dd); $back_dir = explode("/$tdir",$dir); echo "Upper Dir.

\n"; } } echo "Home

\n

\n

$c\n"; } global $self; $c = 'GDS Viewer'; $mode = $_GET["mode"]; if ($mode == "popup"){ $filename = $_GET["filename"]; global $dir; if (!$dir){ $d='.'; } echo "\n\n$filename\n\n"; echo "\n"; echo "\n"; echo "\n
\n\n\n"; } elseif (($mode == "thumb") AND ($c)){ $ext = $_GET["ext"]; $f = $_GET["f"]; $ow = $_GET["ow"]; $oh = $_GET["oh"]; $tw = $_GET["tw"]; $th = $_GET["th"]; if($ext == "2"){ $o = imagecreatefromjpeg($f); } else { $o = imagecreatefrompng($f); } if ($gdv){ $t = imagecreate($tw, $th); } else { $t = imagecreatetruecolor($tw, $th); } ImageCopyResized( $t,$o,0,0,0,0,$tw,$th,$ow,$oh); if($ext == "2"){ header("content-type: image/jpeg"); imagejpeg($t); } else { header("content-type: image/png"); imagepng($t); } ImageDestroy($o); ImageDestroy($t); } else { if ($c){ echo "\n\n\n"; echo "$title\n"; ?> \n"; echo "\n"; echo "\n
\n"; showmenu_w(); echo "\n"; } else { echo "\n
\n"; showmenu_s(); echo "\n\n
\n"; } function an_file($file_path){ global $maxdist; $img= @getimagesize($file_path); if (($img[0] < $maxdist) and ($img[1] < $maxdist)){$tw=$img[0]; $th=$img[1];} else { if ($img[0] < $img[1]){$th=$maxdist; $tw=$img[0]*$th/$img[1];} if ($img[0] > $img[1]){$tw=$maxdist; $th=$img[1]*$tw/$img[0];} if ($img[0] == $img[1]){$tw=$maxdist; $th=$maxdist;} } $img_prop = "$img[2],$img[0],$img[1],$tw,$th,$img_type,$file_name"; return $img_prop; } function show_dir($file_path, $file_name, $filesize, $file_mtime){ global $dir; $img_prop = an_file($file_path); $img_prop = explode(",",$img_prop); $ext = $img_prop[0]; $ow = $img_prop[1]; $oh = $img_prop[2]; $tw = round($img_prop[3]); $th = round($img_prop[4]); $ts_1 = round($filesize/1000,1); $ts_2 = round($filesize/1000000,2); if ($ts_1 < 1) { $show_size = 1; $t = 'KB'; $m = 1; } if ($ts_2 > 1) { $show_size = $ts_2; $t = 'MB'; $m = 1; } if (!$m){ $show_size = $ts_1; $t = 'KB'; } global $self; if (($file_name != $self) and ($file_name != 'dir.gif') and ($ext==1) or ($ext==2) or ($ext==3)){ $file=".$dir/$file_name"; echo "
"; if ($ext==1){ echo ""; echo ""; } elseif (($ext==2) or ($ext==3)){ echo ""; echo ""; } $fn_array = explode(".",$file_name); $l = count($fn_array)-1; $sfn = mb_strimwidth($fn_array[0], 0, 8, ".."); echo "
$sfn.$fn_array[$l]
\n"; } return; } if (preg_match("/\.\./","$dir")){ $lock ='1'; } if(!$lock){ function get_list($dir_cnt) { $dir_handle=opendir($dir_cnt); while ($file = readdir($dir_handle)){ $file_list = "$file_list,$file"; } closedir($dir_handle); return $file_list; } function show_indx($dir_cnt){ global $dir; global $self; show_indx(${script_name}); ereg ( "([^/]*)$",$dir_cnt,$temp); $td_name = ereg_replace( "$temp[1]$","", $dir_cnt); } if ($dir){$dir_name = "./$dir";} else {$dir_name = ".";} $file_list = get_list($dir_name); $file_list = explode(",",$file_list); sort($file_list); for ($count=1;$count
"; echo ""; echo "

"; echo ""; $sdn = mb_strimwidth($dir_list[$count], 0, 12, ".."); echo "$sdn\n"; } } echo "

\n"; if (!$disp_type){ showmenu_s(); echo "

$c\n"; } echo "\n\n"; } } ?>