\nYou are advised to use this base path: ".$adv.".
\n"); } if($_GET["sub"]){ $sub = "/".$_GET["sub"]; } else { $sub = ""; } // admin logout function if($_GET["admin"] == 2){ unset($_SESSION['reg_session']); session_destroy(); unset($_GET["admin"]); } // mime function (in case of not installed) if(!function_exists('mime_content_type')){ function mime_content_type($file){ $file = explode(".", strrev($file), 2); return strrev($file[0])."-file"; } } // stripos function transcribed (in case of phpversion < 5) if(!function_exists('stripos')){ function stripos($file, $filename){ return strpos(strtolower($file),strtolower($filename)); } } // replace spaces from $url into url-safe chars function href($url){ $url = str_replace(" ","%20",$url); $url = str_replace("'","%27",$url); $url = str_replace("\"","%22",$url); $url = str_replace("-","%2D",$url); $url = str_replace("&","%26",$url); return($url); } // replaces & from $input into html-safe chars function ampify($input){ $input = str_replace("&","&",$input); return($input); } // deletes the useless spaces at the end of $input function clear($input){ return($input); } // convert filesize (from byte) function size($size){ $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB"); $divider = pow(1024, ($i = floor(log($size, 1024)))); if($divider < 2){ $divider = 1; } return round($size/$divider, 2) . $filesizename[$i]; } // show dir listing function dirbrowse($path, $call){ if(substr($path , strlen($path)-1) != "/"){ $path .= "/"; } $dirs = array(); if($handle = opendir($path)){ while(false !== ($file = readdir($handle))){ if(((is_dir($file))||(is_dir($path.$file)))&&($file != ".")&&($file != "..")){ $offset = ""; for($c = 0; $call > $c; $c++){ $offset .= "    "; } $dirs[$path.$file] = $offset.$file; $result = dirbrowse($path.$file."/", $call + 1); $dirs = array_merge($dirs, $result); } } closedir($handle); } return($dirs); } // show file and dir listing function browse($path){ if(substr($path , strlen($path)-1) != "/"){ $path .= "/"; } $func = array(); $dirs = array(); $files = array(); if($handle = opendir($path)){ while(false !== ($file = readdir($handle))){ if(($file == ".")||($file == "..")){ $func[] = $path.$file; } elseif((is_dir($file))||(is_dir($path.$file))){ $dirs[] = $path.$file; } else { $files[] = $path.$file; } } closedir($handle); } natcasesort($func); natcasesort($files); natcasesort($dirs); $sorting = array_merge($func, $dirs, $files); return($sorting); } // convert $number (seconds) into 8-digit $result (milliseconds) function ms($number){ $number = $number*1000; $int = floor($number); $number = round($number, (8-strlen($int))); return($number); } // search all dirs and files function search($path, $filename){ if(substr($path , strlen($path)-1) != "/"){ $path .= "/"; } $func = array(); $dirs = array(); $files = array(); if($handle = opendir($path)){ while(false !== ($file = readdir($handle))){ if($file != substr($_SERVER["PHP_SELF"],1)){ if(($file == ".")||($file == "..")){ if(stripos($file, $filename) !== FALSE){ $func[] = $path.$file; } } elseif(((is_dir($file))||(is_dir($path.$file)))&&($file != ".")&&($file != "..")){ if(stripos($file, $filename) !== FALSE){ $dirs[] = $path.$file; } $result = search($path.$file."/", $filename); $dirs = array_merge($dirs, $result); } else { if(stripos($file, $filename) !== FALSE){ $files[] = $path.$file; } } } } closedir($handle); } natcasesort($func); natcasesort($files); natcasesort($dirs); $sorting = array_merge($func, $dirs, $files); return($sorting); } // parse(process("test.mp3")); function process($filename){ $expl = explode(".",strrev($filename)); $filetypes = array("mp3","mpg","mpeg"); if(!in_array(strrev($expl[0]), $filetypes)){ $return = array(" " => "This file type is not supported."); } else { $mp3 = new mp3($filename); $mp3->get_id3(); $mp3->get_info(); $return = array_merge($mp3->id3, $mp3->info); } return($return); } // parse(process("test.mp3")); function parse($fileinfo){ if(!is_array($fileinfo)){ return("Input is not an array."); } else { $genres_array = array( 'Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical', 'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel', 'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta', 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American', 'Cabaret', 'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock', 'Folk', 'Folk/Rock', 'National Folk', 'Swing', 'Fast Fusion', 'Bebob', 'Latin', 'Revival', 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock', 'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson', 'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus', 'Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba', 'Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', 'Duet', 'Punk Rock', 'Drum Solo', 'Acapella', 'Euro-house', 'Dance Hall'); asort($genres_array); foreach($fileinfo AS $key => $value){ if($key != "tag"){ $value = preg_replace('/\s\s+/', ' ', $value); if(substr($value, -1) == " "){ $value = substr($value, 0, -1); } $key = strtoupper($key{0}).substr($key, 1); echo " ".htmlentities($key, ENT_QUOTES)." ".htmlentities($value, ENT_QUOTES)." \n"; } } echo " \n"; return(true); } } // define image types via an array $imagetypes = array('', 'GIF', 'JPG', 'PNG', 'SWF', 'PSD', 'BMP', 'TIFF(intel byte order)', 'TIFF(motorola byte order)', 'JPC', 'JP2', 'JPX', 'JB2', 'SWC', 'IFF', 'WBMP', 'XBM'); // class for mp3-data reading class mp3{ var $id3_genres_array = array( 'Blues', 'Classic Rock', 'Country', 'Dance', 'Disco', 'Funk', 'Grunge', 'Hip-Hop', 'Jazz', 'Metal', 'New Age', 'Oldies', 'Other', 'Pop', 'R&B', 'Rap', 'Reggae', 'Rock', 'Techno', 'Industrial', 'Alternative', 'Ska', 'Death Metal', 'Pranks', 'Soundtrack', 'Euro-Techno', 'Ambient', 'Trip-Hop', 'Vocal', 'Jazz+Funk', 'Fusion', 'Trance', 'Classical', 'Instrumental', 'Acid', 'House', 'Game', 'Sound Clip', 'Gospel', 'Noise', 'AlternRock', 'Bass', 'Soul', 'Punk', 'Space', 'Meditative', 'Instrumental Pop', 'Instrumental Rock', 'Ethnic', 'Gothic', 'Darkwave', 'Techno-Industrial', 'Electronic', 'Pop-Folk', 'Eurodance', 'Dream', 'Southern Rock', 'Comedy', 'Cult', 'Gangsta', 'Top 40', 'Christian Rap', 'Pop/Funk', 'Jungle', 'Native American', 'Cabaret', 'New Wave', 'Psychadelic', 'Rave', 'Showtunes', 'Trailer', 'Lo-Fi', 'Tribal', 'Acid Punk', 'Acid Jazz', 'Polka', 'Retro', 'Musical', 'Rock & Roll', 'Hard Rock', 'Folk', 'Folk/Rock', 'National Folk', 'Swing', 'Fast Fusion', 'Bebob', 'Latin', 'Revival', 'Celtic', 'Bluegrass', 'Avantgarde', 'Gothic Rock', 'Progressive Rock', 'Psychedelic Rock', 'Symphonic Rock', 'Slow Rock', 'Big Band', 'Chorus', 'Easy Listening', 'Acoustic', 'Humour', 'Speech', 'Chanson', 'Opera', 'Chamber Music', 'Sonata', 'Symphony', 'Booty Bass', 'Primus', 'Porn Groove', 'Satire', 'Slow Jam', 'Club', 'Tango', 'Samba', 'Folklore', 'Ballad', 'Power Ballad', 'Rhythmic Soul', 'Freestyle', 'Duet', 'Punk Rock', 'Drum Solo', 'Acapella', 'Euro-house', 'Dance Hall'); var $info_bitrates = array( 1 => array( 1 => array( 0 => 0, 16 => 32, 32 => 64, 48 => 96, 64 => 128, 80 => 160, 96 => 192, 112 => 224, 128 => 256, 144 => 288, 160 => 320, 176 => 352, 192 => 384, 208 => 416, 224 => 448, 240 => false), 2 => array( 0 => 0, 16 => 32, 32 => 48, 48 => 56, 64 => 64, 80 => 80, 96 => 96, 112 => 112, 128 => 128, 144 => 160, 160 => 192, 176 => 224, 192 => 256, 208 => 320, 224 => 384, 240 => false), 3 => array( 0 => 0, 16 => 32, 32 => 40, 48 => 48, 64 => 56, 80 => 64, 96 => 80, 112 => 96, 128 => 112, 144 => 128, 160 => 160, 176 => 192, 192 => 224, 208 => 256, 224 => 320, 240 => false) ), 2 => array( 1 => array( 0 => 0, 16 => 32, 32 => 48, 48 => 56, 64 => 64, 80 => 80, 96 => 96, 112 => 112, 128 => 128, 144 => 144, 160 => 160, 176 => 176, 192 => 192, 208 => 224, 224 => 256, 240 => false), 2 => array( 0 => 0, 16 => 8, 32 => 16, 48 => 24, 64 => 32, 80 => 40, 96 => 48, 112 => 56, 128 => 64, 144 => 80, 160 => 96, 176 => 112, 192 => 128, 208 => 144, 224 => 160, 240 => false), 3 => array( 0 => 0, 16 => 8, 32 => 16, 48 => 24, 64 => 32, 80 => 40, 96 => 48, 112 => 56, 128 => 64, 144 => 80, 160 => 96, 176 => 112, 192 => 128, 208 => 144, 224 => 160, 240 => false) )); var $info_sampling_rates = array( 0 => array(0 => false, 4 => false, 8 => false, 12 => false), 1 => array(0 => "44100 Hz", 4 => "48000 Hz", 8 => "32000 Hz", 12 => false), 2 => array(0 => "22050 Hz", 4 => "24000 Hz", 8 => "16000 Hz", 12 => false), 2.5 => array(0 => "11025 Hz", 4 => "12000 Hz", 8 => "8000 Hz", 12 => false)); var $info_versions = array(0 => "reserved", 1 => "MPEG Version 1", 2 => "MPEG Version 2", 2.5 => "MPEG Version 2.5"); var $info_layers = array("reserved", "Layer I", "Layer II", "Layer III"); var $info_channel_modes = array(0 => "stereo", 64 => "joint stereo", 128 => "dual channel", 192 => "single channel"); var $file = ""; var $fh = false; var $error = false; var $id3_parsed = false; var $id3 = array(); var $url = ""; var $info = array(); // process mp3 filename function mp3($file, $exitonerror=true){ if(file_exists($file)){ $this->file = $file; $this->fh = fopen($this->file,"r"); global $HTTP_HOST, $PHP_SELF; $this->url = "http://".$HTTP_HOST."/".$PHP_SELF; } else { $this->error = "This file does not exist."; if ($exitonerror) $this->exitonerror(); } } // error-function function exitonerror(){ echo $this->error; exit; } // convert unpack bytes to string function cunpack($str) { if(strpos($str, 0) === false){ return trim($str); } return trim(substr($str, 0, strpos($str, 0))); } // get idv3 tag data function get_id3(){ $this->id3_parsed = true; fseek($this->fh, -128, SEEK_END); $line = fread($this->fh, 10000); if(preg_match("/^TAG/", $line)){ $this->id3 = unpack("a3tag/a30title/a30author/a30album/a4year/a28comment/C1track_specified/C1track_number/C1genre_id", $line); $this->id3["author"] = $this->cunpack($this->id3["author"]); $this->id3["title"] = $this->cunpack($this->id3["title"]); $this->id3["album"] = $this->cunpack($this->id3["album"]); $this->id3["year"] = $this->cunpack($this->id3["year"]); $this->id3["comment"] = $this->cunpack($this->id3["comment"]); $this->id3["genre"] = $this->id3_genres_array[$this->id3["genre_id"]]; unset($this->id3["genre_id"]); unset($this->id3["track_specified"]); unset($this->id3["track_number"]); return(true); } else { $this->error = "No IDv3 tag found."; return(false); } } // calculate duration of file function calculate_length($id3v2_tagsize = 0){ if($this->info["bitrate"] != 0){ $length = floor(($this->info["filesize"] - $id3v2_tagsize) / $this->info["bitrate"] * 0.008); $min = floor($length / 60); $min = strlen($min) == 1 ? "0$min" : $min; $sec = $length % 60; $sec = strlen($sec) == 1 ? "0$sec" : $sec; $return = $min.":".$sec; } else { $return = "N/A"; } return($return); } // get file data function get_info(){ $second = $this->synchronize(); $third = ord(fread($this->fh, 1)); $fourth = ord(fread($this->fh, 1)); $this->info["version_id"] = ($second & 16) > 0 ? ( ($second & 8) > 0 ? 1 : 2 ) : ( ($second & 8) > 0 ? 0 : 2.5 ); $this->info["version"] = $this->info_versions[ $this->info["version_id"] ]; $this->info["layer_id"] = ($second & 4) > 0 ? ( ($second & 2) > 0 ? 1 : 2 ) : ( ($second & 2) > 0 ? 3 : 0 ); ; $this->info["layer"] = $this->info_layers[ $this->info["layer_id"] ]; $this->info["protection"] = ($second & 1) > 0 ? "no CRC" : "CRC"; $this->info["bitrate"] = $this->info_bitrates[ $this->info["version_id"] ][ $this->info["layer_id"] ][ ($third & 240) ]; $this->info["sampling_rate"] = $this->info_sampling_rates[ $this->info["version_id"] ][ ($third & 12)]; $this->info["padding"] = ($third & 2) > 0 ? "on" : "off"; $this->info["private"] = ($third & 1) > 0 ? "on" : "off"; $this->info["channel_mode"] = $this->info_channel_modes[$fourth & 192]; $this->info["copyright"] = ($fourth & 8) > 0 ? "on" : "off"; $this->info["original"] = ($fourth & 4) > 0 ? "on" : "off"; $this->info["filesize"] = filesize($this->file); $this->info["length"] = $this->calculate_length(); $this->info["filesize"] = size($this->info["filesize"]); unset($this->info["version_id"]); unset($this->info["layer_id"]); } // reset arrays function synchronize(){ $finished = false; rewind($this->fh); while(!$finished){ $skip = ord(fread($this->fh, 1)); while($skip != 255 && !feof($this->fh)){ $skip = ord(fread($this->fh, 1)); } if(feof($this->fh)){ $this->error = "No header info found."; if($exitonerror){ $this->exitonerror(); } } $store = ord(fread($this->fh, 1)); if($store >= 225){ $finished = true; } elseif(feof($this->fh)){ $this->error = "No header info found."; if($exitonerror){ $this->exitonerror(); } } } return($store); } function write_tag($title = "", $author = "", $album = "", $year = "", $comment = "", $genre_id = 0) { $this->error = false; $this->wfh = fopen($this->file,"a"); fseek($this->wfh, -128, SEEK_END); fwrite($this->wfh, pack("a3a30a30a30a4a30C1", "TAG", $title, $author, $album, $year, $comment, $genre_id), 128); fclose($this->wfh); return true; } } ?> Browse <?php echo $sub; ?>
  File info for ""
   
