initial commit - version 2.0 + README added 2.0
authorHarvie <tomas@mudrunka.cz>
Mon, 24 May 2010 02:22:47 +0000 (04:22 +0200)
committerHarvie <tomas@mudrunka.cz>
Mon, 24 May 2010 02:22:47 +0000 (04:22 +0200)
17 files changed:
README [new file with mode: 0644]
http_auth.php [new file with mode: 0755]
index.php [new file with mode: 0755]
jukebox-bonus/.htaccess [new file with mode: 0755]
jukebox-bonus/acorner.gif [new file with mode: 0755]
jukebox-bonus/autoplay.png [new file with mode: 0755]
jukebox-bonus/cache.db [new file with mode: 0755]
jukebox-bonus/copying [new file with mode: 0755]
jukebox-bonus/corner.gif [new file with mode: 0755]
jukebox-bonus/footer.html [new file with mode: 0755]
jukebox-bonus/header.html [new file with mode: 0755]
jukebox-bonus/help.html [new file with mode: 0755]
jukebox-bonus/jukebox.css [new file with mode: 0755]
jukebox-bonus/musicplayer.swf [new file with mode: 0755]
music/PUT-YOUR-MUSIC-HERE [new file with mode: 0755]
music/example-of-subdirectory/index.html [new file with mode: 0755]
music/index.html [new file with mode: 0755]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..0134329
--- /dev/null
+++ b/README
@@ -0,0 +1,9 @@
+This web application allows you to browse, share, download and stream music using webserver with PHP and flashplayer or external audio player (WMP, Audacious, Winamp, Totem, etc...).
+
+Tato webová aplikace vám umožní procházet, sdílet, stahovat a streamovat hudbu pomocí webserveru s podporou PHP a flashplayeru, nebo externího přehrávače (WMP, Audacious, Winamp, Totem, apod...).
+
+Basicaly it's easy to use, easy to install, fully configurable and it looks like this:
+
+Zjednodušeně je aplikace lehce použitelná, lehce se instaluje, vše se dá nastavit a vypadá takto:
+
+http://img218.imageshack.us/img218/2669/jukeboxscreen3.png
diff --git a/http_auth.php b/http_auth.php
new file mode 100755 (executable)
index 0000000..3a6e120
--- /dev/null
@@ -0,0 +1 @@
+<?php\r//Harvie's PHP HTTP-Auth script (2oo7)\r//CopyLefted4U ;)\r///SETTINGS//////////////////////////////////////////////////////////////////////////////////////////////////////\r//Login\r$realm = 'music'; //This is used by browser to identify protected area and saving passwords (one_site+one_realm==one_user+one_password)\r$user = 'music'; //User\r$passwd = 'music'; //Password\r//Misc\r$require_login = true; //Require login? (if false, no login needed) - WARNING!!!\r$location = '401'; //Location after logout - 401 = default logout page (can be overridden by ?logout=[LOCATION])\r//CopyLeft\r$ver = '2oo7-3.8';\r$link = '<a href="https://harvie.ath.cx/">harvie.ath.cx</a>';\r$banner = "Harvie's PHP HTTP-Auth script (v$ver)";\r$hbanner = "<hr /><i>$banner\n-\n$link</i>\n";\r$cbanner = "<!-- $banner -->\n";\r/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r//MANUAL/////////////////////////////////////////////////////////////////////////////////////////////////////////\r/* HOWTO\r * To each file, you want to lock add this line (at begin of first line - Header-safe):\r * <?php require_once('http_auth.php'); ?> //Password Protection 8')\r * Protected file have to be php script (if it's html, simply rename it to .php)\r * Server needs to have PHP as module (not CGI).\r * You need HTTP Basic auth enabled on server and php.\r */\r/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r////CODE/////////////////////////////////////////////////////////////////////////////////////////////////////////\r  function send_auth_headers($realm='') {\r    Header('WWW-Authenticate: Basic realm="'.$realm.'"');\r    Header('HTTP/1.0 401 Unauthorized');\r  }\r  \r  function check_auth($PHP_AUTH_USER, $PHP_AUTH_PW) { //Check if login is succesfull (U can modify this to use DB, or anything else)\r    return (($PHP_AUTH_USER == $GLOBALS['user']) && ($PHP_AUTH_PW == $GLOBALS['passwd']));\r  }\r    \r  function unauth() { //Do this when login fails\r    $cbanner = $GLOBALS['cbanner'];\r    $hbanner = $GLOBALS['hbanner'];\r    die("$cbanner<title>401 - Forbidden</title>\n<h1>401 - Forbidden</h1>\n<a href=\"?\">Login...</a>\n$hbanner"); //Show warning and die\r    die(); //Don't forget!!!\r  }\r\r//Back-Compatibility\rif(isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_PW'] != '') $PHP_AUTH_USER = $_SERVER['PHP_AUTH_USER'];\rif(isset($_SERVER['PHP_AUTH_PW']) && $_SERVER['PHP_AUTH_PW'] != '') $PHP_AUTH_PW = $_SERVER['PHP_AUTH_PW'];\r\r//Logout\rif(isset($_GET['logout'])) { //script.php?logout\r  if(isset($PHP_AUTH_USER) || isset($PHP_AUTH_PW)) {\r    Header('WWW-Authenticate: Basic realm="'.$realm.'"');\r    Header('HTTP/1.0 401 Unauthorized');\r  } else {\r    if($_GET['logout'] != '') $location = $_GET['logout'];\r    if(trim($location) != '401') Header('Location: '.$location);\r    die("$cbanner<title>401 - Log out successfull</title>\n<h1>401 - Log out successfull</h1>\n<a href=\"?\">Continue...</a>\n$hbanner");\r  }\r}\r\rif($require_login) {\r  if(!isset($PHP_AUTH_USER)) { //Storno or first visit of page\r    send_auth_headers($realm);\r    unauth();\r  } else { //Login sent\r    \r    if (check_auth($PHP_AUTH_USER, $PHP_AUTH_PW)) { //Login succesfull - probably do nothing\r    } else { //Bad login\r      send_auth_headers($realm);\r      unauth();\r    }\r    \r  }\r}\r//Rest of file will be displayed only if login is correct\r\r
diff --git a/index.php b/index.php
new file mode 100755 (executable)
index 0000000..2e1b5b1
--- /dev/null
+++ b/index.php
@@ -0,0 +1,334 @@
+<?php require_once('./http_auth.php'); /*Delete this line to disable password protection*/ ?>
+<?php /*
+Harvie's JuKe!Box
+///////////////////////////////////////////////////////////////////////
+Version info:
+ 0.2   - Few new functions (search playlist, random,...)
+ 0.1.1 - Few little fixups, written help.html in Czech language ;D
+ 0.1   - All functions works - TODO: bugfix & replace ugly code
+///////////////////////////////////////////////////////////////////////
+*/
+
+//Config-basic
+$title =               'Harvie\'s&nbsp;JuKe!Box'; //Title of jukebox
+$music_dir =           './music'; //Local path to directory with music
+$music_dir_url =       'http://192.168.2.163/pub/m3gen/music'; //URL path to same directory
+//$music_dir_url =     'http://music.harvie.cz/music';
+//$music_dir_url =     'http://softz.harvie.cz/jukebox/demo/music';
+$cache_passwd =        'reload'; //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)
+$access_limit =                20; //How many files could be accessed without using cache (while searching)
+
+//Playlist settings
+$playlist_name =       'playlist.m3u'; //Name of downloaded pl
+$m3u_exts =            'ogg|mp[0-9]|wma|wmv|wav'; //Allow only these files
+$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 =           './jukebox-bonus'; //Misc. files directory
+$search_cache =        $bonus_dir.'/cache.db'; //Database for searching music (php +rw) - .htaccess: Deny from all!!!
+$flash_player =                $bonus_dir.'/musicplayer.swf'; //path to musicplayer
+$css_file =            $bonus_dir.'/jukebox.css'; //CSS
+$header_file =         $bonus_dir.'/header.html'; //header file
+$footer_file =         $bonus_dir.'/footer.html'; //footer file
+
+//Security
+error_reporting(0);
+
+//Init
+srand(time());
+$current_dir = ereg_replace('/+', '/', '/'.$_GET['dir'].'/');
+$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');
+}
+
+function generate_m3u($dir, $prefix='', $recursive=0) {
+       $dir = $dir . '/';
+       $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 {
+                               echo($prefix.'/'.str_replace('%2F', '/', (rawurlencode($dir.$item)))."\r\n");
+                       }
+               }
+                if($recursive && is_dir($dir.$item)) {
+                       generate_m3u($dir.$item, $prefix);
+                }
+       }
+       if($GLOBALS['sort'] > 0) {
+               @sort($temp);
+               foreach($temp as $item)
+                       echo($prefix.'/'.str_replace('%2F', '/', (rawurlencode($dir.$item)))."\r\n");
+       }
+}
+
+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...<br />\n"); flush();
+       @chmod($outfile, 0755); //At least i tryed ;D
+       if(!($outfp = fopen($outfile, 'w')))
+               die("Cannot write cache to $outfile<br />You probably haven't set the permissions properly!<br />\n");
+       write_search_cache($dir, $outfp);
+       fclose($outfp);
+       $osize = filesize($outfile); clearstatcache();
+       if($GLOBALS['sort'] > 2) {
+               echo("Sorting search cache. Please wait...<br />\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)<br />'."\nSorted only ".
+                       filesize($outfile).' of '.$osize.' bytes!!!\n');
+       }
+       echo('Total: '.filesize($outfile).' of '.$osize.' bytes'.$total.' <a href="?">DONE!</a>'.'<br /><META http-equiv="refresh" content="2;URL=?">'."\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("<tr class=\"$parclass\" bgcolor=\"$parcolor\">".'<td>'.$index.'</td><td>');
+       echo('<a href="?download&song='.rawurlencode($temp).'">P</a>');
+       if($parent) {
+               echo('/<a href="?dir='.
+                       substr(str_replace(array('&','%2F'), array('%26','/'), (rawurlencode(dirname($dir.$item)))), strlen($GLOBALS['music_dir'])).
+                       '">D</a>');
+       }
+       if(is_file($GLOBALS['flash_player']) && eregi(('\.('.$GLOBALS['m3u_exts'].')$'), $item)) {
+               /*echo('/<object type="application/x-shockwave-flash" width=17 height=17  data="'.
+               $GLOBALS['flash_player'].'?song_url='.rawurlencode($temp).'"></object>');*/
+               echo('/<a href="'.$GLOBALS['flash_player'].'?autoplay=true&song_url='.rawurlencode($temp).'" target="playframe">F</a>/'.
+               '<a href="about:blank" target="playframe">S</a>');
+       }
+       echo('&nbsp;</td><td><a href="'.$temp.'">'.str_replace('_', ' ', $item).'</a></td><td>'.$filesize."&nbsp;MiB&nbsp;</td></tr>\n");                       
+}
+
+function unxss($string) {
+       return str_replace(
+               array('&', '"', '\'', '<', '>'),
+               array('&amp;', '&quot;', '&#039;', '&lt;', '&gt;'),
+               $string);
+}
+
+//GET
+if(isset($_GET['download'])) serve_download($playlist_name);
+if(isset($_GET['song'])) die($_GET['song']."\r\n");
+
+if($_POST['cache-refresh'] == $cache_passwd) {
+       generate_search_cache($music_dir, $search_cache);
+       die("\n");
+}
+
+if(isset($_GET['playlist'])) {
+       if(!isset($_GET['search'])) {
+               generate_m3u($dir, dirname($music_dir_url), isset($_GET['recursive']));
+       } else {
+               if(!($searchfp = fopen($search_cache, 'r')))
+                       die("Cannot read cache from $outfile<br />Refresh cache or set permissions properly!<br />\n");
+               while(!feof($searchfp)) {
+                       $line = trim(fgets($searchfp));
+                       if(@eregi(str_replace(' ', '(.*)', $_GET['search']), $line)) 
+                               echo(dirname($music_dir_url).'/'.str_replace('%2F', '/', (rawurlencode($line)))."\r\n");
+               }
+       }
+       die("\n");
+}
+
+if(isset($_GET['random'])) {
+       $flen = 0;
+       if(!($searchfp = fopen($search_cache, 'r')))
+               die("Cannot read cache from $outfile<br />Refresh cache or set permissions properly!<br />\n");
+       while(!feof($searchfp)) { fgets($searchfp); $flen++; }
+       for($i=0; $i<$_GET['random']; $i++) {
+               rewind($searchfp);
+               for($j=0; $j<rand(0, $flen-1); $j++) fgets($searchfp);
+               echo(dirname($music_dir_url).'/'.str_replace('%2F', '/', (rawurlencode(trim(fgets($searchfp)))))."\r\n");
+       }
+       die("\n");
+}
+
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<link rel="stylesheet" type="text/css" href="<?=$css_file?>">
+
+<div align="right" style="position: absolute; top: 0; right: 0;">
+       <iframe src="about:blank" name="playframe" width="0" height="0" style="border: none;"></iframe>
+       &lt; <a href="javascript: history.go(-1)">BACK</a> | <a href="?">HOME (<?=$music_dir?>)</a> | <a href="?help">ABOUT/HELP</a> | <a href="?logout">LOGOUT</a>
+</div>
+
+<?php
+if(isset($_GET['help'])) {
+        ?><h1>About/Help</h1><?php
+        readfile($bonus_dir.'/help.html');
+       die();
+}
+
+if(!isset($_GET['search'])) {
+       echo('<title>'.$title.': '.$dir.'</title>');
+       echo('<a href="?" style="color: black;"><h1>'.$title.'</h1></a><h2>Index of: '.$dir.'</h2>');
+} else {
+       echo('<title>'.$title.': '.unxss($_GET['search']).'</title>');
+       echo('<a href="?" style="color: black;"><h1>'.$title.'</h1></a><h2>Searching for: '.unxss($_GET['search']).'</h2>');
+}
+
+?>
+
+<div align="right">
+       <form action="?" method="GET" align="right" style="display: inline;">
+               <input type="hidden" name="download" value="" />
+               <input type="text" name="random" value="<?=$default_random_count?>" />
+               <input type="submit" value="random" title="Generate random music playlist..." />
+       </form>
+       <form action="?" method="GET" align="right" style="display: inline;">
+               <input type="text" name="search" 
+                       title="Search in music/google/lyrics/mp3/youtube; Hint: You can use regular expressions in search query..."
+                       value="<?=unxss($_GET['search'])?>"
+               />
+               <input type="submit" value="search" title="Search in this JuKe!Box..." />
+       </form>
+</div><br /><?php
+
+if(isset($_GET['search'])) {
+
+?><div align="right">
+       <form action="http://google.com/search" method="GET" align="right" style="display: inline;">
+               <input type="text" name="q" value="<?=unxss($_GET['search'])?>" />
+               <input type="submit" value="google" title="Search on Google..." />
+       </form>
+       <form action="http://www.elyricsworld.com/search.php?phrase=marley" method="GET" align="right" style="display: inline;">
+               <input type="text" name="phrase" value="<?=unxss($_GET['search'])?>" />
+               <input type="submit" value="lyrics" title="Search for lyrics on internet..." />
+       </form>
+       <form action="http://jyxo.cz/s" method="GET" align="right" style="display: inline;">
+               <input type="hidden" name="d" value="mm" />
+               <input type="text" name="q" value="<?=unxss($_GET['search'])?>" />
+               <input type="submit" value="jyxo multimedia" title="Search media on internet..." />
+       </form>
+       <form action="http://youtube.com/results" method="GET" align="right" style="display: inline;">
+               <input type="text" name="search_query" value="<?=unxss($_GET['search'])?>" />
+               <input type="submit" value="youtube" title="Search on YOUTube..." />
+       </form>
+</div><br />
+<div align="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="submit" value="refresh cache" title="You should refresh cache each time when you add new music or upgrade to newer version of JuKe!Box !!!" />
+       </form>
+</div><?php
+echo('Search DB size: '.(filesize($search_cache)/1024)." kB<br />\n");
+
+if(!($searchfp = fopen($search_cache, 'r')))
+       die("Cannot read cache from $outfile<br />Refresh cache or set permissions properly!<br />\n");
+
+$i = 0;
+echo('<table border="1" width="100%">');
+echo('<tr><td>S</td><td><a href="?download&playlist&search='.unxss($_GET['search']).'">P</a></td><td colspan="100%">Search: '.unxss($_GET['search']).'</td></tr>');
+while(!feof($searchfp)) {
+       $line = trim(fgets($searchfp));
+       $parclass=($i%2?"even":"odd"); $parcolor=($i%2?"lightblue":"white");
+       if(@eregi(str_replace(' ', '(.*)', $_GET['search']), $line)) {
+               $i++;
+               echo("<tr class=\"$parclass\" bgcolor=\"$parcolor\">");
+               $filesize = 0; if($i <= $access_limit) $filesize = filesize($line); else $filesize = 'n/a';
+               render_file_line('', $line, $music_dir_url, $i, $filesize, true);
+               echo("</tr>\n");
+       }
+}
+echo("</table>Total: $i results...<br />");
+die();
+
+}
+@readfile($header_file);
+foreach($indexlist as $index) @readfile($dir.$index); 
+?>
+<br />
+<table border="1" width="100%">
+<tr><td>&gt;</td>
+<td><b><a href="?download&playlist&dir=<?=str_replace('%2F', '/', rawurlencode($current_dir))?>">P</a>/<a
+href="?download&recursive&playlist&dir=<?=str_replace('%2F', '/', rawurlencode($current_dir))?>">R</a></b></td>
+<td colspan="100%"><?=$dir?></td></tr>
+<tr><td>^</td><td>&nbsp;</td><td colspan="100%">[DIR] <a href="?dir=<?=rawurlencode($parent_dir)?>">.. (<?=$parent_dir?>)</a></td></tr>
+<?php
+
+$i = 0;
+$dd = opendir($dir);
+for($s=2;$s;$s--) { while(($item = readdir($dd)) != false) {
+       if($item == '.' || $item == '..') continue;
+       if(($s==2 && is_file($dir.$item)) || ($s!=2 && is_dir($dir.$item))) continue;
+       $i++;
+       $parclass=($i%2?"even":"odd"); $parcolor=($i%2?"lightblue":"white");
+               if(is_file($dir.$item)) {
+                       if($sort > 1) {
+                               $i--;
+                               $items[] = $item;
+                       } else {
+                               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("<tr class=\"$parclass\" bgcolor=\"$parcolor\">".
+                       '<td>'.$i.'</td><td><a href="?download&playlist&dir='.$temp.'">P</a>/'.
+                       '<a href="?download&recursive&playlist&dir='.$temp.'">R</a></td>'.
+                       '<td colspan="100%">[DIR] <a href="?dir='.$temp.'">'.str_replace('_', ' ', $item)."</a></td></tr>\n");
+               }
+} rewinddir($dd); }
+if($sort > 1) {
+       @sort($items);
+       foreach($items as $item) {
+               $i++;
+               render_file_line($dir, $item, $music_dir_url, $i, filesize($dir.$item));
+       }
+}
+
+?></table>
+
+<?php
+$quotes = array(
+       'This is NOT advertisments. This is just good text to think about... Remove it if you want!',
+       'Downloading without sharing and other forms of leeching equals STEALING! ;P',
+       'Do NOT support Microsoft!!! Use Linux! ;D',
+       'Don\'t steal! Steal and share!!! ;P',
+       'Linux is not matter of price, it\'s matter of freedom!',
+       'This software brought to you by <a href="http://blog.Harvie.cz">Harvie</a> 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('<i>'.$quotes[rand(0,sizeof($quotes)-1)]."</i>\n");
+@readfile($footer_file);
diff --git a/jukebox-bonus/.htaccess b/jukebox-bonus/.htaccess
new file mode 100755 (executable)
index 0000000..6cde0e5
--- /dev/null
@@ -0,0 +1,3 @@
+<Files cache.db>
+    Deny from all
+</Files>
diff --git a/jukebox-bonus/acorner.gif b/jukebox-bonus/acorner.gif
new file mode 100755 (executable)
index 0000000..33970cb
Binary files /dev/null and b/jukebox-bonus/acorner.gif differ
diff --git a/jukebox-bonus/autoplay.png b/jukebox-bonus/autoplay.png
new file mode 100755 (executable)
index 0000000..8ebf7bb
Binary files /dev/null and b/jukebox-bonus/autoplay.png differ
diff --git a/jukebox-bonus/cache.db b/jukebox-bonus/cache.db
new file mode 100755 (executable)
index 0000000..42a8a57
--- /dev/null
@@ -0,0 +1,18 @@
+./music/Audio Books - Self Help Meditation Self Hypnosis  - 'Assertiveness' (very good).mp3
+./music/Drum & Bass  MC Skibadee - Deep inside.mp3
+./music/Drum and Bass - One nation.mp3
+./music/Drum n base-Prodigy Medley - DJ Marky Mark - Rare tracks - Drum 'n' bass  - Exclusivo Megamix do DJ marky Mark para os hits do grupo Prodigy para a boite Toco - 1996 - Paradoxx.mp3
+./music/Emine??ěščřžýáíém - Stan.mp3
+./music/Expedance - Intrance.mp3
+./music/František Ringo Čech/1-04 Give Me Fierce - UDG.mp3
+./music/František Ringo Čech/10 - Christina Aguilera vs Freestylers - Aint No Other Man vs Push Up.mp3
+./music/František Ringo Čech/10 - Thievery Corporation - The Heart's A Lonely Hunter (Feat David Byrne) - www.torrentazos.com.mp3
+./music/František Ringo Čech/12_To_jsme_my,_borci_ze_statlu.mp3
+./music/František Ringo Čech/17_-_Uspesne_zapojeni.mp3
+./music/František Ringo Čech/Češi a jejich samičky/01 - František Ringo Čech - Češi a jejich samičky - Bezpečný sex se ženami.mp3
+./music/František Ringo Čech/Češi a jejich samičky/02 - František Ringo Čech - Češi a jejich samičky - Kup jí kožich, bude pokoj.mp3
+./music/František Ringo Čech/Češi a jejich samičky/03 - František Ringo Čech - Češi a jejich samičky - Pomsta je sladká, když si počkáš 30 let.mp3
+./music/František Ringo Čech/Češi a jejich samičky/04 - František Ringo Čech - Češi a jejich samičky - Jak se kapelník H. přišukal do rodiny.mp3
+./music/František Ringo Čech/Češi a jejich samičky/05 - František Ringo Čech - Češi a jejich samičky - Ne, pití ne, to patří mému miláčkovi.mp3
+./music/František Ringo Čech/Češi a jejich samičky/06 - František Ringo Čech - Češi a jejich samičky - Čestné neférovosti a svaté lži.mp3
+./music/František Ringo Čech/Češi a jejich samičky/07 - František Ringo Čech - Češi a jejich samičky - Já, nebohé kachňátko.mp3
diff --git a/jukebox-bonus/copying b/jukebox-bonus/copying
new file mode 100755 (executable)
index 0000000..30baeb6
--- /dev/null
@@ -0,0 +1,12 @@
+License for musicplayer (you can get source codes @ http://musicplayer.sourceforge.net/)\r
+\r
+Copyright (c) 2005, Fabricio Zuardi\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\r
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r
+    * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/jukebox-bonus/corner.gif b/jukebox-bonus/corner.gif
new file mode 100755 (executable)
index 0000000..3bdb05a
Binary files /dev/null and b/jukebox-bonus/corner.gif differ
diff --git a/jukebox-bonus/footer.html b/jukebox-bonus/footer.html
new file mode 100755 (executable)
index 0000000..2953b62
--- /dev/null
@@ -0,0 +1,2 @@
+<!-- Paticka -->
+
diff --git a/jukebox-bonus/header.html b/jukebox-bonus/header.html
new file mode 100755 (executable)
index 0000000..4d54b3a
--- /dev/null
@@ -0,0 +1,2 @@
+<!-- hlavicka -->
+
diff --git a/jukebox-bonus/help.html b/jukebox-bonus/help.html
new file mode 100755 (executable)
index 0000000..509417e
--- /dev/null
@@ -0,0 +1,70 @@
+<title>Harvie's JuKe!Box Help</title>
+<pre><h2>Autorská práva</h2>
+Autorem této aplikace je &lt;~~Harvie (2oo8), který se zříká autorských práv (CopyLefted) a zároveň také zodpovědnosti.
+Licence pro software z třetí strany (musicplayer,...) najdete v souboru COPYING.
+Pokud je pomocí tohoto webu zpřístupněn materiál, jehož stažením se vy nebo poskytovatel dopouštíte porušení autorských práv, tento obsah nestahujete!
+Instalací nebo používáním aplikace potvrzujete, že jste s právy srozuměni a že je akceptujete. V opačném případě aplikaci nepoužívejte ani neinstalujte.
+
+<h2>Základy Ovládání</h2>
+Na úvodní stránce vidíte výpis souborů a adresářů (označeny [DIR]).
+Kliknutím na jméno souboru zahájíte stahování.
+Kliknutím na jméno adresáře vstoupíte do adresáře.
+Pokud zobrazený adresář obsahuje soubor index.html nebo index.txt, bude tento zobrazen nad výpisem.
+Vedle každého adresáře nebo hudebního souboru najdete písmenka, pomocí kterých můžete spustit příslušnou akci.
+
+Tady je krátký přehled významu jednotlivých písmenek:
+P - Přehrát (je nutné stáhnout playlist.m3u a otevřít v přehrávači hudby - např. Winamp, to se dá po nastavení prohlížeče dělat automaticky...)
+  - U složek tato volba přehraje všechny zvukové soubory, které složka obsahuje
+R - To samé jako P, ale přehraje se i hudba v podsložkách (POZOR! raději nepoštět na velké adresáře!!!)
+D - Otevře nadřazenou složku pro daný soubor (pouze u vyhledávání)
+F - Spustí přehrávání v prohlížeči (vyžaduje flash), otevřete odkaz v novém okně, pokud si chcete dál prohlížet knihovnu...
+S - Zastaví přehrávání v prohlížeči
+
+<h2>Vyhledávání</h2>
+Před prvním vyhledáváním je potřeba vytvořit cache a nastavit ji práva pr zápis.
+Potom je soubor s cache třeba obnovovat (na stránce vyhledávání se zadá heslo pro obnovení/vytvoření db a stiskne se "refresh cache").
+Na Linuxu se může dát obnovování cache do cronu jako skript používající příkaz find, databáze tak bude udržována stále aktuální.
+Při vyhledávání je možné použít regulární výrazy (mezery budou nahrazeny řetězcem '(.*)' !!!).
+Kromě vyhledávání hudby v lokálním archivu skript také umožňuje vyhledávání hudby a textů písní na www.
+Je limitován počet souborů, u kterých se při vyhledávání zobrazuje velikost. (To by vylučovalo funkci cache - cachovat velikost se mi ale nechce).
+Kromě vyhledávání lze z databáze také vygenerovat (pseudo)náhodný playlist.
+
+<h2>Přihlašování</h2>
+Pokud je povolen přihašovací modul, budete při prvním otevření stránky vyzváni k zadání příslušných údajů.
+Odhlášení provedete kliknutím na odkaz "LOGOUT" v horním menu.
+
+<h2>Instalace</h2>
+Instalace se provádí nakopírováním souborů do adresáře přístupného webovému servru,
+upravením nastavení ve zdrojovém souboru a přihlašovacím modulu (http_auth.php).
+Pro zakázání přihlašovacího modulu smažte první řádek kódu (obsahuje http_auth.php).
+a správným nastavením přístupových práv daným souborům.
+Také doporučuji nastavit php open base dir pro pojisteni pred directory traversingem do nadrazenych adresaru...
+
+Přehled vlastností v hlavním souboru:
+$title =                Nadpis stránky
+$music_dir =            Relativní cesta k adresáři s hudbout
+$music_dir_url =        URL pro přístup k hudbě z venku
+$cache_passwd =         Heslo pro obnovení vyhledávací cache
+$access_limit =                Maximální počet souborů zpracovaných bez použití cache (při vyhledávání)
+$default_random_count = Výchozí počet v náhodném playlistu        
+$sort =                 Povolit abecedni razeni? 0=ne, 1=jen playlisty, 2=playlisty i listingy, 3=vse i vyhledavani
+                       - Razeni je potreba pouzivat s rozvahou s ohledem na zatez CPU a RAM (coz muze byt omezeno nastavenim serveru/php)
+                       - Razeni vyhledavaci databaze muze byt narocnejsi zvlaste u rozsahlejsich hudebnich knihoven
+                         - V takovem pripade je vhodne ho zakazat, nebo pouzit k razeni shellove skripty
+
+$playlist_name =        Jméno generovaného playlistu
+$m3u_exts =             Přípony souborů, které se zobrazí v playlistu a ve vyhledávání
+
+$indexlist =            Pole se jmény souborů, které se mají případně zobrazit před výpisem složky
+$bonus_dir =            Adresář s pomocnými soubory
+$search_cache =         Cesta k vyhledávací cache
+$flash_player =         Cesta k swf souboru webového přehrávače
+$css_file =             Cesta k CSS stylu
+
+
+<h2>Nefunguje</h2>
+Skript - potřebujete webserver s podporou PHP
+Vyhledávání - skript nemá práva pro zápis/čtení databáze, nebo databáze ještě nebyla vytvořená...
+Přehrávání v prohlížeči - není přítomný swf soubor přehrávače, prohlížeč nepodporuje flash, nebo inline framy...
+Něco jiného - UTFS && UTFG...
+</pre>
diff --git a/jukebox-bonus/jukebox.css b/jukebox-bonus/jukebox.css
new file mode 100755 (executable)
index 0000000..eec9990
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Example CSS for Harvie's JuKe!Box
+ */
+
+body {
+       background-color: black;
+       color: lightblue;
+       font-family: monospace;
+       margin: 5px;
+       background-image: url(corner.gif);
+       background-repeat: no-repeat;
+}
+
+a {
+       color: white;
+}
+
+h1 {
+       color: white;
+       margin: 25px 0px 0px 25px;
+}
+
+a h1 {
+       text-decoration: underline;
+}
+
+input {
+       border: 1px solid lightblue;
+}
+
+table * {
+       background-color: darkblue;
+       color: white;
+}
+
+table {
+       border: 0px solid blue;
+       background-color: black;
+}
+
+td {
+       border: 0px solid blue;
+       margin: 0px;
+}
+
+.odd * {
+       background-color: darkblue;
+}
+
+.even * {
+       background-color: #000044;
+}
+
+*.red {
+       color: red;
+}
+
+*.yellow {
+       color: yellow;
+}
diff --git a/jukebox-bonus/musicplayer.swf b/jukebox-bonus/musicplayer.swf
new file mode 100755 (executable)
index 0000000..39c8d53
Binary files /dev/null and b/jukebox-bonus/musicplayer.swf differ
diff --git a/music/PUT-YOUR-MUSIC-HERE b/music/PUT-YOUR-MUSIC-HERE
new file mode 100755 (executable)
index 0000000..e69de29
diff --git a/music/example-of-subdirectory/index.html b/music/example-of-subdirectory/index.html
new file mode 100755 (executable)
index 0000000..2267c5a
--- /dev/null
@@ -0,0 +1 @@
+Here you can write comments for each directory...
diff --git a/music/index.html b/music/index.html
new file mode 100755 (executable)
index 0000000..5de2b21
--- /dev/null
@@ -0,0 +1 @@
+Here you can write <b>diferrent</b> comments for each directory...
This page took 0.342678 seconds and 4 git commands to generate.