setQuery("SELECT * FROM #__sb_categories WHERE parent= '0' and published='1' ORDER BY ordering"); $allCat=$database->loadObjectList(); if ( $bPageTitle ) { $mainframe->setPageTitle( _GEN_FORUMLIST.' - '.$sbConfig['board_title'] ); } //debug("timecookie=".date(_DATETIME ,$settings[prevvisit])); foreach ($allCat as $category) { $threadids[]=$category->id; $categories[$category->parent][]=$category; } //Let's check if the only thing we need to show is 1 category if (in_array($catid,$threadids)) { //Yes, so now $threadids should contain only the current $catid: unset($threadids); $threadids[]=$catid; //get new categories list for this category only: unset($categories); $database->setQuery("SELECT * FROM #__sb_categories WHERE parent= '0' and published='1' and id='$catid' ORDER BY ordering"); $categories[$category->parent]=$database->loadObjectList(); } ?>
' ._FORUM_IS_OFFLINE. '' : ' ' ;?>

allowed != "na" && ! $new_sb_user) { $allow_forum=explode(',',$sbSession->allowed); } else { $allow_forum = array(); } ?> ' : _HOME; ?> ' : _GEN_MYPROFILE; ?> ' : _GEN_LATEST_POSTS; ?> ' : _GEN_HELP; ?> '; echo $sbIcons['rules'] ? ''._GEN_RULES.'' : _GEN_RULES; echo ''; }?>

