Sticky pages
";
// iterate through files
$i = 0;
$thisdir = new DirectoryIterator("./sticky");
foreach ($thisdir as $file) {
if ((!$file->isDot()) && (!$file->isDir())) {
$i++;
$content = file_get_contents($file->getPathname());
preg_match("/(.*?)<\/h5>/s", $content, $date);
$filedate = date("Y-m-d");
if (isset($date[1]) && strtotime($date[1])) {
$filedate = date("Y-m-d", strtotime($date[1]));
}
preg_match("/(.*?)<\/h2>/s", $content, $titre);
$title = "?";
if (isset($titre[1])) {
$title = ucfirst($titre[1]);
}
$items[$i][0] = $i;
$items[$i][1] = $file->getPathname();
$items[$i][2] = $title;
}
}
$values = array_column($items, 2);
array_multisort($values, SORT_ASC, $items);
$i = 0;
while ($i < count($items)) {
echo "
" .
'' .
ucfirst($items[$i][2]) .
"";
$i++;
}
echo "";
?>
§