Le site de Sasha
$maxcol = 3;
function pick_title($htmlfile) {
if (file_exists($htmlfile)) {
$text = file($htmlfile);
return $text[0];
}
return "";
}
$d = dir(".");
$col = 0;
$dirs = array();
while (false !== ($entry = $d->read())) {
if (file_exists($entry . "/Thumbnails/preview.jpg") && file_exists($entry . "/index.php")) {
$dirs[] = $entry;
}
}
$d->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++;
}
?>