0) { foreach($categories[0] as $cat) { $is_Mod=0; if (!$is_admin) { $database->setQuery("SELECT userid FROM #__sb_moderation WHERE catid='$cat->id' and userid='$my->id'"); if ($database->loadResult() ) {$is_Mod=1;} }else{ $is_Mod=1;} //superadmins always are $letPass=0; //Do user identification based upon the ACL; but don't bother for moderators if (!$is_Mod) {$letPass=sb_auth::validate_user($cat, $allow_forum, $aro_group->group_id, $acl);} if ($letPass || $is_Mod) { //we're in, now set a cookie that this user is allowed to get in here //so we can skip these checks for the rest of this session to avoid performance problems if($allowed_forums=="") { $allowed_forums=$cat->id; } else { $allowed_forums=$allowed_forums.','.$cat->id; } $database->setQuery("UPDATE #__sb_sessions SET allowed='$allowed_forums' WHERE userid=$my->id"); $database->query(); ?> id != 0){echo '';}?> setQuery( "SELECT id, name, locked,review, pub_access, pub_recurse, admin_access, admin_recurse FROM #__sb_categories WHERE parent='$cat->id' and published='1' order by ordering"); $rows = $database->loadObjectList(); $tabclass = array("sectiontableentry1", "sectiontableentry2"); $k=0; foreach($rows as $singlerow) { $is_Mod=0; if (!$is_admin) { $database->setQuery("SELECT userid FROM #__sb_moderation WHERE catid='$singlerow->id' and userid='$my->id'"); if ($database->loadResult() ) {$is_Mod=1;} }else{ $is_Mod=1;} //superadmins always are //Do user identification based upon the ACL; but don't bother for moderators $letPass=0; if (!$is_Mod) {$letPass=sb_auth::validate_user($singlerow, $allow_forum, $aro_group->group_id, $acl);} if ($letPass || $is_Mod) { //we're in, now set a cookie that this user is allowed to get in here //so we can skip these checks for the rest of this session to avoid performance problems if($allowed_forums=="") { $allowed_forums=$singlerow->id; } else { $allowed_forums=$allowed_forums.','.$singlerow->id; } $database->setQuery("UPDATE #__sb_sessions SET allowed='$allowed_forums' WHERE userid=$my->id"); $database->query(); //$k=for alternating row colours: $k=1-$k; //get previous visit time from cookie; if there's no cookie yet, use database stored value if ($settings[prevvisit]==0 && $previousVisit !=0) { $prevCheck= $previousVisit;}else{$prevCheck=$settings[prevvisit];} //count the number of topics posted in each forum $database->setQuery("SELECT id FROM #__sb_messages WHERE catid='$singlerow->id' and parent='0' and hold='0'"); $num = $database->loadObjectList(); $numtopics= count($num); //count the number of replies posted in each forum $database->setQuery("SELECT id FROM #__sb_messages WHERE catid='$singlerow->id' and parent!='0' and hold='0'"); $num = $database->loadObjectList(); $numreplies= count($num); //Get the last post from each forum $database->setQuery("SELECT MAX(time) from #__sb_messages WHERE catid='$singlerow->id' and hold='0' AND moved!='1'"); $lastPosttime=$database->loadResult(); $lastPosttime=(int)$lastPosttime; if ($my->id !=0){ //get all threads with posts after the users last visit; don't bother for guests $database->setQuery("SELECT thread from #__sb_messages where catid='$singlerow->id' and hold='0' and time>$prevCheck group by thread"); $newThreadsAll=$database->loadObjectList(); //Get the topics this user has already read this session from #__sb_sessions $readTopics=""; $database->setQuery("SELECT readtopics FROM #__sb_sessions WHERE userid=$my->id"); $readTopics=$database->loadResult(); //make it into an array $read_topics=explode(',',$readTopics); } //Get the forumdescription $database->setQuery("SELECT description from #__sb_categories where id='$singlerow->id'"); $forumDesc=$database->loadResult(); //get pending messages if user is a Moderator for that forum $database->setQuery("SELECT userid FROM #__sb_moderation WHERE catid='$singlerow->id'"); $moderatorList=$database->loadObjectList(); $modIDs[]=array(); array_splice($modIDs,0); if(count($moderatorList)>0) { foreach($moderatorList as $ml) { $modIDs[]=$ml->userid; } } $nummodIDs=count($modIDs); $numPending=0; if ((in_array($my_id, $modIDs)) || $is_admin==1) { $database->setQuery("select count(*) from #__sb_messages where catid='$singlerow->id' and hold='1'"); $numPending=$database->loadResult(); $is_Mod=1; } $numPending=(int)$numPending; //get latest post info $latestname = ""; $latestcatid = ""; $latestid = ""; $database->setQuery("SELECT id, catid,name from #__sb_messages WHERE time=$lastPosttime and hold='0' and moved!='1'"); $latestpost=$database->loadObjectList(); foreach ($latestpost as $lp) { $latestname = $lp->name; $latestcatid = $lp->catid; $latestid = $lp->id; } echo ''; if ($sbConfig['showNew'] && $my->id !=0){ //Check if unread threads are in any of the forums topics $newPostsAvailable=0; foreach ($newThreadsAll as $nta) { if ( in_array($nta->thread,$read_topics)){ //$newPostsAvailable=0; }else{$newPostsAvailable++;} } if ( $newPostsAvailable>0 && count($newThreadsAll)!=0 ){ echo ''; }else{ echo ''; } } echo '"; echo ""; echo ""; if ($numtopics != 0) { ?> ' ._NO_POSTS. ''; } } } //echo ""; } } if ($my->id != 0){ echo ''; echo ''; } if ($lockedForum==1) { ?> ' : ' '._GEN_LOCKED_FORUM.' - '._GEN_LOCKED_FORUM.''; } if ($moderatedForum==1) { ?> ' : ' '._GEN_MODERATED.' - '._GEN_MODERATED.''; } } else { ?> '; ?>
id).'">'.$cat->name.'';?>
 
'; echo $sbIcons['unreadforum'] ? ''._GEN_FORUM_NEWPOST.'' : $sbConfig['newChar']; echo ''; echo $sbIcons['readforum'] ? ''._GEN_FORUM_NOTNEW.'' : $sbConfig['newChar']; echo ''.$singlerow->name.''; if ($singlerow->locked) { echo $sbIcons['forumlocked'] ? '  '._GEN_LOCKED_FORUM.'' : '  '._GEN_LOCKED_FORUM.''; $lockedForum=1; }else{echo "";} if ($singlerow->review) { echo $sbIcons['forummoderated'] ? '  '._GEN_MODERATED.'' : '  '._GEN_MODERATED.''; $moderatedForum=1; }else{echo "";} if ($forumDesc != "") { echo "
$forumDesc"; } if ($numPending>0) { echo '
'.$numPending.' '._LISTCAT_PENDING.''; } echo "
$numtopics$numreplies
' : ' '._SHOW_LAST.''; ?>
'; echo '
'; //echo $sbIcons['markAllForumsRead'] ? ''._GEN_MARK_ALL_FORUMS_READ.' - ' : _GEN_MARK_ALL_FORUMS_READ; echo '
'; echo ''; echo $sbIcons['unreadforum'] ? ''._GEN_FORUM_NEWPOST.'' : $sbConfig['newChar']; echo ' - '._GEN_FORUM_NEWPOST.'
'; echo $sbIcons['readforum'] ? ''._GEN_FORUM_NOTNEW.'' : $sbConfig['newChar']; echo ' - '._GEN_FORUM_NOTNEW.'
- '._GEN_LOCKED_FORUM.'
- '._GEN_MODERATED.'

'; echo _LISTCAT_ADMIN.'
'; echo _LISTCAT_PANEL.'

'; echo _LISTCAT_INFORM.'

'; echo _LISTCAT_DO.' '; ?>

'._LISTCAT_RSS.' - '._LISTCAT_RSS.'