setQuery("SELECT userid FROM #__sb_moderation WHERE catid='$catid' and userid='$my->id'"); if ($database->loadResult() ) {$is_Mod=1;} }else{ $is_Mod=1;} //superadmins always are unset($allow_forum); $allow_forum=array(); //get the db data with allowed forums and turn it into an array if ($sbSession->allowed != "na" && ! $new_sb_user) { $allow_forum=explode(',',$sbSession->allowed); } else { //get only the public accessible forums.. $database->setQuery( "SELECT id FROM #__sb_categories WHERE published='1' AND pub_access='0'"); $allowed_forums=$database->loadObjectList(); $i=0; foreach ($allowed_forums as $af){ if (count ($allow_forum) == 0 ){ $allow_forum[0]=$af->id; } else { $allow_forum[$i]=$af->id; $i++; } } } if (!$is_Mod){ //check Access Level Restrictions but don't bother for Moderators //get all the info on this forum: $database->setQuery("SELECT id,pub_access,pub_recurse,admin_access,admin_recurse FROM #__sb_categories where id='$catid'"); $row=$database->loadObjectList(); //Do user identification based upon the ACL $letPass=0; $letPass=sb_auth::validate_user($row[0], $allow_forum, $aro_group->group_id, $acl); } if ($letPass || $is_Mod) { $threads_per_page=$sbConfig['threads_per_page']; if ($catid <= 0 ) { //make sure we got a valid category id $catid=1; } $view=$view==""?$settings[current_view]:$view; setcookie("sboard_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; $database->setQuery("Select count(*) FROM #__sb_messages WHERE parent = '0' AND catid= '$catid' AND hold = '0' "); $total=(int)$database->loadResult(); $database->setQuery("SELECT a. * , MAX( b.time ) AS lastpost FROM #__sb_messages AS a LEFT JOIN #__sb_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 LIMIT $offset,$row_count"); foreach ($database->loadObjectList() as $message) { $threadids[]=$message->id; $messages[$message->parent][]=$message; $last_reply[$message->id] = $message; $hits[$message->id]=$message->hits; } if (count($threadids) > 0) { $idstr = @join("','",$threadids); $database->setQuery("SELECT id,parent,thread,catid,subject,name,time,topic_emoticon,locked,ordering, moved FROM #__sb_messages WHERE thread IN ('$idstr') AND id NOT IN ('$idstr') and hold=0"); foreach ($database->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 $database->setQuery("select count(*) from #__sb_messages where catid='$catid' and hold=1"); $numPending=$database->loadResult(); //@rsort($messages[0]); ?> "; echo " "; //Get the category name for breadcrumb $database->setQuery("SELECT name,locked,review, parent from #__sb_categories where id='$catid'"); $database->loadObject($objCatInfo); //Get the Category's parent category name for breadcrumb $database->setQuery("SELECT name,id FROM #__sb_categories WHERE id='$objCatInfo->parent'"); $database->loadObject($objCatParentInfo); if ( $bPageTitle ) { $mainframe->setPageTitle( $objCatParentInfo->name.' - '.$objCatInfo->name.' - '.$sbConfig['board_title'] ); } //check if this forum is locked $forumLocked=$objCatInfo->locked; //check if this forum is subject to review $forumReviewed=$objCatInfo->review; echo ""; /* RODAX SOFTWARE echo '"; echo " "; echo " '._GEN_POST_NEW_TOPIC.''; }else{ echo ''; } }?> id != 0){ echo ''; echo ''; } ?> setQuery("select * from #__sb_moderation left join #__users on #__users.id=#__sb_moderation.userid where #__sb_moderation.catid=$catid"); $modslist=$database->loadObjectList(); ?>
' ._FORUM_IS_OFFLINE.'' : ' ' ;?>

