for ($rowx=0; $rowx<$numrows; $rowx++) {
$row = "";
for ($pos=0; $pos<3;) {
if (($file = readdir($handle)) !== false) {
if(is_file($dir."/".$file)) {
$template = new Template;
$template->load("../templates/gallerypic.tpl");
$template->replace("link", "pic.php?id=".$id."&pic=".$file);
$template->replace("thumbnail", "pictures/".$id."/thumbs/".$file);
$row .= $template->out();
$pos++;
}
}
}
$pictures .= "<tr>".$row."</tr>";
}
With the code above, i get a timeout, i dont get it if i remove the if(is_file) line.
However i can do a $var = is_file, but i cant then do a if ($var).
What i am trying to do, obviously, is filter out the directories. I already know the directory names, ".", ".." and "thumbs".
I have tried doing an if ($file != <dirname>) which i can do for one or two directories, put when i try to do it for all 3, it times out again. It does not matter which of the two i chose.
I also tried doing an if (strlen($file)), which works for >2 but not >6
Ive already asked some people and they agree that this is extrememly weird, and i have tested the code on 2 servers.
If anyone can suggest what might be happening id be extrememly appreciative.
Thanks