X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=a17d7a30a1565b8d6eaa57e28137d8adc5d03fec;hb=e6edcf4245cbb38ffcaac57e33c5532155567428;hp=8fa325a20ec0abfd4ffeb306a6a4af10530f3de9;hpb=6dcce3ff29b18382ab0a8bb71eaf85ffbadacb01;p=mirrors%2FJukeBox.git diff --git a/index.php b/index.php index 8fa325a..a17d7a3 100755 --- a/index.php +++ b/index.php @@ -18,7 +18,8 @@ Version info: //Config-basic $title = 'Harvie\'s JuKe!Box'; //Title of jukebox -$music_dir = './music'; //Local path to directory with music +$music_dir = 'music'; //Local path to directory with music +$base_url = preg_replace('/[^\/]*$/', '', $_SERVER['SCRIPT_NAME']); //URL of this directory (always ends with slash) $music_dir_url = 'http://your-server.net/jukebox/music'; //URL path to the same directory $cache_passwd = 'renew123'; //You need this passwd to refresh search cache $sort = 3; //Sort? 0 = none, 1 = playlists, 2 = 1+listings; 3 = 2+search-EXPERIMENTAL! (sorting could eat lot of memory) @@ -35,11 +36,11 @@ $default_random_count = 30; //How many random songs by defaul? //External files $indexlist = array('index.html', 'index.txt'); //Search for this file in each directory -$bonus_dir = './jbx'; //Misc. files directory +$bonus_dir = 'jbx'; //Misc. files directory //// $search_cache = $bonus_dir.'/cache.db'; //Database for searching music (php +rw) - .htaccess: Deny from all!!! -$css_file = $bonus_dir.'/themes/default/jukebox.css'; //CSS (Design) -$favicon_file = './favicon.png'; //favicon +$css_file = $base_url.$bonus_dir.'/themes/default/jukebox.css'; //CSS (Design) +$favicon_file = $base_url.'favicon.png'; //favicon $header_file = $bonus_dir.'/header.html'; //header file $footer_file = $bonus_dir.'/footer.html'; //footer file @@ -76,6 +77,7 @@ if(get_magic_quotes_gpc()) die("Error: magic_quotes_gpc needs to be disabled!\n" $useflash = is_file($flash_player_swf); //Little magic with directories ;o) +if($_SERVER['PATH_INFO']!='') $_GET['dir']=$_SERVER['PATH_INFO']; $current_dir = ereg_replace('/+', '/', '/'.$_GET['dir'].'/'); if(eregi('(/|\\\\)\\.\\.(/|\\\\)', $current_dir)) { //check for directory traversal ;) header('Location: ?'); @@ -202,8 +204,8 @@ function render_file_line($dir, $item, $dir_url, $index, $filesize, $parent = fa '" target="'.$GLOBALS['flash_player_frame'].'" class="icon ifplay">F/'. 'S'); } - echo(' '.unxss(str_replace('-',' - ',str_replace('_', ' ', -$item))).''.$filesize." MiB \n"); + echo(' '.unxss(str_replace('-',' - ',str_replace('_', ' ', $item))). + ''.$filesize." MiB \n"); } function render_dir_line($current_dir, $item, $i) { @@ -213,7 +215,7 @@ function render_dir_line($current_dir, $item, $i) { ''.$i.'P/'. 'R'); if($GLOBALS['useflash']) echo('/F'); - echo('[DIR] '.unxss(str_replace('_', ' ', $item)). + echo('[DIR] '.unxss(str_replace('-',' - ',str_replace('_', ' ', $item))). "\n"); } @@ -279,7 +281,7 @@ function flash_mp3_player() { <?php echo "DJ MODE @ $title"; ?> - + + @@ -348,7 +352,8 @@ if(isset($_GET['blank'])) { < BACK - | HOME () + | HOME () + | DJ | ABOUT/HELP | LOGOUT