From b04d38c9e94992d30938121e9def033c9fa3047a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Borovec?= Date: Thu, 18 Jul 2024 23:53:59 +0200 Subject: [PATCH] formatting --- docs/www/blog/article.php | 43 ++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/docs/www/blog/article.php b/docs/www/blog/article.php index d20a99e..095a460 100644 --- a/docs/www/blog/article.php +++ b/docs/www/blog/article.php @@ -26,20 +26,25 @@ class BlogpostComment - +
%s
- - + +
- +
- +
@@ -172,21 +177,25 @@ class Blogpost return; } - if (isset($_COOKIE["PHPSESSID"]) && (bool)($_SESSION["current_user"]->permissions & 128)) { + if (isset($_COOKIE["PHPSESSID"]) && + (bool)($_SESSION["current_user"]->permissions & 128)) { $topRight = sprintf(" Edit", $this->blogpost_id); } else { - $topRight = sprintf("Published on: %s", + $topRight = sprintf(" + Published on: %s", date("Y-m-d", strtotime($this->date_posted))); } // Display the blog title and metadata printf("
"); - print_r(""); - printf("%s - +

%s

", $this->title, $topRight); + print_r(""); + printf("%s

+ %s

", + $this->title, $topRight); // Display tags for($i = 0; $i < count($this->tags); $i++) { @@ -198,8 +207,8 @@ class Blogpost } // Display publish date and end metadata div - printf("Last edited on: %s
", - date("Y-m-d", strtotime($this->date_edited))); + printf("
Last edited on: %s
", date("Y-m-d", strtotime($this->date_edited))); // Display hrule, article content and end the article printf("

%s
", $this->content); @@ -396,15 +405,16 @@ if(isset($_POST["submit"])) { $blogId = sanitize_input($_POST["blogpost_id"]); $commentContent = sanitize_input($_POST["comment_entry"]); $parentId = isset($_POST["comment_id"]) ? $_POST["comment_id"] : "NULL"; - $posterId = isset($_SESSION["current_user"]) ? $_SESSION["current_user"]->user_id : "NULL"; + $posterId = isset($_SESSION["current_user"]) ? + $_SESSION["current_user"]->user_id : "NULL"; // Try to send the comment $commentId = send_comment($conn, $blogId, $posterId, $commentContent, $parentId); // Redirect to this page with GET - header("Location: http://www.zdenekborovec-dev.cz/blog/article?blogpost_id=". - $blogId."#comment-".$commentId); + header("Location: http://www.zdenekborovec-dev.cz/blog/". + "article?blogpost_id=".$blogId."#comment-".$commentId); die(); } @@ -459,7 +469,8 @@ printf("
- +