| |
[
46 => 'All Things Afterworld',
14 => 'Help (Technical Support and Account Issues)',
21 => 'Suggestions & Ideas',
54 => 'Game Nights & Afterworld events',
],
2 => [
13 => 'Afterworld Talk',
18 => 'Off Topic',
32 => 'Clans & Guilds',
35 => "Let's Make a Deal",
],
9 => [
62 => 'Game Marketing',
40 => 'Game Design',
33 => 'Scripters',
],
6 => [
42 => 'Video Game Central',
52 => 'Video Creation with Afterworld',
26 => 'Ro-Sports',
24 => 'Pop-Culture (Music/Books/Movies/TV)',
23 => 'Role-Playing',
],
];
$groupNames = [
1 => 'Afterworld',
2 => 'Club Houses',
9 => 'Game Creation and Development',
6 => 'Entertainment',
];
$forumDescriptions = [
46 => 'The area for discussions purely about Afterworld – the features, the games, and company news.',
14 => 'Seeking account or technical help? Post your questions here.',
21 => 'Do you have a suggestion and ideas for Afterworld? Share your feedback here.',
54 => 'Check here to see the crazy things Afterworld is doing. Contest information can be found here. Afterworld is going to be at various Maker Faires and conferences around the globe. Discuss those events here!',
13 => 'A popular hangout where Afterworldians talk about various topics.',
18 => 'When no other forum makes sense for your post, Off Topic will help it make even less sense.',
32 => 'Talk about what’s going on in your Clans, Groups, Companies, and Guilds, and about the Groups feature in general.',
35 => 'A fast paced community dedicated to mastering the Limited Trades and Sales market, and divining the subtleties of the Afterworld Currency Exchange.',
62 => 'This is where you show off your awesome creations, talk about how to advertise your game or share your marketing and sale tactics.',
40 => 'This is the forum to get help, talk about future Afterworld game ideas, or gather an awesome building team.',
33 => 'This is the place for discussion about scripting. Anything about scripting that is not a help request or topic belongs here.',
42 => 'Talk about your favorite video and computer games outside of Afterworld, with other fanatical video gamers!',
52 => 'This forum is for your sweet game play footage or that awesome viral video you saw on YouTube. Also to talk about your favorite Twitch streamers.',
26 => 'For the many leagues of Afterworld sports, real life sports fans.',
24 => 'Come here to find what Afterworldians think is a must read, see or hear.',
23 => 'The forum for story telling and imagination. Start a role-playing thread here involving your fictional characters, or role-play out a scenario with other players.',
];
foreach ($forumGroups as $groupId => $forums) {
$groupName = htmlspecialchars($groupNames[$groupId] ?? "Group {$groupId}");
echo <<
|
HTML;
foreach ($forums as $forumId => $forumTitle) {
$stmt = $pdo->prepare("SELECT COUNT(*) FROM forums WHERE ForumId = ?");
$stmt->execute([$forumId]);
$totalPosts = (int)$stmt->fetchColumn();
$latestStmt = $pdo->prepare("SELECT Id, PostedAt, UserId FROM forums WHERE ForumId = ? ORDER BY PostedAt DESC LIMIT 1");
$latestStmt->execute([$forumId]);
$latestPost = $latestStmt->fetch(PDO::FETCH_ASSOC);
if ($latestPost) {
$postId = (int)$latestPost['Id'];
$postedAt = date("h:i A", $latestPost['PostedAt']);
$userId = (int)$latestPost['UserId'];
$userStmt = $pdo->prepare("SELECT Username FROM users WHERE UserId = ?");
$userStmt->execute([$userId]);
$username = htmlspecialchars($userStmt->fetchColumn() ?? 'Unknown');
} else {
$postId = 0;
$postedAt = 'N/A';
$username = 'N/A';
}
$escapedTitle = htmlspecialchars($forumTitle);
$forumDesc = htmlspecialchars($forumDescriptions[$forumId] ?? '');
echo <<