Rimon

The recordings from the Yehuda Eder class…

Things to know:

  • Quality isn’t amazing
  • I missed a few songs
  • The list is in chronological order (i think)

//$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 "

$dir

“;
}

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 = <<
$file_name [download mp3] [play] [pause]
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”);

?>

One Response to “Rimon”
  1. [...] the resulting webpage: http://basementphilosophy.com/wp/?page_id=43 [...]