allowed <> '')?explode(',', $fbSession->allowed):array(); if (in_array($catid, $allow_forum)) { $threads_per_page = $fbConfig->threads_per_page; if ($catid <= 0) { //make sure we got a valid category id $catid = 1; } $view = $view == "" ? $settings[current_view] : $view; setcookie("fboard_settings[current_view]", $view, time() + 31536000, '/'); /*//////////////// Start selecting messages, prepare them for threading, etc... /////////////////*/ $page = (int)$page; $page = $page < 1 ? 1 : $page; $offset = ($page - 1) * $threads_per_page; $row_count = $page * $threads_per_page; $kunena_db->setQuery("SELECT COUNT(*) FROM #__fb_messages WHERE parent='0' AND catid='{$catid}' AND hold='0'"); $total = (int)$kunena_db->loadResult(); check_dberror("Unable to load messages."); $kunena_db->setQuery( "SELECT a.*, MAX(b.time) AS lastpost FROM #__fb_messages AS a LEFT JOIN #__fb_messages AS b ON b.thread = a.thread WHERE a.parent='0' AND a.catid='{$catid}' AND a.hold='0' GROUP BY id ORDER BY ordering DESC, lastpost DESC", $offset, $threads_per_page); $threadids = array(); $messages = array(); $messages[0] = array(); $thread_counts = array(); foreach ($kunena_db->loadObjectList()as $message) { $threadids[] = $message->id; $messages[$message->parent][] = $message; $last_reply[$message->id] = $message; $hits[$message->id] = $message->hits; $thread_counts[$message->id] = 0; } if (count($threadids) > 0) { $idstr = @join("','", $threadids); $kunena_db->setQuery("SELECT a.* FROM #__fb_messages AS a WHERE thread IN ('$idstr') AND id NOT IN ('$idstr') and hold='0'"); foreach ($kunena_db->loadObjectList()as $message) { $messages[$message->parent][] = $message; $thread_counts[$message->thread]++; $last_reply[$message->thread] = ($last_reply[$message->thread]->time < $message->time) ? $message : $last_reply[$message->thread]; } } //get number of pending messages $kunena_db->setQuery("SELECT COUNT(*) FROM #__fb_messages WHERE catid='{$catid}' AND hold='1'"); $numPending = $kunena_db->loadResult(); check_dberror("Unable to load messages."); //@rsort($messages[0]); //Get the category name for breadcrumb unset($objCatInfo, $objCatParentInfo); $kunena_db->setQuery("SELECT * FROM #__fb_categories WHERE id='{$catid}'"); $objCatInfo = $kunena_db->loadObject(); //Get the Category's parent category name for breadcrumb $kunena_db->setQuery("SELECT name, id FROM #__fb_categories WHERE id='{$objCatInfo->parent}'"); $objCatParentInfo = $kunena_db->loadObject(); //check if this forum is locked $forumLocked = $objCatInfo->locked; //check if this forum is subject to review $forumReviewed = $objCatInfo->review; ?> headerdesc) { ?>
headerdesc, 0, $fbConfig->disemoticons, $smileyList)); $headerdesc = nl2br($headerdesc); //wordwrap: $headerdesc = smile::htmlwrap($headerdesc, $fbConfig->wrap); echo $headerdesc; ?>
'; echo CKunenaLink::GetSamePageAnkerLink('forumbottom', isset($fbIcons['bottomarrow']) ? '' . _GEN_GOTOBOTTOM . '' : _GEN_GOTOBOTTOM); ?> id > 0 || $fbConfig->pubwrite))) { //this user is allowed to post a new topic: echo CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '' . _GEN_POST_NEW_TOPIC . '' : _GEN_POST_NEW_TOPIC); } echo ''; //pagination 1 if (count($messages[0]) > 0) { echo '
'. _PAGE; if (($page - 2) > 1) { echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel='follow', $class='jr-pagenav-nb'); } for ($i = ($page - 2) <= 0 ? 1 : ($page - 2); $i <= $page + 2 && $i <= ceil($total / $threads_per_page); $i++) { if ($page == $i) { echo "
$i
"; } else { echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel='follow', $class='jr-pagenav-nb'); } } if ($page + 2 < ceil($total / $threads_per_page)) { echo "
... 
"; echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, ceil($total / $threads_per_page), ceil($total / $threads_per_page), $rel='follow', $class='jr-pagenav-nb'); } echo '
'; } ?>
setQuery("SELECT readtopics FROM #__fb_sessions WHERE userid='{$kunena_my->id}'"); $readTopics = $kunena_db->loadResult(); if (count($readTopics) == 0) { $readTopics = "0"; } //make sure at least something is in there.. //make it into an array $read_topics = explode(',', $readTopics); if (count($messages) > 0) { if ($view == "flat") if (file_exists(KUNENA_ABSTMPLTPATH . '/flat.php')) { include(KUNENA_ABSTMPLTPATH . '/flat.php'); } else { include(KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'flat.php'); } else if (file_exists(KUNENA_ABSTMPLTPATH . '/thread.php')) { include(KUNENA_ABSTMPLTPATH . '/thread.php'); } else { include(KUNENA_PATH_TEMPLATE_DEFAULT .DS. 'thread.php'); } } else { echo "

