diff options
| author | Hannah Isopod <me@bathynomus.xyz> | 2025-11-09 08:58:02 -0700 |
|---|---|---|
| committer | Hannah Isopod <me@bathynomus.xyz> | 2025-11-09 08:58:02 -0700 |
| commit | 16e48ed8655528a81cbec84f0cbc1a211d663b37 (patch) | |
| tree | a567a674392f08f24274fc8803323ebf6df7ad36 /blog/posts/post.php | |
| parent | 9792b0963772d8657e8c32bdd647995250daaada (diff) | |
Probably final commit before the redesign
Routine updates to various pages
Accessibility fix in /guestbook
Updated /uses im pretty sure
Reorganized /blog/ a little under the hood
Diffstat (limited to 'blog/posts/post.php')
| -rw-r--r-- | blog/posts/post.php | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/blog/posts/post.php b/blog/posts/post.php deleted file mode 100644 index b541ada..0000000 --- a/blog/posts/post.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php -/*ini_set('display_errors', 1); -ini_set('display_startup_errors', 1); -error_reporting(E_ALL);*/ - -if($_SERVER['REQUEST_URI'] === "/blog/posts/post.php") { - header("Location: /blog/"); - die(); -} - -$cwd = preg_replace('/^.*\//', '', getcwd()); -$feed = simplexml_load_file($_SERVER['DOCUMENT_ROOT']."/blog/blog.atom"); -$pdate = ""; -$udate = ""; -$title = ""; -$descr = ""; -$prevtitle = ""; -$prevlink = ""; -$nexttitle = ""; -$nextlink = ""; -foreach($feed->entry as $entry) { - if($entry->id == $cwd) { - $pdate = preg_replace('/T.*$/', ' ', $entry->published); - $udate = preg_replace('/T.*$/', ' ', $entry->updated); - $title = $entry->title; - $descr = htmlspecialchars($entry->summary); - } else if($title) { - $nextlink = $entry->link["href"]; - $nexttitle = $entry->title; - break; - } else { - $prevlink = $entry->link["href"]; - $prevtitle = $entry->title; - } -} -?> -<!DOCTYPE html> -<html lang="en"> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link href="/style.css" rel="stylesheet" type="text/css" media="all"> - <link href="/guestbook/comments.css" rel="stylesheet" type="text/css" media="all"> - <?php - echo("<title>$title</title><meta name='description' content='$descr'>"); - $bgfile = glob('bg.*')[0]; - if(!is_null($bgfile)) { - echo("<style> body > h1:first-of-type { background-image: url('$bgfile') } </style>"); - } - ?> - <style> - form { - display: flex; - flex-direction: column; - gap: calc(var(--stdpadding) / 2); - } - #commentform-top, #commentform-bottom { - display: flex; - gap: calc(var(--stdpadding) / 2); - align-items: center; - } - #commentform-bottom { - justify-content: right; - } - input[type="submit"] { - width: fit-content; - } - .error, .success { - flex-grow: 1; - } - @media only screen and (hover: none) { - #commentform-top { - flex-direction: column; - } - } - td { - display: table-cell !important; - } - </style> - <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?> - </head> - <body> - <?php - include($_SERVER['DOCUMENT_ROOT'] . '/nav.php'); - include($_SERVER['DOCUMENT_ROOT'] . '/common.php'); - $udates = ""; - if($pdate != $udate) { $udates = " | Updated on $udate"; } - echo("<h1>isoblog</h1><h2 id='caption'>$title</h2><p style='text-align: center;'><em>Posted on $pdate$udates</em></p>"); - //echo("<p style='text-align: right;'>I'm testing in prod right now. don't worry about it"); - include("../../../Parsedown.php"); - $Parsedown = new Parsedown(); - echo $Parsedown->text(file_get_contents("index.md")); - $Parsedown->setSafeMode(true); - $return = $_GET["return"]; - ?> - <hr> - <nav style="flex-direction: column;"> - <?php - if($prevlink) { - echo("<a style='width: 100%; box-sizing: border-box;' href='$prevlink'><b>Previous</b>: $prevtitle</a>"); - } - if($nextlink) { - echo("<a style='width: 100%; box-sizing: border-box;' href='$nextlink'><b>Next</b>: $nexttitle</a>"); - } - ?> - </nav> - <hr> - <h2>Comments</h2> - <form action="/guestbook/submit.php" method="post" autocomplete="off"> - <?php echo "<input type='text' name='entry' value='".preg_replace("/^.*\//","",getcwd())."' style='display: none;' readonly>"; ?> - <textarea name="msg" placeholder="I know what you are." style="opacity: 0; position: absolute; left: -10000rem; height: 0; width: 0; overflow: clip;"></textarea> - <div id="commentform-top"> - <input type="text" name="name" placeholder="Name"> - <input type="text" name="website" placeholder="Website (optional)"> - <input type="text" name="botcheck" placeholder="Bot test (type "isopod")"> - </div> - <textarea name="message" placeholder="Comment (Now supports Markdown!)"></textarea> - <div id="commentform-bottom"> - <?php - if($return) { - echo($gbform_messages[$return]); - } - ?> - <input type="submit" value="Submit"> - </div> - </form> - <?php include('../../../guestbook/comments.php'); echo_comments(preg_replace("/^.*\//","",getcwd()), $Parsedown); ?> - </body> -</html> |