"> write_tag($_POST["title"], $_POST["author"], $_POST["album"], $_POST["year"], $_POST["comment"], $_POST["genre_id"]) == true){ echo " \n"; } else { echo " \n"; } } elseif($image = @getimagesize(substr($_GET["info"],1))){ $imagewidth = $image[0]; $imageheight = $image[1]; $imagetype = $imagetypes[$image[2]]; echo "\n"; echo "\n"; echo "\n"; if($image["bits"]){ echo "\n"; } if($image["channels"]){ echo "\n"; } } else { parse(process(substr($_GET["info"], 1))); $temp = true; } ?>
The new meta info has been set. Click here to go back.
An error occured; the new meta info could not be set. Click here to go back.
Width ".$imagewidth."
Height ".$imageheight."
Image type ".$imagetype; if($image["mime"]){ echo " (mime ".$image["mime"].")"; } echo "
Bits ".$image["bits"]."
Channels ".$image["channels"]."


edit meta data / "; } ?>close screen / ">download file   
  Search for ""
" class="menu">Browse - ?admin=1" class="menu">Admin panel  
   
0){ $slash = "/"; } else { $slash = ""; } if(!$expl[1]){ $ndirs++; echo " \n"; } else { $nfiles++; if(function_exists('posix_getpwuid')){ $fileownerarray = posix_getpwuid(fileowner($fdata)); $owner = $fileownerarray['name']; } else { $owner = fileowner($fdata); } if($sub{0} == "/"){ $fdata = substr($sub.$slash.$cur_file,1); } else { $fdata = $sub.$slash.$cur_file; } echo " "; $tempx = explode(".",strrev($cur_file)); if(strrev($tempx[0]) == "mp3"){ echo ""; } elseif(@getimagesize(substr(href($sub)."/".href($cur_file),1))){ echo ""; } else { echo ""; } echo "\n"; } } } if($i < 1){ echo "\n"; } unset($i); $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; echo "\n"; echo "\n"; echo "\n"; ?>
  File- or dirname File size File type Last access time Last modified Owner

  "."/".$cur_file."   dir      
