Very nice. Thank you. I swapped in your cleaned up function and now the page lists all albums and song titles
For example it lists:
http://guruplug/NMT-Cloudplayer/index.php?path=.%2Fmusic%2FElvis+Costello+%26+The+Attractions
I can see links for albums and music files but now the HTML5 player embeded on the page won't play and shows an error message:
In this section of code I point $_ENV['basepath'] to the symlink that points to the folder with the mp3 files
14 // The base path of the files you wish to browse
15 $_ENV['basepath'] = './music';
16 // File extension you want to hide from the list
17 $_ENV['hidden_files'] = array ("\\/", "php", "css", "htaccess", "sub", "srt", "idx", "smi", "js", "DS_Store", "jpg", "gif", "nmj", "jsp", "txt");
18 // File name of album cover art
19 $_ENV['coverart'] = 'cover.jpg';
20 // File name of album review text
21 $_ENV['review'] = 'review.txt';
If I use anything else but ./music there is no listing of music filenames.
However, now the html5 player seems to want a . in front of the %2F seperator.
135 <body>
136 <?php
137 setlocale(LC_ALL, 'en_US.UTF8');
138
139 if (isset($_GET['path'])){
140 $actpath = $_GET['path'];
141 } else {
142 $actpath = $_ENV['basepath'];
143 }
144 ?>
145 <div data-role="page">
146 <div data-role="header">
147 <!--Breadcrumb -->
148 <div id="breadcrumb">
149 <?php
150 if ( $actpath != $_ENV['basepath']){
151 $crumb = explode("/",str_replace($_ENV['basepath'],"",$actpath));
152 echo "<span><a href='" .$_SERVER['PHP_SELF']."?path=".$_ENV['basepath']."'>Home</a></span>";
153 $newpath = '';
154 foreach($crumb as $index => $value) {
155 $newpath .= $value;
156 // is not last item //
157 if($index < count($crumb)-1)
158 echo "<a href='" .$_SERVER['PHP_SELF']."?path=".$_ENV['basepath']. $newpath ."'>$value</a>";
159 // it is last item //
160 else
161 echo $value;
162 $newpath .= '/';
163 }}
164 ?>
165 </div>