'http://google.com/search?q=', 'Images' => 'http://google.com/images?q=', 'Karaoke-Lyrics.net' => 'http://www.karaoke-lyrics.net/index.php?page=find&q=', 'Jyxo.cz multimedia' => 'http://jyxo.cz/s?d=mm&q=', 'Centrum.cz mp3' => 'http://search.centrum.cz/index.php?sec=mp3&q=', 'YOUTube.com' => 'http://youtube.com/results?search_query=' ); //Flash MusicPlayer (info about settings: http://wpaudioplayer.com/standalone) $flash_player_swf = $bonus_dir.'/player.swf'; //path to musicplayer $flash_player_frame = 'playframe-show'; //FlashPlayer Target (playframe-show|playframe-hide) - usefull for compatibility with old music player $flash_player_options = '?bg=000099&loader=000000&tracker=AAAAFF&skip=FFFFFF' //.'&leftbg=000077&rightbg=000077&righticon=999999' .'&autostart=yes&initialvolume=100&soundFile='; //& arguments (urlencoded song url will be added) //Security error_reporting(0); //This will disable error reporting, wich can pass sensitive data to users //External configuration file (overrides index.php configuration) @include('./_config.php'); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Init srand(time()); @ini_set('magic_quotes_gpc' , 'off'); if(get_magic_quotes_gpc()) die("Error: magic_quotes_gpc needs to be disabled!\n"); //Enable flash? $useflash = is_file($flash_player_swf); //Little magic with directories ;o) $current_dir = ereg_replace('/+', '/', '/'.$_GET['dir'].'/'); if(eregi('(/|\\\\)\\.\\.(/|\\\\)', $current_dir)) { //check for directory traversal ;) header('Location: ?'); die('Error - directory not found!'); } $dir = $music_dir.$current_dir; $url = $music_dir_url.$current_dir; $parent_dir = dirname($current_dir); //FCs function serve_download($filename) { header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Pragma: no-cache'); //header('Content-Type: application/force-download'); header('Content-Type: audio/x-mpegurl'); header("Content-Disposition: attachment; filename={$filename}"); header('Content-Transfer-Encoding: binary'); header('X-PHP-Application: Harvie\'s JuKe!Box'); } $nchars_f = array('Á','Ä','Č','Ç','Ď','É','Ě','Ë','Í','Ň','Ó','Ö','Ř','Š','Ť','Ú','Ů','Ü','Ý','Ž','á','ä','č','ç','ď','é','ě','ë','í','ň','ó','ö','ř','š','ť','ú','ů','ü','ý','ž'); $nchars_t = array('A','A','C','C','D','E','E','E','I','N','O','O','R','S','T','U','U','U','Y','Z','a','a','c','c','d','e','e','e','i','n','o','o','r','s','t','u','u','u','y','z'); function unational($text) { if(!$GLOBALS['national_characters']) return $text; return(str_replace($GLOBALS['nchars_f'], $GLOBALS['nchars_t'], $text)); } function generate_m3u($dir, $prefix='', $recursive=0, $nl="\r\n", $doubleenc=0) { $dir = $dir . '/'; if(isset($_GET['newline'])) $nl = $_GET['newline']; if(!isset($_GET['search'])) { $dd = opendir($dir); while(($item = readdir($dd)) != false) { if($item == '.' || $item == '..') continue; if( is_file($dir.$item) && eregi(('\.('.$GLOBALS['m3u_exts'].')$'), $item) ) { if($GLOBALS['sort'] > 0) { $temp[] = $item; } else { $item=($prefix.'/'.str_replace('%2F', '/', (rawurlencode($dir.$item))).$nl); if($doubleenc) $item = rawurlencode($item); echo($item); } } if($recursive && is_dir($dir.$item)) { generate_m3u($dir.$item, $prefix, $recursive, $nl, $doubleenc); } } } else { if(!($searchfp = fopen($GLOBALS['search_cache'], 'r'))) die("Cannot read cache from $outfile
Refresh cache or set permissions properly!
\n"); while(!feof($searchfp)) { $line = trim(fgets($searchfp)); if(@eregi(str_replace(' ', '(.*)', unational($_GET['search'])), unational($line))) { $line=(dirname($GLOBALS['music_dir_url']).'/'.str_replace('%2F', '/', (rawurlencode($line))).$nl); if($doubleenc) $line = rawurlencode($line); echo($line); } } } if($GLOBALS['sort'] > 0) { @sort($temp); foreach($temp as $item) { $temp=($prefix.'/'.str_replace('%2F', '/', (rawurlencode($dir.$item))).$nl); if($doubleenc) $temp = rawurlencode($temp); echo($temp); } } } function write_search_cache($dir, $outfp) { $dir = $dir . '/'; $dd = opendir($dir); while($item = readdir($dd)) { if($item == '.' || $item == '..') continue; if( is_file($dir.$item) && eregi(('\.('.$GLOBALS['m3u_exts'].')$'), $item) ) { fwrite($outfp, $dir.$item."\n"); } if(is_dir($dir.$item)) { write_search_cache($dir.$item, $outfp); } } } function generate_search_cache($dir, $outfile) { echo("Generating search cache. Please wait...
\n"); flush(); @chmod($outfile, 0755); //At least i tryed ;D if(!($outfp = fopen($outfile, 'w'))) die("Cannot write cache to $outfile
You probably haven't set the permissions properly!
\n"); write_search_cache($dir, $outfp); fclose($outfp); $osize = filesize($outfile); clearstatcache(); if($GLOBALS['sort'] > 2) { echo("Sorting search cache. Please wait...
\n"); flush(); $items = file($outfile); @sort($items); $total = ' ('.sizeof($items).' files)'; file_put_contents($outfile, @implode('', $items)); unset($items); if(abs(filesize($outfile)-$osize) > 2) die('ERROR! Please disable sorting of search cache ($sort < 3)
'."\nSorted only ". filesize($outfile).' of '.$osize.' bytes!!!\n'); } echo('Total: '.filesize($outfile).' of '.$osize.' bytes'.$total.' DONE!'.'
'."\n"); } function render_file_line($dir, $item, $dir_url, $index, $filesize, $parent = false) { $parclass=($index%2?'even':'odd'); $parcolor=($index%2?'lightblue':'white'); $temp=str_replace('&', '%26', dirname($dir_url)).'/'.str_replace('%2F', '/', (rawurlencode($dir.$item))); if(is_numeric($filesize)) $filesize = round($filesize/(1024*1024), 2); echo("".''.$index.''); echo('P'); if($parent) { echo('/D'); } if($GLOBALS['useflash'] && eregi(('\.('.$GLOBALS['m3u_exts'].')$'), $item)) { echo('/F/'. 'S'); } echo(' '.unxss(str_replace('-',' - ',str_replace('_', ' ', $item))).''.$filesize." MiB \n"); } function render_dir_line($current_dir, $item, $i) { $parclass=($i%2?'even':'odd'); $parcolor=($i%2?'lightblue':'white'); $temp=str_replace('%2F', '/', rawurlencode($current_dir)).rawurlencode($item); echo("". ''.$i.'P/'. 'R'); if($GLOBALS['useflash']) echo('/F'); echo('[DIR] '.unxss(str_replace('_', ' ', $item)). "\n"); } function render_tr_playframe_show() { if($GLOBALS['flash_player_frame'] == 'playframe-show' && $GLOBALS['useflash']) { ?> S Harvie free of charge! Of course...', 'Don\'t be looser, use GNU/Linux! ;P', 'Make love and not war!', 'Take your chance! Prove yourself!', 'This software is free of charge. If you wan\'t to donate, please send some money to children in Africa/etc...' ); echo(''.$quotes[rand(0,sizeof($quotes)-1)]."\n"); echo('Page was generated in '.(round(microtime(true), 3) - $GLOBALS['exec_time']).' seconds'); @readfile($GLOBALS['footer_file']); echo(''); } function unxss($string) { return htmlspecialchars($string); } function explode_path($dir) { $dir = substr($dir, strlen($GLOBALS['music_dir'])+1); $temp = split('/', ereg_replace('/+', '/', $dir)); $out = ''; for($j=sizeof($temp)-1;$j>0;$j--) { $dir = ''; for($i=0;$i<(sizeof($temp)-$j);$i++) { $dir.=$temp[$i].'/'; } $out.=''.unxss($temp[$i-1]).'/'; } return('./'.$out); } function flash_mp3_player() { ?> <?=$GLOBALS['title']?>: Flash Music Player Plugin You need Adobe Flash enabled browser to play records directly in website. Refresh cache or set permissions properly!
\n"); while(!feof($searchfp)) { fgets($searchfp); $flen++; } for($i=0; $i<$_GET['random']; $i++) { rewind($searchfp); for($j=0; $j
Music player (click 'F' link next to the song name to start, 'S' to stop...)
< BACK | HOME () | ABOUT/HELP | LOGOUT

About/Help

'.$title.': '.unxss($dir).''); echo('

'.$title.'

Index of: '.explode_path($dir).'

'); } else { echo(''.$title.': '.unxss($_GET['search']).''); echo('

'.$title.'

Searching for: '.unxss($_GET['search']).'

'); ?>
'); } else { ?>
 

$search_link) { if(!$search_prefix) { echo(unxss($_GET['search'])." @\n"); $search_prefix = 1; } echo(''.$search_desc.";\n"); } ?>

