added search icon and fixed issue with border-radius of html and body
[mirrors/JukeBox.git] / index.php
index 91b2afb7de3b3a1c0ddaeccbdf31ffdbdcc932bc..d345f39d958bee3607b806e2a584d1745f548e23 100755 (executable)
--- 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
@@ -204,8 +205,8 @@ function render_file_line($dir, $item, $dir_url, $index, $filesize, $parent = fa
        echo('&nbsp;</td><td><a href="'.$temp.'">'.unxss(str_replace('_', ' ', $item)).'</a></td><td>'.$filesize."&nbsp;MiB&nbsp;</td></tr>\n");                        
 }
 
-function render_dir_line($item, $i) {
-       $parclass=($i%2?'even':'odd'); $parcolor=($index%2?'lightblue':'white');
+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("<tr class=\"$parclass directory\" bgcolor=\"$parcolor\">".
        '<td><a href="#up">'.$i.'</a></td><td class="btntd"><a href="?download&playlist&dir='.$temp.'" class="icon iplay">P</a>/'.
@@ -374,11 +375,13 @@ if(!isset($_GET['search'])) {
 <span style="float: right;">
        <form action="?" method="GET" align="right" style="display: inline;">
                <input type="hidden" name="download" value="" />
-               <input type="number" name="random" value="<?=$default_random_count?>" />
+               <input type="number" min="1" name="random" value="<?=$default_random_count?>" style="width:4em;" title="how many randomly selected tracks should be in 
+playlist?" 
+/>
                <input type="submit" value="random" title="Generate random music playlist..." />
        </form>
        <form action="?" method="GET" align="right" style="display: inline;">
-               <input type="search" name="search" autofocus placeholder="search regexp..."
+               <span class="icon isearch"></span><input type="search" name="search" autofocus placeholder="search regexp..."
                        title="Search in music/google/lyrics/mp3/youtube; Hint: You can use regular expressions in search query..."
                        value="<?=unxss($_GET['search'])?>"
                />
@@ -393,7 +396,7 @@ if(!isset($_GET['search'])) {
 ?>
 <span style="float: right;">
        <form action="?" method="POST" align="right">
-               <input type="password" name="cache-refresh" value="" title="Password for refreshing - good for avoiding DoS Attacks!!!" />
+               <input type="password" name="cache-refresh" value="" style="width:5em;" title="Password for refreshing - good for avoiding DoS Attacks!!!" />
                <input type="submit" value="refresh cache" title="You should refresh cache each time when you add new music or upgrade to newer version of JuKe!Box !!!" />
        &nbsp;
        </form>
@@ -476,7 +479,7 @@ for($s=2;$s;$s--) { while(($item = readdir($dd)) != false) {
                        render_file_line($dir, $item, $music_dir_url, $i, filesize($dir.$item));
                }
                if(is_dir($dir.$item)) {
-                       render_dir_line($item, $i);
+                       render_dir_line($current_dir, $item, $i);
                }
        }
 } rewinddir($dd); }
@@ -486,7 +489,7 @@ if($sort > 1) {
        @sort($itemsd);
        foreach($itemsd as $item) {
                $i++;
-               render_dir_line($item, $i);
+               render_dir_line($current_dir, $item, $i);
        }
        foreach($itemsf as $item) {
                $i++;
This page took 0.149241 seconds and 4 git commands to generate.