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.. // determine what to do $action = JRequest::getVar('action', 'list'); $cid = JRequest::getVar('cid', array ()); switch ($action) { case _MOD_DELETE: switch (jbDeletePosts($kunena_db, $cid)) { case -1: $app->redirect(KUNENA_LIVEURL . 'func=review&catid=' . $catid, "ERROR: The post has been deleted but the text could not be deleted\n Check the #__fb_messages_text table for mesid IN " . explode(',', $cid)); break; case 0: $app->redirect(KUNENA_LIVEURL . '&func=review&catid=' . $catid, _MODERATION_DELETE_ERROR); break; case 1: default: $app->redirect(KUNENA_LIVEURL . '&func=review&catid=' . $catid, _MODERATION_DELETE_SUCCESS); break; } break; case _MOD_APPROVE: switch (jbApprovePosts($kunena_db, $cid)) { case 0: $app->redirect(KUNENA_LIVEURL . 'amp;func=review&catid=' . $catid, _MODERATION_APPROVE_ERROR); break; default: case 1: $app->redirect(KUNENA_LIVEURL . '&func=review&catid=' . $catid, _MODERATION_APPROVE_SUCCESS); break; } break; default: case 'list': echo '
'; $kunena_db->setQuery("SELECT m.id, m.time, m.name, m.subject, m.hold, t.message FROM #__fb_messages AS m JOIN #__fb_messages_text AS t ON m.id=t.mesid WHERE hold='1' AND catid='{$catid}' ORDER BY id ASC"); if (!$kunena_db->query()) echo $kunena_db->getErrorMsg(); $allMes = $kunena_db->loadObjectList(); check_dberror("Unable to load messages."); if (count($allMes) > 0) jbListMessages($allMes, $catid); else echo '' . _MODERATION_MESSAGES . '
'; break; } /** * Lists messages to be moderated * @param array allMes list of object * @param string fbs action string */ function jbListMessages($allMes, $catid) { $fbConfig =& CKunenaConfig::getInstance(); echo ' setQuery('DELETE FROM `#__fb_messages` WHERE `id` IN (' . $ids . ')'); if ($kunena_db->query()) { $kunena_db->setQuery('DELETE FROM `#__fb_messages_text` WHERE `mesid` IN (' . $ids . ')'); if ($kunena_db->query()) return 1; else return -1; } return 0; } /** * approve selected messages * @param object database * @param array cid post ids */ function jbApprovePosts($kunena_db, $cid) { if (count($cid) == 0) return 0; $ret = 1; reset($cid); foreach($cid as $id) { $id = (int)$id; $newQuery = "SELECT * FROM #__fb_messages WHERE id='{$id}'"; $kunena_db->setQuery($newQuery, 0, 1); $msg = null; $msg = $kunena_db->loadObject(); if(!$msg) { continue; } // continue stats $kunena_db->setQuery("UPDATE `#__fb_messages` SET hold='0' WHERE id='{$id}'"); if(!$kunena_db->query()) { $ret = 0; // mark error } CKunenaTools::modifyCategoryStats($id, $msg->parent, $msg->time, $msg->catid); } return $ret; } ?>