\n"; if (isset($width) && strlen($width) > 1) { $wstr="WIDTH=$width"; $wstr_pass="&width=$width"; } else { $width=""; $wstr=""; $wstr_pass=""; } if (substr(urldecode($wd),0,2)!="./") $wd="."; if (strstr(urldecode($wd),"..")) $wd="."; if (strstr(urldecode($fn),"/") && $op=="v") $op=""; if (strstr(urldecode($fn),"/") && $op=="vt") $op=""; if(isset($op) && $op=="cw") { echo ""; echo "
images to pixels wide.  
(Leave blank for no rescaling)"; } else if(isset($op) && $op=="vt") { echo "
  
"; $nwd=rawurlencode(rawurldecode($wd)); // echo "<back to listing>
"; { if ($wd==".") { echo "root/
"; } else { $pd_arr=split("/",$wd); for($g=sizeof($pd_arr)-1;$g>=0;$g--) { $pd="."; for($i=1;$i$parent/"; } echo "
"; } } if (!eregi("\.(asm|inc|c|cpp|h)$",$fn)) $fnt=substr($fn,0,strlen($fn)-strlen(strrchr($fn,"."))); else $fnt=$fn; echo "
$fnt

"; echo "
";
    $openfn = "$wd/$fn";
    $fp=fopen($openfn,"r");
    if (eregi("\.(asm|inc|c|cpp|h)$",$fn)) { 
      while ($line = fgets($fp,1024)) 
      {
        $line = str_replace('<','<',$line);
        $line = str_replace('>','>',$line);
        echo $line;
      }
    }
    else
    {
      while ($line = fgets($fp,1024)) 
      {
        echo $line;
      }
    }
    fclose($fp);
    echo "
"; } else if(isset($op) && $op=="v") { echo "
  
"; $fnnew=rawurlencode($fn); $newwd=rawurlencode(substr($wd,2)); $newwd=str_replace("%2F","/",$newwd); $nwd=rawurlencode(rawurldecode($wd)); $dp=opendir($wd); $t=(int)0; while ($fnt = readdir($dp)) { $full_fn=$wd."/".$fnt; if (!is_dir($full_fn) && eregi("\.jpg$",$fnt)) { $t++; $fnlist[$fnt]=""; } }; closedir($dp); ksort($fnlist); $lastfn=""; $n=(int)0; while ($fntmp = key($fnlist)) { next($fnlist); $n++; if ($fntmp == $fn) { break; } $lastfn=$fntmp; } $nextfn=key($fnlist); { if ($wd==".") { echo "root/
"; } else { $pd_arr=split("/",$wd); for($g=sizeof($pd_arr)-1;$g>=0;$g--) { $pd="."; for($i=1;$i$parent/"; } echo "
"; } } $nfn_print=rawurldecode($lastfn); $nfn=rawurlencode($nfn_print); if (strlen($lastfn) > 0) echo "< <   "; echo "$fn ($n/$t)"; $nfn_print=rawurldecode($nextfn); $nfn=rawurlencode($nfn_print); if (strlen($nextfn) > 0) echo "   > >"; echo "
"; $txtfile="$wd/$fn.txt"; if (file_exists($txtfile) && $file=fopen($txtfile,"r")) { echo ""; while ($line = fgets($file,4096)) { echo "$line
"; } echo "
"; fclose($file); } echo ""; echo "
"; } else { if (!is_dir($wd) || !($dp=opendir($wd))) { die("Error in URL. Click here.
"); } while ($fn = readdir($dp)) { $fnlist[$fn]=""; }; closedir($dp); ksort($fnlist); echo "
"; echo ""; echo ""; echo "
"; echo "\"\""; echo "
 "; echo " $wdp2"; echo "
";

    $idxfile=$wd . "/index.txt";
    if (file_exists($idxfile) && $file=fopen($idxfile,"r"))
    {
      while ($line = fgets($file,4096))
      {
        echo $line;
      }
      echo "\n";
      fclose($file);
    }



    reset($fnlist);
    $indent="";
    while ($fn = key($fnlist))
    {
      next($fnlist);
      $full_fn=$wd."/".$fn;
      if (is_dir($full_fn)) {
        if($fn!="."&&$fn!=".."&&$fn!="siteimages"&&$fn!="thumbnails") {
          $newwd=rawurlencode($wd);
          $newfn=rawurlencode($fn);
          echo "$indent$fn\n";
        }
        if($fn=="..") {
          if ($wd==".")
          {
            echo "root/\n";
            $indent.="  ";
          }
          else
          {
  	    $pd_arr=split("/",$wd);
            for($g=sizeof($pd_arr)-1;$g>=1;$g--)
            {
              $pd=".";
              for($i=1;$i$parent";
            }
            echo "/" . $pd_arr[sizeof($pd_arr)-1] . "/\n";
            $indent.="  ";
          }
        }
      } 
    }
    $hasprinthr=(int)0;
    reset($fnlist);
    while ($fn = key($fnlist))
    {
      next($fnlist);
      $full_fn=$wd."/".$fn;
      $fs=floor(filesize($full_fn)/1000);
      if (!is_dir($full_fn)&&eregi("\.jpg$",$fn)) {
        $fnu=rawurlencode($fn);
        $newwd=rawurlencode($wd);
        $tmp="";
        $fn=substr($fn,0,56);
        if (!$hasprinthr) { $hasprinthr=1; echo "
\n"; } echo "$tmp\"\"
 $tmp$fn\n\n"; } } reset($fnlist); while ($fn = key($fnlist)) { next($fnlist); $full_fn=$wd."/".$fn; $fs=floor(filesize($full_fn)/1000); if (!is_dir($full_fn) && eregi("\.(wav|mp2|mp3)$",$fn)) { if (!$hasprinthr) { $hasprinthr=1; echo "
\n"; } $fnu=rawurlencode($fn); $newwd=str_replace("%2F","/",rawurlencode($wd)); echo "AUDIO: $fn ($fs"."k)\n"; } } reset($fnlist); while ($fn = key($fnlist)) { next($fnlist); $full_fn=$wd."/".$fn; $fs=floor(filesize($full_fn)/1000); if (!is_dir($full_fn) && eregi("\.(avi|mov|mpg|mpeg)$",$fn)) { if (!$hasprinthr) { $hasprinthr=1; echo "
\n"; } $fnu=rawurlencode($fn); $newwd=str_replace("%2F","/",rawurlencode($wd)); echo "VIDEO: $fn ($fs"."k)\n"; } } reset($fnlist); while ($fn = key($fnlist)) { next($fnlist); $full_fn=$wd."/".$fn; if (!is_dir($full_fn) && eregi("\.(asm|inc|c|cpp|h)$",$fn)) { if (!$hasprinthr) { $hasprinthr=1; echo "
\n"; } $fnu=rawurlencode($fn); $newwd=str_replace("%2F","/",rawurlencode($wd)); echo "CODE: $fn\n"; } } reset($fnlist); while ($fn = key($fnlist)) { next($fnlist); $full_fn=$wd."/".$fn; if (!is_dir($full_fn) && eregi("\.TXT$",$fn) && $fn != "index.txt") { $fnu=rawurlencode($fn); $newwd=rawurlencode($wd); if (!$hasprinthr) { $hasprinthr=1; echo "
\n"; } echo "TEXT: $fn\n"; } } echo "
\n"; if ($width!="") echo "Image rescaling set to $width pixels wide.
"; else echo "Image rescaling not enabled.
"; } echo "


"; if (!isset($op)) { echo "
 
\"\"
"; } echo "\n"; die(); ?>