$forums[$a["id"]]["topics"][] = array("id" => $a["subid"], "name" => $a["name"], "new" => $a["last_post"] != $a["last_post_read"] ? 1 : 0); } } if ($INSTALLER09['forums_online'] == 0) { $HTMLOUT .= stdmsg('Warning', 'Forums are currently in maintainance mode'); } $HTMLOUT .= "<div class='navigation'><a href='index.php'>" . $INSTALLER09["site_name"] . "</a>\n <br><span class='active'></span></div> <br />"; $ovf_res = sql_query("SELECT id, name, min_class_view FROM over_forums ORDER BY sort ASC") or sqlerr(__FILE__, __LINE__); while ($ovf_arr = mysqli_fetch_assoc($ovf_res)) { if ($CURUSER['class'] < $ovf_arr["min_class_view"]) { continue; } $ovfid = (int) $ovf_arr["id"]; $ovfname = htmlsafechars($ovf_arr["name"]); $HTMLOUT .= "<div class='panel panel-default'><div class='panel-heading'>\n <span class='nav navbar-nav navbar-right'><label for='checkbox_4' class='text-left'>\n </label></span>"; $HTMLOUT .= " <strong><a href='{$INSTALLER09['baseurl']}/forums.php?action=forumview&forid=" . $ovfid . "'>" . $ovfname . "</a></strong></div>\n <div class='table table-responsive table-bordered table-hover'>"; $HTMLOUT .= show_forums($ovfid, false, $forums, true, true); } $HTMLOUT .= ""; if ($Multi_forum['configs']['use_forum_stats_mod']) { $HTMLOUT .= forum_stats(); } $HTMLOUT .= "<div class='col-sm-12 col-sm-offset-0'>\n <p align='center'>\n\t <a href='{$INSTALLER09['baseurl']}/forums.php?action=search'><b class='btn btn-default btn-sm'> Search Forums </b></a> \n\t <a href='{$INSTALLER09['baseurl']}/forums.php?action=viewunread'><b class='btn btn-default btn-sm'> New Posts </b></a> \n\t <a href='{$INSTALLER09['baseurl']}/forums.php?action=getdaily'><b class='btn btn-default btn-sm'> Todays Posts [Last 24h] </b></a> \n\t <a href='{$INSTALLER09['baseurl']}/forums.php?catchup'><b class='btn btn-default btn-sm'> Mark all as read </b></a></p>\n </div><br /><br />"; echo stdhead("Forum", true, $stdhead) . $HTMLOUT . stdfoot($stdfoot); exit; break; } exit('Deary me \\0/'); ?>
$img = get_topic_image("read"); } else { $img = get_topic_image("unread"); } } else { $lastpost = "N/A"; $img = get_topic_image("read"); } $posttodaycount = $Cache->get_value('forum_' . $forumid . '_post_' . $today_date . '_count'); if ($posttodaycount == "") { $res3 = sql_query("SELECT COUNT(posts.id) FROM posts LEFT JOIN topics ON posts.topicid = topics.id WHERE posts.added > " . sqlesc(date("Y-m-d")) . " AND topics.forumid=" . sqlesc($forumid)) or sqlerr(__FILE__, __LINE__); $row3 = mysql_fetch_row($res3); $posttodaycount = $row3[0]; $Cache->cache_value('forum_' . $forumid . '_post_' . $today_date . '_count', $posttodaycount, 1800); } if ($posttodaycount > 0) { $posttoday = " (" . $lang_forums['text_today'] . "<b><font class=\"new\">" . $posttodaycount . "</font></b>)"; } else { $posttoday = ""; } print "<tr><td class=\"rowfollow\" align=\"left\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td class=\"embedded\" style='padding-right: 10px'>" . $img . "</td><td class=\"embedded\"><a href=\"" . htmlspecialchars("?action=viewforum&forumid=" . $forumid) . "\"><font class=\"big\"><b>" . $forumname . "</b></font></a>" . $posttoday . "<br />" . $forumdescription . "</td></tr></table></td><td class=\"rowfollow\" align=\"center\" width=\"1%\">" . $topiccount . "</td><td class=\"rowfollow\" align=\"center\" width=\"1%\">" . $postcount . "</td>" . "<td class=\"rowfollow nowrap\" align=\"left\">" . $lastpost . "</td><td class=\"rowfollow\" align=\"left\">" . $forummoderators . "</td></tr>\n"; } $count++; } // End Table Mod print "</table>"; if ($showforumstats_main == "yes") { forum_stats(); } end_main_frame(); stdfoot();
function boardmain() { global $maxposts; global $userID; global $action; global $loggedin; global $_language; global $maxtopics; $_language->read_module('forum'); $pagebg = PAGEBG; $border = BORDER; $bghead = BGHEAD; $bgcat = BGCAT; eval("\$title_messageboard = \"" . gettemplate("title_messageboard") . "\";"); echo $title_messageboard; if ($action == "markall") { safe_query("UPDATE " . PREFIX . "user SET topics='|' WHERE userID='{$userID}'"); } eval("\$forum_main_head = \"" . gettemplate("forum_main_head") . "\";"); echo $forum_main_head; // KATEGORIEN $sql_where = ''; if (isset($_GET['cat'])) { if (is_numeric($_GET['cat'])) { $sql_where = " WHERE catID='" . $_GET['cat'] . "'"; } } $kath = safe_query("SELECT catID, name, info, readgrps FROM " . PREFIX . "forum_categories" . $sql_where . " ORDER BY sort"); while ($dk = mysql_fetch_array($kath)) { $kathname = "<a href='index.php?site=forum&cat=" . $dk['catID'] . "'>" . $dk['name'] . "</a>"; if ($dk['info']) { $info = $dk['info']; } else { $info = ''; } if ($dk['readgrps'] != "") { $usergrp = 0; $readgrps = explode(";", $dk['readgrps']); foreach ($readgrps as $value) { if (isinusergrp($value, $userID)) { $usergrp = 1; break; } } if (!$usergrp) { continue; } } eval("\$forum_main_kath = \"" . gettemplate("forum_main_kath") . "\";"); echo $forum_main_kath; // BOARDS MIT KATEGORIE $boards = safe_query("SELECT * FROM " . PREFIX . "forum_boards WHERE category='" . $dk['catID'] . "' ORDER BY sort"); $i = 1; while ($db = mysql_fetch_array($boards)) { if ($i % 2) { $bg1 = BG_1; $bg2 = BG_2; } else { $bg1 = BG_3; $bg2 = BG_4; } $ismod = ismoderator($userID, $db['boardID']); $usergrp = 0; $writer = 'ro-'; if ($db['writegrps'] != "" and !$ismod) { $writegrps = explode(";", $db['writegrps']); foreach ($writegrps as $value) { if (isinusergrp($value, $userID)) { $usergrp = 1; $writer = ''; break; } } } else { $writer = ''; } if ($db['readgrps'] != "" and !$usergrp and !$ismod) { $readgrps = explode(";", $db['readgrps']); foreach ($readgrps as $value) { if (isinusergrp($value, $userID)) { $usergrp = 1; break; } } if (!$usergrp) { continue; } } $board = $db['boardID']; $anztopics = $db['topics']; $anzposts = $db['posts']; $boardname = $db['name']; $boardname = '• <a href="index.php?site=forum&board=' . $board . '"><b>' . $boardname . '</b></a>'; if ($db['info']) { $boardinfo = $db['info']; } else { $boardinfo = ''; } $moderators = getmoderators($db['boardID']); if ($moderators) { $moderators = $_language->module['moderated_by'] . ': ' . $moderators; } $postlink = ''; $date = ''; $time = ''; $poster = ''; $member = ''; $q = safe_query("SELECT topicID, lastdate, lastposter, replys FROM " . PREFIX . "forum_topics WHERE boardID='" . $db['boardID'] . "' AND moveID='0' ORDER BY lastdate DESC LIMIT 0," . $maxtopics); $n = 1; $board_topics = array(); while ($lp = mysql_fetch_assoc($q)) { if ($n == 1) { $date = date("d.m.Y", $lp['lastdate']); $today = date("d.m.Y", time()); $yesterday = date("d.m.Y", time() - 3600 * 24); if ($date == $today) { $date = $_language->module['today']; } elseif ($date == $yesterday && $date < $today) { $date = $_language->module['yesterday']; } else { $date = $date; } $time = date("- H:i", $lp['lastdate']); $poster = '<a href="index.php?site=profile&id=' . $lp['lastposter'] . '">' . getnickname($lp['lastposter']) . '</a>'; if (isclanmember($lp['lastposter'])) { $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />'; } else { $member = ''; } $topic = $lp['topicID']; $postlink = 'index.php?site=forum_topic&topic=' . $topic . '&type=ASC&page=' . ceil(($lp['replys'] + 1) / $maxposts); } if ($userID) { $board_topics[] = $lp['topicID']; } else { break; } $n++; } // get unviewed topics $found = false; if ($userID) { $gv = mysql_fetch_array(safe_query("SELECT topics FROM " . PREFIX . "user WHERE userID='{$userID}'")); $array = explode("|", $gv['topics']); foreach ($array as $split) { if ($split != "" and in_array($split, $board_topics)) { $found = true; break; } } } if ($found) { $icon = '<img src="images/icons/boardicons/' . $writer . 'on.gif" alt="' . $_language->module['new_posts'] . '" />'; } else { $icon = '<img src="images/icons/boardicons/' . $writer . 'off.gif" alt="' . $_language->module['no_new_posts'] . '" />'; } eval("\$forum_main_board = \"" . gettemplate("forum_main_board") . "\";"); echo $forum_main_board; $i++; } } // BOARDS OHNE KATEGORIE $boards = safe_query("SELECT * FROM " . PREFIX . "forum_boards WHERE category='0' ORDER BY sort"); $i = 1; while ($db = mysql_fetch_array($boards)) { if ($i % 2) { $bg1 = BG_1; $bg2 = BG_2; } else { $bg1 = BG_3; $bg2 = BG_4; } $usergrp = 0; $writer = 'ro-'; $ismod = ismoderator($userID, $db['boardID']); if ($db['writegrps'] != "" and !$ismod) { $writegrps = explode(";", $db['writegrps']); foreach ($writegrps as $value) { if (isinusergrp($value, $userID)) { $usergrp = 1; $writer = ''; break; } } } else { $writer = ''; } if ($db['readgrps'] != "" and !$usergrp and !$ismod) { $readgrps = explode(";", $db['readgrps']); foreach ($readgrps as $value) { if (isinusergrp($value, $userID)) { $usergrp = 1; break; } } if (!$usergrp) { continue; } } $board = $db['boardID']; $anztopics = $db['topics']; $anzposts = $db['posts']; $boardname = $db['name']; $boardname = '• <a href="index.php?site=forum&board=' . $db['boardID'] . '"><b>' . $boardname . '</b></a>'; $boardinfo = ''; if ($db['info']) { $boardinfo = $db['info']; } $moderators = getmoderators($db['boardID']); if ($moderators) { $moderators = $_language->module['moderated_by'] . ': ' . $moderators; } $q = safe_query("SELECT topicID, lastdate, lastposter, replys FROM " . PREFIX . "forum_topics WHERE boardID='" . $db['boardID'] . "' AND moveID='0' ORDER BY lastdate DESC LIMIT 0," . $maxtopics); $n = 1; $board_topics = array(); while ($lp = mysql_fetch_assoc($q)) { if ($n == 1) { $date = date("d.m.Y", $lp['lastdate']); $today = date("d.m.Y", time()); $yesterday = date("d.m.Y", time() - 3600 * 24); if ($date == $today) { $date = $_language->module['today']; } elseif ($date == $yesterday && $date < $today) { $date = $_language->module['yesterday']; } else { $date = $date; } $time = date("- H:i", $lp['lastdate']); $poster = '<a href="index.php?site=profile&id=' . $lp['lastposter'] . '">' . getnickname($lp['lastposter']) . '</a>'; if (isclanmember($lp['lastposter'])) { $member = ' <img src="images/icons/member.gif" alt="' . $_language->module['clanmember'] . '" />'; } else { $member = ''; } $topic = $lp['topicID']; $postlink = 'index.php?site=forum_topic&topic=' . $topic . '&type=ASC&page=' . ceil(($lp['replys'] + 1) / $maxposts); } if ($userID) { $board_topics[] = $ds['topicID']; } else { break; } $n++; } // get unviewed topics $found = false; if ($userID) { $gv = mysql_fetch_array(safe_query("SELECT topics FROM " . PREFIX . "user WHERE userID='{$userID}'")); $array = explode("|", $gv['topics']); foreach ($array as $split) { if ($split != "" and in_array($split, $board_topics)) { $found = true; break; } } } if ($found) { $icon = '<img src="images/icons/boardicons/' . $writer . 'on.gif" alt="' . $_language->module['new_posts'] . '" />'; } else { $icon = '<img src="images/icons/boardicons/' . $writer . 'off.gif" alt="' . $_language->module['no_new_posts'] . '" />'; } eval("\$forum_main_board = \"" . gettemplate("forum_main_board") . "\";"); echo $forum_main_board; $i++; } eval("\$forum_main_foot = \"" . gettemplate("forum_main_foot") . "\";"); echo $forum_main_foot; if ($loggedin) { eval("\$forum_main_legend = \"" . gettemplate("forum_main_legend") . "\";"); echo $forum_main_legend; } forum_stats(); }