Search DB size: '.(filesize($search_cache)/1024)." kB
\n"); if(!($searchfp = fopen($search_cache, 'r'))) die("Cannot read cache from $outfile
Refresh cache or set permissions properly!
\n"); $i = 0; echo(''); render_tr_playframe_show(); echo(''); while(!feof($searchfp)) { $line = trim(fgets($searchfp)); $parclass=($i%2?'even':'odd'); $parcolor=($i%2?'lightblue':'white'); if(@eregi(str_replace(' ', '(.*)', unational($_GET['search'])), unational($line))) { $i++; $filesize = 0; if($i <= $access_limit) $filesize = filesize($line); else $filesize = 'n/a'; render_file_line('', $line, $music_dir_url, $i, $filesize, true); } } echo('
SP'); if($GLOBALS['useflash']) echo('/F'); echo('Search: '.unxss($_GET['search']).'
Total: '.$i.' results...
'); render_footer(); die(); } @readfile($header_file); foreach($indexlist as $index) @readfile($dir.$index); ?>
1) { if(is_file($dir.$item)) { $i--; $itemsf[] = $item; } if(is_dir($dir.$item)) { $i--; $itemsd[] = $item; } } else { if(is_file($dir.$item)) { render_file_line($dir, $item, $music_dir_url, $i, filesize($dir.$item)); } if(is_dir($dir.$item)) { render_dir_line($current_dir, $item, $i); } } } rewinddir($dd); } if($sort > 1) { @sort($itemsf); @sort($itemsd); foreach($itemsd as $item) { $i++; render_dir_line($current_dir, $item, $i); } foreach($itemsf as $item) { $i++; render_file_line($dir, $item, $music_dir_url, $i, filesize($dir.$item)); } } ?>
> P/RF'); ?>
^ [DIR] .. ()