本文整理匯總了PHP中IPSMember::isOnModQueue方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSMember::isOnModQueue方法的具體用法?PHP IPSMember::isOnModQueue怎麽用?PHP IPSMember::isOnModQueue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IPSMember
的用法示例。
在下文中一共展示了IPSMember::isOnModQueue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: canApproveStatus
/**
* Perm Check: Can approve a status
*
* @param array [Array of author data, uses getAuthor if none]
* @param array [Array of status information OR status ID OR uses $this->_internalData['StatusData'] if none]
* @return bool
*/
public function canApproveStatus($author = null, $status = null)
{
$author = $author === null ? $this->getAuthor() : $author;
$status = $status === null ? $this->_internalData['StatusData'] : (is_array($status) ? $status : $this->_loadStatus($status));
if (!$author['member_id'] or !$status['status_id']) {
return FALSE;
}
if (!$this->isEnabled()) {
return FALSE;
}
if (!$author['g_is_supmod']) {
if ($author['member_id'] == $status['status_member_id'] && !IPSMember::isOnModQueue($author['member_id'])) {
return TRUE;
}
return FALSE;
} else {
return true;
}
/* is left by someone else */
if ($status['status_member_id'] != $status['status_author_id'] && $status['status_member_id'] != $author['member_id']) {
return false;
}
return TRUE;
}
示例2: add
/**
* Add a comment
*
* @param Int Parent ID
* @param string Post content
* @param array Member ID of author (current member assumed if empty)
* @return exception or comment ID
*
* EXCEPTION CODES
* NO_PERMISSION Do not have permission to add comment
*/
public function add($parentId, $post, $memberId = null)
{
/* Load member */
$memberData = IPSMember::load($memberId === null ? $this->memberData['member_id'] : $memberId, 'all');
if (!$memberData['member_id']) {
if (!$this->request['comment_name']) {
throw new Exception('NO_NAME');
}
$memberData['members_display_name'] = $this->request['comment_name'];
}
/* Permission test */
$can = $this->can('add', array('comment_parent_id' => $parentId));
if ($can !== true) {
throw new Exception($can);
}
/* Mod queue? */
$modQ = IPSMember::isOnModQueue($memberData);
if ($modQ === NULL) {
throw new Exception('NO_PERMISSION');
}
$classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/editor/composite.php', 'classes_editor_composite');
$editor = new $classToLoad();
$editor->setBbcodeSection($this->bbcodeSection());
$editor->setLegacyMode(false);
$comment = $editor->process($post);
if (!trim($comment)) {
throw new Exception('NO_COMMENT');
}
/* Build insert data */
$array = array('comment_author_id' => intval($memberData['member_id']), 'comment_author_name' => $memberData['members_display_name'], 'comment_ip_address' => $this->member->ip_address, 'comment_date' => time(), 'comment_text' => $comment, 'comment_approved' => $modQ ? 0 : 1, 'comment_parent_id' => $parentId);
/* Pre save */
$insert = $this->preSave('add', $array, 0, $parentId);
/* Insert and fetch DB */
$save = $this->remapToLocal($insert);
if (count($save)) {
$this->DB->insert($this->table(), $save);
$insert['comment_id'] = $this->DB->getInsertId();
}
/* Post save */
$insert = $this->postSave('add', $insert, $insert['comment_id'], $parentId);
/* remove saved content */
if ($this->memberData['member_id']) {
$editor->removeAutoSavedContent(array('member_id' => $this->memberData['member_id'], 'autoSaveKey' => 'comment-' . $this->table() . '-' . $parentId));
}
/* Send notifications */
$this->sendNotifications($this->remapFromLocal($insert), $comment);
return $insert;
}
示例3: _checkPostModeration
/**
* Used when isPublished is set to auto
* @param string $type
* @return boolean
*/
protected function _checkPostModeration($type)
{
$memberData = $this->getAuthor();
/* Does this member have mod_posts enabled? */
if (IPSMember::isOnModQueue($memberData)) {
return FALSE;
}
/* Group can bypass mod queue */
if ($memberData['g_avoid_q']) {
return TRUE;
}
/* Check to see if this forum has moderation enabled */
switch (intval($this->getForumData('preview_posts'))) {
default:
case 0:
return TRUE;
break;
case 1:
return FALSE;
break;
case 2:
return $type == 'new' ? FALSE : TRUE;
break;
case 3:
return $type == 'reply' ? FALSE : TRUE;
break;
}
/* Our post can be seen! */
return TRUE;
}
示例4: editBoxShow
/**
* Shows the edit box
*
* @return @e void
*/
public function editBoxShow()
{
//-----------------------------------------
// INIT
//-----------------------------------------
$pid = intval($this->request['p']);
$fid = intval($this->request['f']);
$tid = intval($this->request['t']);
$show_reason = 0;
//-----------------------------------------
// Check P|T|FID
//-----------------------------------------
if (!$pid or !$tid or !$fid) {
$this->returnString('error');
}
if ($this->memberData['member_id']) {
if (IPSMember::isOnModQueue($this->memberData) === NULL) {
$this->returnJsonError($this->lang->words['ajax_reply_noperm']);
}
}
//-----------------------------------------
// Get classes
//-----------------------------------------
if (!is_object($this->postClass)) {
$this->registry->getClass('class_localization')->loadLanguageFile(array('public_editors'), 'core');
require_once IPSLib::getAppDir('forums') . "/sources/classes/post/classPost.php";
/*noLibHook*/
$classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . '/sources/classes/post/classPostForms.php', 'classPostForms', 'forums');
$this->postClass = new $classToLoad($this->registry);
}
/* Set post class data */
$this->postClass->setForumData($this->registry->getClass('class_forums')->getForumById($fid));
$this->postClass->setTopicID($tid);
$this->postClass->setForumID($fid);
$this->postClass->setPostID($pid);
/* Topic Data */
$this->postClass->setTopicData($this->registry->getClass('topics')->getTopicById($tid));
# Set Author
$this->postClass->setAuthor($this->member->fetchMemberData());
# Get Edit form
try {
$html = $this->postClass->displayAjaxEditForm();
$html = $this->registry->output->replaceMacros($html);
$this->returnHtml($html);
} catch (Exception $error) {
$this->returnString($error->getMessage());
}
}