Forum

prepare("SELECT * FROM `forum-topics`"); $sections = $GLOBALS["sql"]->prepare("SELECT * FROM `forum-sections`"); $topics->execute(); $topicStart = <<<'EOT'
EOT; $sectionTemplate = <<<'EOT' EOT; foreach ($topics as $topic){ $sections->execute(); echo str_replace("{FORUM_TOPIC_NAME}",$topic["Name"],$topicStart); foreach($sections as $section){ if($section["TopicId"] == $topic["id"]){ $newSection = str_replace("{FORUM_SECTION_NAME}",$section["Name"],$sectionTemplate); $newSection = str_replace("{FORUM_SECTION_DESCRIPTION}",$section["Description"],$newSection); $newSection = str_replace("{FORUM_SECTION_LINK}","https://" . $_SERVER["HTTP_HOST"] . "/forum/ShowForum?topic=" . $section["id"],$newSection); $newSection = str_replace("{FORUM_THREAD_COUNT}",$section["Threads"],$newSection); $newSection = str_replace("{FORUM_POST_COUNT}",$section["Posts"],$newSection); $newSection = str_replace("{FORUM_LAST_POST}",$section["LastPost"],$newSection); $newSection = str_replace("{FORUM_LAST_POSTTIME}",$section["LastPostTime"],$newSection); echo $newSection; } } echo "
"; } ?>