function countFiles($path)
{
$total = 0;
if (is_dir($path)) {
$d = @dir($path);
while (false !== ($entry = $d->read())) {
//echo $entry."<br>";
if (substr($entry, 0, 1) != '.' && $this->isThumbDir($entry) == false && $this->isTmpFile($entry) == false && $this->isThumb($entry) == false) {
$total++;
}
}
$d->close();
}
return $total;
}