X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=index.php;h=7ef93890dbfe0a3ca884311073ca70c736776220;hb=de30f73122c2806154388a5ead6bcd9d39e80eb8;hp=a1c866a5fb8a772de4943198f802a7bd39f636fe;hpb=ec0f3a4dccdc96268614d77fe15fa82f3d9463fc;p=mirrors%2FJukeBox.git diff --git a/index.php b/index.php index a1c866a..7ef9389 100755 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@ Harvie's JuKe!Box ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Version info: + * 0.3.6 - Now sorting also directories and have icon link support in css * 0.3.5 - Fixed security bug - directory traversal in filelisting (upgrade recommended) * 0.3.4 - Generating playlist for flashplayer, searching for bugs, cleaning code and preparing for new version release * 0.3.3 - Shorter URLs for flashplayer (due to discussion at #skola ;o), nicer national characters handling @@ -11,7 +12,7 @@ Version info: * 0.3 - Migrated to standalone WPAudioPlayer (better, nicer, with more functions) * 0.2 - Few new functions (search playlist, random,...) * 0.1.1 - Few little fixups, written help.html in Czech language ;o) - * 0.1 - All functions works - TODO: bugfix & replace ugly code + * 0.1 - All functions are working - TODO: bugfix & replace ugly code ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */ @@ -201,20 +202,32 @@ 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('_', ' ', $item)).''.$filesize." MiB \n"); + 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 +S '.$GLOBALS['title'].' on GIThub :-)Fork me on GitHub' ); echo(''.$quotes[rand(0,sizeof($quotes)-1)]."\n"); @@ -330,11 +344,11 @@ if(isset($_GET['blank'])) { -
+
- + < BACK - | HOME () + | HOME () | ABOUT/HELP | LOGOUT
@@ -363,11 +377,13 @@ if(!isset($_GET['search'])) {
- +
- @@ -382,7 +398,7 @@ if(!isset($_GET['search'])) { ?> - +   @@ -409,8 +425,8 @@ if(!($searchfp = fopen($search_cache, 'r'))) $i = 0; echo(''); render_tr_playframe_show(); -echo(''); while(!feof($searchfp)) { @@ -434,12 +450,14 @@ foreach($indexlist as $index) @readfile($dir.$index); - - + 1) { if(is_file($dir.$item)) { - if($sort > 1) { - $i--; - $items[] = $item; - } else { - render_file_line($dir, $item, $music_dir_url, $i, filesize($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)) { - $temp=str_replace('%2F', '/', rawurlencode($current_dir)).rawurlencode($item); - echo("". - '\n"); + render_dir_line($current_dir, $item, $i); } + } } rewinddir($dd); } + if($sort > 1) { - @sort($items); - foreach($items as $item) { + @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)); }
SP'); -if($GLOBALS['useflash']) echo('/F'); +echo('
SP'); +if($GLOBALS['useflash']) echo('/F'); echo('Search: '.unxss($_GET['search']).'
>P/RF'); ?> +P/RF'); ?>
^ [DIR] .. ()
^ [DIR] .. +()
'.$i.'P/'. - 'R'); - if($GLOBALS['useflash']) echo('/F'); - echo('[DIR] '.unxss(str_replace('_', ' ', $item))."