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 if (!$is_Mod){ //check Access Level Restrictions but don't bother for Moderators unset($allow_forum); $allow_forum=array(); //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(); if ($sbSession->allowed != "na" && ! $new_sb_user) { $allow_forum=explode(',',$sbSession->allowed); } else { $allow_forum = array(); } //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) { $view=$view==""?$settings[current_view]:$view; setcookie("sboard_settings[current_view]",$view,time()+31536000,'/'); ?> setQuery("SELECT * FROM #__sb_messages AS a LEFT JOIN #__sb_messages_text AS b ON a.id=b.mesid WHERE a.id='$id' and a.hold=0"); $database->query(); if ($database->getNumRows()== 0) { echo '
'._MODERATION_INVALID_ID.'
\n'; } else { $database->loadObject($this_message); $thread = $this_message->parent==0?$this_message->id:$this_message->thread; if ($my->id != 0){ //get time of last visit if ($settings[prevvisit]==0 && $previousVisit !=0) { $prevCheck= $previousVisit;}else{$prevCheck=$settings[prevvisit];} //mark this topic as read $readTopics=""; $database->setQuery("SELECT readtopics FROM #__sb_sessions WHERE userid=$my->id"); $readTopics=$database->loadResult(); if ($readTopics==""){ $readTopics=$thread; $read_topics=array(); $read_topics=("$thread"); } else{ //get all readTopics in an array $read_topics=explode(',',$readTopics); if (!in_array($thread,$read_topics)){ $readTopics=$readTopics.",".$thread; } } $database->setQuery("UPDATE #__sb_sessions set readtopics='$readTopics' WHERE userid=$my->id"); $database->query(); } //update the hits counter for this topic $database->setQuery("UPDATE #__sb_messages SET hits=hits+1 WHERE id=$thread AND parent=0"); $database->query(); // changed to 0 to fix the missing post when the thread splits over multiple pages $i=0; if ($sbConfig['cb_profile'] && $my->id!=0) { $database->setQuery("SELECT sbordering from #__comprofiler where user_id=$my->id"); $sbordering=$database->loadResult(); if ($sbordering == "_UE_SB_ORDERING_OLDEST") { $orderingNum = 0; } else { $orderingNum = 1; } } else { $database->setQuery("SELECT ordering from #__sb_users where userid=$my->id"); $orderingNum=$database->loadResult(); } $ordering = $orderingNum ? 'DESC' : 'ASC'; $database->setQuery("SELECT * FROM #__sb_messages AS a LEFT JOIN #__sb_messages_text AS b ON a.id=b.mesid WHERE (a.thread='$thread' OR a.id='$thread') AND a.hold=0 ORDER BY a.time $ordering"); if ($view != "flat") $flat_messages[]=$this_message; foreach ($database->loadObjectList() as $message) { if ($view == "flat") { $flat_messages[]=$message; if ($id==$message->id){ $idmatch=$i; } $i++; } else { $messages[$message->parent][]=$message; } } if ($view == "flat") { //prepare threading $limit = $sbConfig['messages_per_page']; if ($idmatch > $limit) {$limitstart=(floor( $idmatch/$limit))*$limit;}else{$limitstart=0;} $limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', $limitstart ) ); $total=count($flat_messages); if ($total > $limit) { require_once( "$map/includes/pageNavigation.php" ); $pageNav = new mosPageNav( $total, $limitstart, $limit ); // slice out elements based on limits $flat_messages = array_slice( $flat_messages, $pageNav->limitstart, $pageNav->limit ); } else { $total=0; } } //Get the category name for breadcrumb $database->setQuery("SELECT name, parent from #__sb_categories where id='$catid'"); $database->loadObject($objCatInfo); //Get Parent's cat.name for breadcrumb $database->setQuery("SELECT name,id from #__sb_categories WHERE id='$objCatInfo->parent'"); $database->loadObject($objCatParentInfo); //data ready display now ?>| writePagesLinks( "index.php?option=com_simpleboard&Itemid=$Itemid&func=view&id=$id&catid=$catid" );?> |
| setQuery("SELECT thread from #__sb_subscriptions where userid=$my_id and thread='$sb_thread'"); $sb_subscribed=$database->loadResult(); if ($sb_subscribed == ""){$sb_cansubscribe=1;} else {$sb_cansubscribe=0;} } if($my_id != 0 && $sbConfig['allowsubscriptions'] == 1 && $sb_cansubscribe == 1 ) {?> ' : _VIEW_SUBSCRIBE;?> | |
| ";
if ((($sbConfig['pubwrite']==0 && $my_id != 0)||$sbConfig['pubwrite']==1) && ($topicLock==0 || ($topicLock==1 && $is_moderator))) {
if ($sbIcons['new_topic']){
echo ' |