<?php include "base.php"; require_once 'class.postInput.php'; startblock('content'); $myList = new PostListClass(); # Check for post message trigger and display accordingly if (isset($_GET["id"])) { $id = $_GET["id"]; $postDeets = $myList->singlePost($id); foreach ($postDeets as $key => $value) { ${$key} = $value; } if ($status) { $status_word = "Published"; $boot = "label label-success"; } else { $status_word = "Draft"; $boot = "label label-default"; } echo "\r\n\t\t\t\t<h1>{$title}</h1>\r\n\t\t\t\t"; if (isset($_GET["success"])) { echo "<p class='bg-success'>post updated successfully.</p>"; } echo "\r\n\t\t\t\t<p class='{$boot}'>{$status_word}</p>\r\n\r\n\t\t\t\t<a href='{$link}'>\r\n\t\t\t\t\t<h3>{$link}</h3>\r\n\t\t\t\t</a>\r\n\r\n\t\t\t\t<div class='display_comments'>{$commentary}</div><br>\r\n\r\n\t\t\t\t<h3>Tags:</h3>\r\n\t\t\t\t<h4>{$allTags}</h4>\r\n\t\t\t\t<br>\r\n\t\t\t\t<form action='postEdit.php' method='post'>\r\n\t\t\t\t\t<input type='hidden' name='id' value='{$id}' />\r\n\t\t\t\t\t<input type='submit' name='btn_action' class='bottom_btn btn btn-default' value='Edit'/>\r\n\t\t\t\t\t<input type='submit' name='btn_action' class='bottom_btn btn btn-default' value='Remove Post'/>\r\n\t\t\t\t</form>\r\n\t\t\t\t"; } else { echo "<p>Dangit, you do not have an ID.</p>"; } endblock();
break; case "Remove Post": if (!$_POST["id"]) { header("location: index.php"); exit; } $myList->removeItem($_POST["id"]); break; case "Edit": if (!$_POST["id"]) { header("location: index.php"); exit; } $btn_value = "Save Changes"; $action = "Edit"; $edit_post = $myList->singlePost($_POST["id"]); foreach ($edit_post as $key => $value) { ${$key} = $value; } break; case "History": header("location: index.php?filter=History"); break; case "Art": header("location: index.php?filter=Art"); break; case "Database": header("location: index.php?filter=Database"); break; case "Archiving": header("location: index.php?filter=Archiving");