"; echo '

' . _SHOWCAT_NO_TOPICS; echo "

"; } ?>
'; echo CKunenaLink::GetSamePageAnkerLink('forumtop', isset($fbIcons['toparrow']) ? '' . _GEN_GOTOTOP . '' : _GEN_GOTOTOP); ?> id > 0 || $fbConfig->pubwrite))) { //this user is allowed to post a new topic: echo CKunenaLink::GetPostNewTopicLink($catid, isset($fbIcons['new_topic']) ? '' . _GEN_POST_NEW_TOPIC . '' : _GEN_POST_NEW_TOPIC); } echo ''; //pagination 2 if (count($messages[0]) > 0) { echo '
'. _PAGE; if (($page - 2) > 1) { echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, 1, 1, $rel='follow', $class='jr-pagenav-nb'); } for ($i = ($page - 2) <= 0 ? 1 : ($page - 2); $i <= $page + 2 && $i <= ceil($total / $threads_per_page); $i++) { if ($page == $i) { echo "
$i
"; } else { echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, $i, $i, $rel='follow', $class='jr-pagenav-nb'); } } if ($page + 2 < ceil($total / $threads_per_page)) { echo "
... 
"; echo ' '.CKunenaLink::GetCategoryPageLink('showcat', $catid, ceil($total / $threads_per_page), ceil($total / $threads_per_page), $rel='follow', $class='jr-pagenav-nb'); } echo '
'; } ?>
id != 0) { echo CKunenaLink::GetCategoryLink('markthisread', $catid, isset($fbIcons['markThisForumRead']) ? '' . _GEN_MARK_THIS_FORUM_READ . '' : _GEN_MARK_THIS_FORUM_READ, $rel='nofollow'); } ?> username ? "username" : "name"; $kunena_db->setQuery("select m.userid, u.{$fb_queryName} AS username FROM #__fb_moderation AS m LEFT JOIN #__users AS u ON u.id=m.userid WHERE m.catid='{$catid}'"); $modslist = $kunena_db->loadObjectList(); check_dberror("Unable to load moderators."); ?> 0) { ?>
userid, ($fbConfig->username ? $mod->username : $mod->name)).'  '; } ?>
enableforumjump) require_once (KUNENA_PATH_LIB .DS. 'kunena.forumjump.php'); ?>
id != 0) { echo isset($fbIcons['unreadmessage']) ? '' . _GEN_UNREAD . '' : $fbConfig->newchar; echo ' - ' . _GEN_UNREAD . ''; } ?>
id != 0) { echo isset($fbIcons['readmessage']) ? '' . _GEN_NOUNREAD . '' : $fbConfig->newchar; echo ' - ' . _GEN_NOUNREAD . ''; } ?>
- ' . _GEN_MODERATED . '' : ' ' . _GEN_MODERATED . ' - ' . _GEN_MODERATED . ''; } else { echo ""; } ?>
- ' . _GEN_LOCKED_TOPIC . '' : '' . _GEN_LOCKED_TOPIC . ' - ' . _GEN_LOCKED_TOPIC . ''; } ?>
- ' . _GEN_ISSTICKY . '' : '' . _GEN_ISSTICKY . ' - ' . _GEN_ISSTICKY . ''; } ?>
- ' . _GEN_LOCKED_FORUM . '' : ' ' . _GEN_LOCKED_FORUM . ' - ' . _GEN_LOCKED_FORUM . ''; echo '
'; } else { echo ""; } ?>
enableforumjump) { ?>
setQuery("SELECT id, name, parent FROM #__fb_categories WHERE parent='{$category}' AND published='1' ORDER BY ordering"); $forums = $kunena_db->loadObjectList(); check_dberror("Unable to load categories."); foreach ($forums as $forum) { if (in_array($forum->id, $allow_forum)) { echo(""); } showChildren($forum->id, $prefix . "---", $allow_forum); } } ?>