' : _HOME; ?> ' : _GEN_MYPROFILE; ?> '; echo $sbIcons['threadedview'] ? ''._GEN_THREADED_VIEW.'' : _GEN_THREADED_VIEW; echo ''; } else { echo $sbIcons['flatview'] ?'':'| '; echo ''; echo $sbIcons['flatview'] ? ''._GEN_FLAT_VIEW.'' : _GEN_FLAT_VIEW; echo ""; } if ($is_moderator || $is_admin){ if ($numPending>0) { $numcolor=''; echo $sbIcons['pendingmessages'] ?'':' | '; echo ' '; echo $sbIcons['pendingmessages'] ? ''.$numPending.' '._SHOWCAT_PENDING.'' : $numcolor.''.$numPending.' '._SHOWCAT_PENDING; echo ''; }else{ echo $sbIcons['nopendingmsgs'] ? ''._SHOWCAT_NOPENDING.'' : ' | '._SHOWCAT_NOPENDING; } } /* RODAX SOFTWARE echo $sbIcons['help'] ?'':' | '; echo ''; echo $sbIcons['help'] ? ''._GEN_HELP.'' : _GEN_HELP; echo ''; */ // add lines for new rules menu item if ( $sbConfig['enableRulesPage'] ) { echo $sbIcons['rules'] ?'':' | '; echo ''; echo $sbIcons['rules'] ? ''._GEN_RULES.'' : _GEN_RULES; echo ''; } echo '
'; //post new topic echo "
"; if ((($sbConfig['pubwrite']==0 && $my_id != 0)||$sbConfig['pubwrite']==1) && ($topicLock==0 || ($topicLock==1 && $is_moderator))) { //this user is allowed to post a new topic: if ($sbIcons['new_topic']){ echo ''._GEN_POST_NEW_TOPIC.''; } else{ echo ''._GEN_POST_NEW_TOPIC.''; } } echo '
'; //pagination 1 if (count($messages[0]) > 0) { echo _PAGE; if (($page-2) > 1) { echo '1 '; echo "... "; } 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 ''.$i.' '; } } if ($page+2 < ceil($total/$threads_per_page)) { echo "... "; echo ''.ceil($total/$threads_per_page).''; } } echo "
'._GEN_PATHWAY; echo ''; echo $sbIcons['forumlist'] ? ''._GEN_FORUMLIST.' > ' : _GEN_FORUMLIST; echo ' '.$objCatParentInfo->name.' '.$objCatInfo->name.' '; */ if ($forumLocked) { echo $sbIcons['forumlocked'] ? ''._GEN_LOCKED_FORUM.'' : ' '._GEN_LOCKED_FORUM.''; $lockedForum=1; }else{echo "";} if ($forumReviewed) { echo $sbIcons['forummoderated'] ? ''._GEN_MODERATED.'' : ' '._GEN_MODERATED.''; $moderatedForum=1; }else{echo "";} echo "
"; //get time of last visit if ($settings[prevvisit]==0 && $previousVisit !=0) { $prevCheck= $previousVisit;}else{$prevCheck=$settings[prevvisit];} //get all readTopics in an array $readTopics=""; $database->setQuery("SELECT readtopics FROM #__sb_sessions WHERE userid=$my->id"); $readTopics=$database->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") include_once($sbp.'/flat.php'); else include_once($sbp.'/thread.php'); } else { echo "

"; echo '

'._SHOWCAT_NO_TOPICS; echo "

"; }?>
0) { echo _PAGE; if (($page-2) > 1) { echo '1 '; echo "... "; } 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 ''.$i.' '; } } if ($page+2 < ceil($total/$threads_per_page)) { echo "... "; echo ''.ceil($total/$threads_per_page).''; } } ?>
 
'._GEN_POST_NEW_TOPIC.'
'; echo $sbIcons['markThisForumRead'] ? ''._GEN_MARK_THIS_FORUM_READ.' - ' : _GEN_MARK_THIS_FORUM_READ; echo '
'; echo ''; echo $sbIcons['unreadmessage'] ? ''._GEN_UNREAD.'' : $sbConfig['newChar']; echo ' - '._GEN_UNREAD.'
'; echo $sbIcons['readmessage'] ? ''._GEN_NOUNREAD.'' : $sbConfig['newChar']; echo ' - '._GEN_NOUNREAD.'
- '._GEN_LOCKED_TOPIC.'
': ''._GEN_LOCKED_TOPIC.' - '._GEN_LOCKED_TOPIC.'
'; } if ($topicSticky) { echo $sbIcons['topicsticky'] ? ''._GEN_ISSTICKY.' - '._GEN_ISSTICKY.'' : ''._GEN_ISSTICKY.' - '._GEN_ISSTICKY.''; } ?>
- '._GEN_LOCKED_FORUM.'
' : ' '._GEN_LOCKED_FORUM.' - '._GEN_LOCKED_FORUM.'
'; }else{echo "";} if ($moderatedForum==1) { echo $sbIcons['forummoderated'] ? ''._GEN_MODERATED.' - '._GEN_MODERATED.'' : ' '._GEN_MODERATED.' - '._GEN_MODERATED.''; }else{echo "";} ?> 0) { echo '
'._GEN_MODERATORS.": "; foreach ($modslist as $mod) { echo " $mod->username "; } } ?>
setQuery( "SELECT id, name, parent FROM #__sb_categories WHERE parent='$category' and published='1' order by ordering"); $forums = $database->loadObjectList(); foreach ($forums as $forum) { if (in_array($forum->id, $allow_forum)) { echo (""); } showChildren($forum->id,$prefix."  ", $allow_forum); } } ?>