From 0e21eaf873df1518bded5cebea58410215933960 Mon Sep 17 00:00:00 2001 From: Harvie Date: Fri, 29 Oct 2010 20:09:41 +0200 Subject: [PATCH] $base_url now should always have slash at the end --- example_config.php | 3 +-- index.php | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/example_config.php b/example_config.php index 2de765b..5956ab0 100755 --- a/example_config.php +++ b/example_config.php @@ -12,7 +12,6 @@ //Config-basic $title = 'Harvie\'s JuKe!Box'; //Title of jukebox $music_dir = 'music'; //Local path to directory with music -$base_url = dirname($_SERVER['SCRIPT_NAME']); //URL of this directory ("./") $music_dir_url = 'http://your-server.net/jukebox/music'; //URL path to the same directory CHANGE IT! $cache_passwd = 'renew123'; //You need this passwd to refresh search cache CHANGE IT! //Login @@ -29,5 +28,5 @@ $search_engines = array_merge($search_engines, array( */ //Bonuses if(isset($bonus_dir) && is_dir($bonus_dir)) { - $css_file = $base_url.'/'.$bonus_dir.'/themes/default/jukebox.css'; //CSS (Design/Theme) + $css_file = $base_url.$bonus_dir.'/themes/default/jukebox.css'; //CSS (Design/Theme) } diff --git a/index.php b/index.php index 92a0507..40b7db3 100755 --- a/index.php +++ b/index.php @@ -19,7 +19,7 @@ Version info: //Config-basic $title = 'Harvie\'s JuKe!Box'; //Title of jukebox $music_dir = 'music'; //Local path to directory with music -$base_url = dirname($_SERVER['SCRIPT_NAME']); //URL of this directory ("./") +$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) @@ -39,8 +39,8 @@ $indexlist = array('index.html', 'index.txt'); //Search for this file in each $bonus_dir = 'jbx'; //Misc. files directory //// $search_cache = $bonus_dir.'/cache.db'; //Database for searching music (php +rw) - .htaccess: Deny from all!!! -$css_file = $base_url.'/'.$bonus_dir.'/themes/default/jukebox.css'; //CSS (Design) -$favicon_file = $base_url.'/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 @@ -281,7 +281,7 @@ function flash_mp3_player() {