1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <link rel="stylesheet" href="/style.css" />
- <title>Bloggings</title>
- </head>
- <body>
- <header>
- <center>
- <h1>Bloggings</h1>
- <img src="images/shadocks-pumping-300.gif" alt="shadocks pumping">
- <br><br>
- <a href="index.html">Blog</a> | <a
- href="https://shaarli.wittamore.com" target="_blank">Links</a> | <a
- href="https://git.wittamore.com" target="_blank">Git</a> | <a
- href="search.php">Search</a> | <a
- href="https://wittamore-com.translate.goog/?_x_tr_sl=auto&_x_tr_tl=fr&_x_tr_hl=en-GB&_x_tr_pto=wapp"
- >FR</a
- > </center>
- <hr />
- </header>
- <h1>Static Pages</h1>
- <!-- list start -->
- <?php
- // iterate through years
- $items = [];
- echo "<ul>";
- // iterate through files
- $i = 0;
- $thisdir = new DirectoryIterator("./static");
- foreach ($thisdir as $file) {
- if ($file != "." && $file != "..") {
- $i++;
- $content = file_get_contents($file->getPathname());
- preg_match("/<h5>(.*?)<\/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>(.*?)<\/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 "<li>" .
- '<a href="' .
- $items[$i][1] .
- '">' .
- $items[$i][2] .
- "</a></li>";
- $i++;
- }
- echo "</ul>";
- ?>
- <!-- list end -->
- <p> </p>
- <hr />
- <center>
- <h5>
- A minimalist blog by
- <a
- href="mailto:%70%68%69%6C%69%70%40%77%69%74%74%61%6D%6F%72%65%2E%63%6F%6D"
- >Philip Wittamore</a
- >
- </h5>
- </center>
- </body>
- </html>
|