Hi beginning to speculate that there is a bug with PHP 5.1 ? I have modified the get_template_part code as follows:
function get_template_part($page_directory, $template_part, $file_extension) {
$directory_array = array();
if ($file_extension == '') {
$file_extension = '.php';
}
$pdir = DIR_FS_CATALOG . $page_directory;
echo("<br> Is $pdir a directory ? <br>");
if (is_dir($pdir)) {
echo("Yes, now getting contents of directory $pdir <br>");
$files = glob($pdir . '/*.*');
foreach ($files as $file) {
$ftpy = filetype("$file");
$pInfo = pathinfo("$file");
$bname = $pInfo['basename'];
if ($ftpy != "dir") {
echo("debug scan: $bname is a $ftpy <br>");
if ((substr($bname, strrpos($bname, '.')) == $file_extension) && preg_match($template_part, $bname)) {
$directory_array[] = $bname;
}
}
}
rsort($directory_array);
}
return $directory_array;
}
As this link shows http://www.japanesewoodblockprint.org/cart/ it starts listing through all the directories well, and then suddenly stops doing so, for no reason at all. Does anyone know of any problems with directory functions under PHP 5, and how to resolve them ?
I check directory properties, and they are fine too.
Frankly close to giving up with Zen-Cart now. I hoped to have resolved this issue, but either the code or the PHP version has got the better of me.
Dave




