Location: PHPKode > projects > Easy Music Box > browse.php
<?php
//simply browse folders
echo '<div align="center"><table border="0" align="center" width="600" id="table1">';
if (isset($_GET['path'])) {
    $folder = urldecode($_GET['path']);
    echo "<p class='fbox'>$folder<p><br>";
	if (strstr ($folder, "/") === FALSE)
		echo '<p align="center"><font size="5">  '.$folder.'</font><p>';
	else
		echo '<p align="center"><font size="5">  '.file_details::song_name($folder).'</font><p>';
    $path = "{$upath}$folder/";
}
else {
      $path = "$upath";
}
$browse = new browse ($path);
$all_files = $browse->list_all($path);
$i =0;
foreach ($all_files as $file) {
          $browse->file = $file;
          $fullfile = "$path{$file}";
          if (!$browse->music_check($file)) {
                    if ($browse->folder_check($fullfile,$file)) {
                         $i += 1;
                         if ($i % 2 == 1) { echo '<tr>';}
                         echo '<td align="center" width="50%">';

                         if (isset($folder)) {
                             echo '<a href="?path='.urlencode($folder).'/'.urlencode($file).'">'.$file.'</a></br>';
						 }
                         else {
                             echo '<a href="?path='.urlencode($file).'">'.$file.'</a></br>';
						 }
                         $subfolder = $fullfile;
                         $browse2 = new browse ($subfolder);
                         $all_files = $browse2->list_all($subfolder);
                         $l = 0;
                         foreach ($all_files as $subfile) {
							$fullsub = "{$subfolder}/$subfile";
							$browse2->file = $subfile;
							if (!(!is_dir($fullsub) or $subfile=='.' or $subfile=='..')) {
							  $l += 1;
							  if ($l <= 5)
								   echo "-$subfile</br>";
							}
							elseif ($browse2->music_check($subfile)) {
								$l += 1;
								if ($l <= 5)
								//echo $browse->song_name($fullsub);
								echo '<i><font size="1">'.$browse2->song_name($fullsub).'</font></i></br>';
							}
							}
							echo '</td>';
							if ($i % 2 == 0) {echo '</tr>';}
							}
          }
          else {
                $i += 1;
                if ($i == 1) {
                ?>
                <form style="text-align: center" method="post" id="3z_id" name="3z_name" action="" onsubmit="doSubmit(this)"><p align="center"><br />
                <?
                }
                $filelong = $folder.'/'.$file;
                $fname = $browse->song_name($filelong);
                echo '<input type="checkbox" name="pick[]" value="'.$up_dir.''.$filelong.'" />'.$fname.'<br />';
          if ($browse->music_count($path) == $i) {
          ?>
		  <br />
          <input type=button value="Select All" onClick="SelectAll()">
          <input type="submit" value="Play" onclick="popupMode=true" />
          <input type="submit" value="Add to playlist" onclick="popupMode=false" />
          <input type="reset" value="Reset" />
          </p></form><br>
          <?
          }
          }

}
echo '</tr></table></div>';
?>
Return current item: Easy Music Box