global $gCms;
$config =& $gCms->GetConfig();
if(isset($_GET['file']) && $_GET['file']!=''){
$file='http://www.visitnorthcentralidaho.org/'.$_GET['file'];
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename='.basename($file));readfile($file);
}else{
foreach (new DirectoryIterator('uploads/NCITA-Audio-Tour/Northwest-passage-scenic-byway/128kbps') as $fileInfo) {
if($fileInfo->isDot()) continue;
$fname=$fileInfo->getFilename();
$filename= str_replace('---',' & ',$fname);
$filename= str_replace('-',' ',$filename);
echo $filename. "<br>";
if($fileInfo->isDir()){
$subdir=new DirectoryIterator('uploads/NCITA-Audio-Tour/Northwest-passage-scenic-byway/128kbps/'.$fname);
asort ($subdir,SORT_NUMERIC);
foreach ($subdir as $filesInfo) {
if($filesInfo->isDot()) continue;
$fname=$filesInfo->getFilename();
$folder128='uploads/NCITA-Audio-Tour/Northwest-passage-scenic-byway/128kbps/'.$fname.'/';
$folder256='uploads/NCITA-Audio-Tour/Northwest-passage-scenic-byway/256kbps/'.$fname.'/';
$filename=basename($filesInfo->getFilename());
$filename= substr($filename, 0, -4);
$filename= substr($filename, 2);
$filename= str_replace('---',' & ',$filename);
$filename= str_replace('-',' ',$filename);
echo $filename.' <br/>';
echo "<span class='mp3' style='color:#EAE5D2;'>$folder128$fname</span>";
echo "<span>download links: </span><a href='http://www.visitnorthcentralidaho.org/audio-tours.html?showtemplate=false&file=$folder128$fname' >128kbps</a> | <a href='http://www.visitnorthcentralidaho.org/audio-tours.html?showtemplate=false&file=$folder256$fname' >256kbps</a><br/><br/>";
}
}
}
}
|