aboutsummaryrefslogtreecommitdiff
path: root/blog/post.php
diff options
context:
space:
mode:
authorHannah Isopod <me@bathynomus.xyz>2026-02-15 22:42:27 -0700
committerHannah Isopod <me@bathynomus.xyz>2026-02-15 22:42:27 -0700
commit3b606bcc096a6d9860672e6d0d003ca9e80c067e (patch)
tree17746584c25a0d165c0feaf884f33c1578aa4f04 /blog/post.php
parent16e48ed8655528a81cbec84f0cbc1a211d663b37 (diff)
THE BIG ONE
Total website redesign. Multiple new blog posts. Routine updates on several pages. Too much to list, even if I remembered it all. Remind me not to put this git repo on any portfolios.
Diffstat (limited to 'blog/post.php')
-rw-r--r--blog/post.php129
1 files changed, 47 insertions, 82 deletions
diff --git a/blog/post.php b/blog/post.php
index 354472b..a004cbd 100644
--- a/blog/post.php
+++ b/blog/post.php
@@ -3,7 +3,7 @@
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);*/
-if($_SERVER['REQUEST_URI'] === "/blog/posts/post.php") {
+if($_SERVER['REQUEST_URI'] === "/blog/post.php") {
header("Location: /blog/");
die();
}
@@ -35,6 +35,11 @@ foreach($feed->entry as $entry) {
$prevtitle = $entry->title;
}
}
+if(!$title) {
+ $title = "isoblog placeholder title";
+}
+$udates = "";
+if($pdate != $udate) { $udates = " Updated&nbsp;on $udate"; }
?>
<!DOCTYPE html>
<html lang="en">
@@ -42,92 +47,52 @@ foreach($feed->entry as $entry) {
<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>");
- }
+ echo("<title>$title | isopod.cool v4</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($root . '/seasonal.php'); ?>
</head>
<body>
- <?php
- include($root . '/nav.php');
- include($root . '/common.php');
- $udates = "";
- if($pdate != $udate) { $udates = " | Updated&nbsp;on&nbsp;$udate"; }
- echo("<h1>isoblog</h1><h2 id='caption'>$title</h2><p style='text-align: center;'><em>Posted&nbsp;on&nbsp;$pdate$udates</em></p>");
- //echo("<p style='text-align: right;'>I'm testing in prod right now. don't worry about it");
+ <?php include($root."/header.php"); ?>
+ <main>
+ <section>
+ <h2><?php echo($title); ?></h2>
+ <p class='h2caption'>Posted&nbsp;on <?php echo($pdate."<br>".$udates); ?></p>
+ <p class="backlink"><a href="/blog/"><< blog</a></p>
+ <?php
+ //echo("<p style='text-align: right;'>I'm testing in prod right now. don't worry about it");
- //Boilerplate for Parsedown
- include($root."/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 &quot;isopod&quot;)">
- </div>
- <textarea name="message" placeholder="Comment (Now supports Markdown!)"></textarea>
- <div id="commentform-bottom">
- <?php
- if($return) {
- echo($gbform_messages[$return]);
- }
+ //Boilerplate for Parsedown
+ include_once($root."/Parsedown.php");
+ $Parsedown = new Parsedown();
+
+ $posttext = $Parsedown->text(file_get_contents("index.md"));
+ $posttext = str_replace("<h3>", "<h5>", $posttext);
+ $posttext = str_replace("</h3>", "</h5>", $posttext);
+ $posttext = str_replace("<h2>", "<h4>", $posttext);
+ $posttext = str_replace("</h2>", "</h4>", $posttext);
+ $posttext = str_replace("<h1>", "<h3>", $posttext);
+ $posttext = str_replace("</h1>", "</h3>", $posttext);
+ echo $posttext;
+ $Parsedown->setSafeMode(true);
?>
- <input type="submit" value="Submit">
- </div>
- </form>
- <?php include($root.'/guestbook/comments.php'); echo_comments(preg_replace("/^.*\//","",getcwd()), $Parsedown); ?>
+ <hr>
+ <nav class="prevnextnav">
+ <?php
+ if($prevlink) {
+ echo("<a class='prevlink' href='$prevlink'><b>Newer</b>: $prevtitle</a>");
+ }
+ if($nextlink) {
+ echo("<a class='nextlink' href='$nextlink'><b>Older</b>: $nexttitle</a>");
+ }
+ ?>
+ </nav>
+ <?php include_once($root."/common.php"); include($root."/guestbook/commentbox.php"); ?>
+ </section>
+ </main>
+ <?php include($root."/footer.php"); ?>
</body>
</html>