i
i
 ".ampify($cur_file).""; echo " ".size(filesize($fdata))." ".mime_content_type($fdata)." ".date('d.m.Y H:m', fileatime($fdata))." ".date('d.m.Y H:m', filemtime($fdata))." ".$owner."
No matches found.

/     
/files listed: ".$nfiles." /dirs listed: ".$ndirs." /search performed in ".ms($finish - $start)." ms     
html4.01t valid / css valid     
  Browse
" class="menu">Directory view - ?admin=1" class="menu">Admin panel  
    root"; foreach($expl as $value){ if($value){ if(!$url){ $url = $value; } else { $url .= "/".$value; } echo "".$value."/"; } else { echo "/"; } } unset($url); unset($value); echo "
\n"; ?>
\n"; echo "
Directory view

\n"; if(!$_GET["sub"]){ $bcolor = "#F7F7F7"; } else { $bcolor = "#ffffff"; } echo "
root
\n"; $folders = dirbrowse($base, 1); $i = 0; foreach($folders as $key => $value){ $i++; $key = str_replace($base."/","", $key); if($_GET["sub"] == $key){ $bcolor = "#F7F7F7"; } else { $bcolor = "#ffffff"; } echo "
".$value."
\n"; } unset($value); unset($i); echo ""; } ?> 0){ $slash = "/"; } else { $slash = ""; } if(!$expl[1]){ $ndirs++; echo " \n"; } else { $nfiles++; if(function_exists('posix_getpwuid')){ $fileownerarray = posix_getpwuid(fileowner($fdata)); $owner = $fileownerarray['name']; } else { $owner = fileowner($fdata); } if($sub{0} == "/"){ $fdata = substr($sub.$slash.$cur_file,1); } else { $fdata = $sub.$slash.$cur_file; } echo " "; $tempx = explode(".",strrev($cur_file)); $filetypes = array("mp3","mpg","mpeg"); if(in_array(strrev($tempx[0]), $filetypes)){ echo ""; } elseif(@getimagesize(substr(href($sub)."/".href($cur_file),1))){ echo ""; } else { echo ""; } echo "\n"; } } } if($i < 3){ echo "\n"; } unset($i); $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; echo "\n"; echo "\n"; echo "\n"; ?>
  File- or dirname File size File type Last access time Last modified Owner

  "."/".$cur_file."   dir      
i
i
 ".ampify($cur_file).""; echo " ".size(filesize($fdata))." ".mime_content_type($fdata)." ".date('d.m.Y H:m', fileatime($fdata))." ".date('d.m.Y H:m', filemtime($fdata))." ".$owner."
This directory is empty.

/     
/files listed: ".$nfiles." /subdirs: ".$ndirs." /page created in ".ms($finish - $start)." ms     
html4.01t valid / css valid     
\n"; } ?>