id > 0){ $database->setQuery("SELECT allowed FROM #__sb_sessions WHERE userid='".$my->id."'"); $ResultSet=$database->loadResult(); if ($ResultSet=="na"){ mosRedirect($mosConfig_live_site.'/index.php?option=com_simpleboard&Itemid='.$_GET['Itemid'].'&func=listcat',_LATEST_REDIRECT); return; } //$allowed_forums = explode (',',$ResultSet); } else { $database->setQuery("SELECT id FROM #__sb_categories WHERE pub_access='0'"); $allowed_forums=$database->loadObjectList(); foreach ($allowed_forums as $af) { if ($ResultSet == "" ) { $ResultSet = $af->id; } else { $ResultSet = $ResultSet.','.$af->id; } } } //start the latest x if ($sel=="0"){ $querytime=($prevCheck-1800); //move 30 minutes back to compensate for expired sessions }else{ if (""==$sel){$sel=4;} //take 4 hours as default //Time translation $back_time=$sel*3600; //hours*(mins*secs) $querytime=time()-$back_time; } // get all the threads with posts in the specified timeframe $database->setQuery("SELECT a.thread, b.subject FROM #__sb_messages AS a LEFT JOIN #__sb_messages AS b ON a.thread=b.thread WHERE a.time >'$querytime' AND b.parent=0 AND a.catid IN ($ResultSet) AND a.moved != 1 GROUP BY a.thread ORDER BY a.time DESC LIMIT 100"); $resultSet=$database->loadObjectList(); $countRS=count($resultSet); //check if $sel has a reasonable value and not a Unix timestamp: $since=false; if ($sel == "0") {$lastvisit=date(_DATETIME , $querytime); $since=true;} ?>
' ._FORUM_IS_OFFLINE. '' : ' ' ;?>

' : _HOME; ?> ' : _GEN_HELP; ?> '; echo $sbIcons['rules'] ? ''._GEN_RULES.'' : _GEN_RULES; echo ''; }?>

()

| | | | | |

setQuery("SELECT max(time) FROM #__sb_messages where thread=$rs->thread"); $latestPostTime=$database->loadResult(); //get the latest post itself $result=""; $database->setQuery("SELECT a.id,a.name,a.catid,b.name as catname from #__sb_messages as a LEFT JOIN #__sb_categories as b on a.catid=b.id where a.time=$latestPostTime"); $database->loadObject($result); $latestPostId=$result->id; $latestPostName=$result->name; $latestPostCatid=$result->catid; $catname=$result->catname; $database->setQuery("SELECT count(*) from #__sb_messages where time>'$querytime' and thread=$rs->thread"); $numberOfPosts=$database->loadResult(); $k= 1- $k; echo ""; echo ''; echo ''; echo ""; echo ""; echo ""; } } else { echo ""; } echo "
'.htmlspecialchars(stripslashes($rs->subject)).'
'._GEN_FORUM.' : '.$catname.'
'.$numberOfPosts.'".htmlspecialchars($latestPostName)."".date(_DATETIME,$latestPostTime)."
"._NO_TIMEFRAME_POSTS."
"; ?>