Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h3>The recordings from the Yehuda Eder class...</h3>
- Things to know:<UL><LI>Quality isn't amazing</LI><LI>I missed a few songs</LI><LI>The list is in chronological order (i think)</LI>
- </UL>
- <script type="text/javascript" language="javascript" src="/utils/nifty/niftyplayer.js"></script>
- <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">
- <param name=movie value="/utils/nifty/niftyplayer.swf?file=http://www.basementphilosophy.com/utils/nifty/betty.mp3">
- <param name=quality value=high>
- <param name=bgcolor value=#EEEEFF>
- <embed src="/utils/nifty/niftyplayer.swf?file=http://www.basementphilosophy.com/utils/nifty/betty.mp3" quality=high bgcolor=#EEEEFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
- </embed>
- </object>
- <?php
- //$MY_ROOT = "..";
- define("MY_ROOT", "/home/content/u/b/e/ubershmekel/html");
- define("MY_WEB_ROOT", "http://www.basementphilosophy.com");
- function local_to_web($fname) {
- // removes the MY_ROOT and sticks the web root in it
- return str_replace(MY_ROOT, MY_WEB_ROOT, $fname);
- }
- function handle_dir($dir) {
- echo "<br/><h3>$dir</h3>";
- }
- function handle_file($file) {
- // Show a link and a flash player for the file
- $file_name = basename($file);
- $wpath = local_to_web($file);
- $my_string = <<<ML_STRING
- <br />
- $file_name <a title="$file_name" href="$wpath">[download mp3]</a> <a title="play" href="javascript:niftyplayer('niftyPlayer1').loadAndPlay('$wpath')">[play]</a> <a href="javascript:niftyplayer('niftyPlayer1').playToggle()">[pause]</a>
- ML_STRING;
- echo $my_string;
- }
- /**
- * Return the number of files that resides under a directory.
- *
- * @return integer
- * @param string (required) The directory you want to start in
- * @param boolean (optional) Recursive counting. Default to FALSE.
- */
- function num_files($dir, $recursive=false) {
- static $counter;
- if(is_dir($dir)) {
- handle_dir($dir);
- if($dh = opendir($dir)) {
- while(($file = readdir($dh)) !== false) {
- if($file != "." && $file != "..") {
- $fpath = $dir."/".$file;
- if(is_dir($fpath) && $recursive == true) {
- $counter = $counter + num_files($dir."/".$file, $recursive);
- }
- else {
- //echo "$file";
- handle_file($fpath);
- $counter = $counter + 1;
- }
- }
- }
- closedir($dh);
- }
- }
- return $counter;
- }
- // Usage:
- $nfiles = num_files(MY_ROOT."/files/rimon", true);
- //echo "whatever... $nfiles";
- //$nfiles = num_files("../files/rimon");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement