prepare("SELECT * FROM `forum-topics` WHERE id = ?"); $group->execute([$result["TopicId"]]); $groupResult = $group->fetch(PDO::FETCH_ASSOC); ?>
Forum -
Platinus Forum » " . $groupResult["Name"] . "";?> » " . $result["Name"] . ""; ?>
Subject
prepare("SELECT * FROM `forum-posts`"); $posts->execute(); $sectionTemplate = <<<'EOT'{FORUM_SECTION_NAME} {FORUM_SECTION_DESCRIPTION}
EOT; $isEmpty = true; foreach($posts as $post){ if($post["Forum"]==$result["id"] and $post["Hidden"] == false){ $isEmpty = false; $text = substr($post["Text"],0,60); if(strlen($text)==60){ $text = $text . "..."; } $newSection = str_replace("{FORUM_SECTION_NAME}",htmlspecialchars($post["Subject"],ENT_QUOTES,'UTF-8'),$sectionTemplate); $newSection = str_replace("{FORUM_SECTION_DESCRIPTION}",htmlspecialchars($text,ENT_QUOTES,'UTF-8'),$newSection); $newSection = str_replace("{FORUM_SECTION_LINK}","https://" . $_SERVER["HTTP_HOST"] . "/forum/ShowPost?id=" . $post["id"],$newSection); echo $newSection; } } if($isEmpty){ echo "This topic is empty. Be the first to post!