"; while ($component = substr ($path, 0, strpos ($path, "/"))) { $component_path = isset ($component_path) ? $component_path . "/" . $component : $component; print "$component: "; $path = substr ($path, strpos ($path, "/") + 1); } // while print "$path\n"; if ($albumart = GetAlbumArt ("$base/$orig_path")) { print "\n"; } // if } // Banner function DisplayItem ($path, $element) { if ($element == "." || $element == "..") { return false; } elseif (is_dir ($path . "/" . $element)) { if ($element == "My Playlists") { return false; } else { return true; } // if } elseif (strpos ($element, ".wma") || strpos ($element, ".mp3")) { return true; } else { return false; } // if } // DisplayItem function DisplayFolders ($path) { global $http_base; global $base; Banner ($path); if ($path != "") { $path = $path . "/"; } // if $folder_array = array (); $song_array = array (); if ($handle = opendir ("$base/$path")) { while (false !== ($element = readdir ($handle))) { if (!DisplayItem ("$base/$path", $element)) { continue; } // if if (is_dir ("$base/$path/$element")) { array_push ($folder_array, $element); } else { array_push ($song_array, $element); } // if } // while closedir ($handle); } // if sort ($folder_array); sort ($song_array); print "\n"; print " \n"; print " \n"; print " \n"; print " \n"; print " \n"; $song_index = 0; $folder_index = 0; while (isset ($song_array [$song_index]) || isset ($folder_array [$folder_index])) { $song = $song_array [$song_index]; $folder = $folder_array [$folder_index]; print " \n"; if (isset ($folder)) { print "\n"; $folder_index++; } else { print "\n"; } // if if (isset ($song)) { print "\n"; $song_index++; } else { print "\n"; } // if print " \n"; } // while print " \n"; print "
FoldersSongs at this level
$folder $song_name 
\n"; } // DisplayFolders ?>