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) { die ("You are not a moderator!!
This error is logged and your IP address has been sent to the SuperAdmin(s) of this site; sorry..");} //but we don't send the email; we might do that in the future, but for now we just want to scare 'em off.. //TODO: need to check if the mod has privs on this particular forum... no rush; we trust mods, don't we? //****************************** //LIST MESSAGES //****************************** if ($action == "list" ){ ?> setQuery("SELECT * FROM #__sb_messages WHERE hold='1' AND catid=$catid ORDER BY id ASC"); $allMes=$database->loadObjectList(); $i=1; foreach ($allMes as $message){ $threadids[]=$message->id; $messages[$message->pending][]=$message; $database->setQuery("SELECT message FROM #__sb_messages_text WHERE mesid='$message->id'"); $num = $database->loadObjectList(); $numtopics=count($num); $i= 1-$i; foreach($num as $messrow){} echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; $nummess++; } if($nummess==0){ ?>

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

".date(_DATETIME , $message->time)."$message->name$message->subject".smile::smileReplace($messrow->message,0,$sbs,$sbConfig['disemoticons']).""; echo "
"; $name= _MOD_APPROVE; echo "id>"; echo ""; echo ""; echo "
"; echo "
"; $name= _MOD_DELETE; echo "id>"; echo ""; echo ""; echo "
"; echo "
 

 
 
setQuery("delete from `#__sb_messages` WHERE `id` = $id"); if($database->query()){ $database->setQuery("delete from `#__sb_messages_text` WHERE `mesid` = '$id'"); if ($database->query()){ // sbRedirect ('index.php?option=com_simpleboard&Itemid='.$Itemid.'&func=review&action=list&catid='.$catid,3500,_POST_SUCCESS_DELETE); mosRedirect( "index.php?option=$option&Itemid=$Itemid&func=review&action=list&catid=$catid", "The post has been deleted" ); } else{ // sbRedirect('index.php?option=com_simpleboard&Itemid='.$Itemid.'&func=review&action=list&catid='.$catid,3500,"ERROR: The post has been deleted but the text could not be deleted\n Check the #__sb_messages_text tabe for mesid=$id"); mosRedirect( "index.php?option=$option&Itemid=$Itemidfunc=review&action=list&catid=$catid", "ERROR: The post has been deleted but the text could not be deleted\n Check the #__sb_messages_text tabe for mesid=$id." ); } }else{ // sbRedirect('index.php?option=com_simpleboard&Itemid='.$Itemid.'&func=review&action=list&catid='.$catid,3500,"ERROR: The post could not be deleted"); mosRedirect( "index.php?option=$option&Itemid=$Itemid&func=review&action=list&catid=$catid", "ERROR: The post could not be deleted" ); } } //****************************** //APPROVE A MESSAGE //****************************** else if ($action=="approve"){ require_once("$sbp/sb_helpers.php"); $id = intval( mosgetParam( $_REQUEST, 'id' , 1 ) ); $catid = intval( mosgetParam( $_REQUEST, 'catid', 1 ) ); $database->setQuery("UPDATE `#__sb_messages` SET `hold` ='0' WHERE `id` = '$id'"); if($database->query()){ // sbRedirect('index.php?option=com_simpleboard&Itemid='.$Itemid.'&func=review&action=list&catid='.$catid,3500,"The post has been approved."); mosRedirect( "index.php?option=$option&Itemid=$Itemid&func=review&action=list&catid=$catid", "The post has been approved" ); }else{ // sbRedirect('index.php?option=com_simpleboard&Itemid='.$Itemid.'&func=review&action=list&catid='.$catid,3500,"ERROR: The post could not be approved."); mosRedirect( "index.php?option=$option&Itemid=$Itemid&func=review&action=list&catid=$catid", "ERROR: The post could not be approved" ); } } ?>