adding reply links

master
BodgeMaster 2021-09-07 07:53:22 +02:00
parent 6c5eb39f96
commit c06300a1fb
2 changed files with 14 additions and 2 deletions

View File

@ -20,11 +20,16 @@ foreach($statement->fetchAll() as $ROW) {
$newlines = array("\r\n", "\n\r", "\r", "\n"); // two-character newlines first to prevent placing two line breaks instead of one
$post_content = str_replace($newlines, "<br />", $post_content);
// post id of the original post this is a reply to, negative numbers mean no reply
// if this is a reply, build reference
$reply_to = $ROW['reply_to'];
if ($reply_to > -1) {
$reply_reference = "<p class=\"post_reply\" >This is a reply to <a href=./?id=$_GET['id']#$reply_to >this</a> message.</p>"
} else {
$reply_reference = ""
}
echo "<section id=\"$post_id\" >
<h1>$post_title</h1>
<h1 class=\"post\">$post_title</h1>
<article>
<header>
<div>

View File

@ -388,3 +388,10 @@ header {
padding: 40px 40px 10px 40px;
box-shadow: 0px 4px 8px 0px rgba(0,0,0,0.2);
}
h1.post{
margin: 0;
}
p.post_reply {
margin: 0.1em;
}