Les photos de Noah
$maxcol = 3;
function pick_title($htmlfile) {
if (file_exists($htmlfile)) {
$text = file($htmlfile);
return $text[0];
}
return "";
}
$root = dir(".");
$col = 0;
$dirs = array();
while (false != ($entry = $root->read())) {
if (file_exists($entry . "/Thumbnails/preview.jpg") && file_exists($entry . "/index.php")) {
$dirs[] = $entry;
}
}
$root->close();
rsort($dirs, SORT_NUMERIC);
foreach ($dirs as $dirname) {
$title = pick_title($dirname . '/title.txt');
if ($col % $maxcol == 0) {
?>
}
?>
echo $title; ?>
|
if ($col % $maxcol == $maxcol - 1) {
?>
}
$col++;
}
?>