I have this script here http://activeden.net/item/mc-mini-mp3-player/36027. I have asked the maker of the script he told me he has not tried virtual directory’s with his script and to ask else where for my answers.
server: IIS 8.5
Php: 5.5.5
I would like the script to be able to read from virtual directory’s and I am not a developer so you may have to treat my as a newbie.
This is the script I be leave needs to be altered to read virtual directory’s
[php]
<?php
$dir = $_POST['songFolder'];
$open_dir = "../" . $dir;
$paths="";
if ($handle = opendir($open_dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (is_dir($open_dir . "/" . $file)) {
$sub_dir = "$file";
if ($paths == ""){
$paths = "" . $sub_dir . "";
}else{
$paths = $paths . "" . $sub_dir . "";
}
$dh = opendir("$open_dir/$sub_dir");
while (false !== ($filename = readdir($dh))) {
$newData[] = $filename;
}
sort($newData);
for ($i = 0; $i < sizeof($newData); ++$i) {
if ($newData[$i] != "." && $newData[$i] != "..") {
if (substr($newData[$i], -3) == "jpg"){
$paths = $paths . "" . $dir . "/" . $sub_dir . "/" . $newData[$i] . "";
} else if (substr($newData[$i], -3) == "mp3") {
$paths = $paths . "" . $dir . "/" . $sub_dir . "/" . $newData[$i] . "";
$paths = $paths . "" . date("F d Y H:i:s", filectime($open_dir . "/" . $sub_dir . "/" . $newData[$i])) . "";
}
}
}
array_splice($newData,0,sizeof($newData),".");
closedir($dh);
} else {
if ($paths == ""){
$paths = "" . $dir . "";
}else{
//$paths = $paths . "" . $dir . "";
}
if (substr($file, -3) == "jpg"){
$paths = $paths . "" . $dir . "/" . $file . "";
} else if (substr($file, -3) == "mp3") {
$paths = $paths . "" . $dir . "/" . $file . "";
$paths = $paths . "" . date("F d Y H:i:s", filectime($open_dir . "/" . $file)) . "";
}
}
}
}
closedir($handle);
}
$paths = $paths . "";
echo "paths=" . $paths;
?>
[/php]
I would appreciate any help
Thank you