當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DiscussHelper::isModerator方法代碼示例

本文整理匯總了PHP中DiscussHelper::isModerator方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiscussHelper::isModerator方法的具體用法?PHP DiscussHelper::isModerator怎麽用?PHP DiscussHelper::isModerator使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DiscussHelper的用法示例。


在下文中一共展示了DiscussHelper::isModerator方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: removeLocation

 /**
  * Remove a location from a post.
  *
  * @since	3.0
  * @access	public
  */
 public function removeLocation($id)
 {
     $ajax = new Disjax();
     $post = DiscussHelper::getTable('Post');
     $state = $post->load($id);
     $my = JFactory::getUser();
     if (!$id || !$state) {
         echo JText::_('COM_EASYDISCUSS_INVALID_ID');
         return $ajax->send();
     }
     if ($post->user_id != $my->id && !DiscussHelper::isModerator($post->category_id)) {
         echo JText::_('COM_EASYDISCUSS_NOT_ALLOWED_TO_REMOVE_LOCATION_FOR_POST');
         return $ajax->send();
     }
     // Update the address, latitude and longitude of the post.
     $post->address = '';
     $post->latitude = '';
     $post->longitude = '';
     $post->store();
     $content = JText::_('COM_EASYDISCUSS_LOCATION_IS_REMOVED');
     $options = new stdClass();
     $options->content = $content;
     $options->title = JText::_('COM_EASYDISCUSS_DELETE_LOCATION_TITLE');
     $buttons = array();
     $button = new stdClass();
     $button->title = JText::_('COM_EASYDISCUSS_BUTTON_CLOSE');
     $button->action = 'disjax.closedlg();';
     $buttons[] = $button;
     $options->buttons = $buttons;
     $ajax->script('discuss.location.removeHTML("' . $id . '");');
     $ajax->dialog($options);
     return $ajax->send();
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:39,代碼來源:view.ajax.php

示例2: array

		</div>

	</div>

	<!-- Discussion left side bar -->


	<!-- Discussion content area -->
	<div class="discuss-item-right">
		<div class="discuss-story">

			<div class="discuss-story-bd">
				<div class="ph-10">

					<?php 
if (!$post->isProtected() || DiscussHelper::isModerator($post->category_id)) {
    ?>
						<div class="discuss-content">
							<?php 
    if ($system->config->get('main_allowquestionvote')) {
        ?>
								<?php 
        echo $this->loadTemplate('post.vote.php', array('access' => $access, 'post' => $post));
        ?>
							<?php 
    }
    ?>

							<div class="discuss-content-item">
								<?php 
    echo DiscussHelper::bbcodeHtmlSwitcher($post, 'question', false);
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:post.question.item.php

示例3: urlencode

				<span class="ml-10">
				[ <a href="http://www.google.com/maps?q=<?php 
echo urlencode($post->address);
?>
&amp;hl=en" target="_blank" class="map-link"><?php 
echo JText::_('COM_EASYDISCUSS_VIEW_LARGER_MAP');
?>
</a> ]
				</span>
			</h3>
			<div class="pull-right">
				<a href="javascript:void(0);" class="removeLocation"><i class="icon-remove" rel="ed-tooltip"></i></a>
			</div>
		</div>
		<?php 
if (DiscussHelper::isModerator($post->category_id)) {
    ?>
		<div><i class="icon-map-marker"></i> <?php 
    echo $post->address;
    ?>
</div>
		<?php 
}
?>

		<?php 
if ($system->config->get('main_location_static')) {
    ?>
			<div class="map-images">
				<img src="http://maps.googleapis.com/maps/api/staticmap?center=<?php 
    echo $post->latitude;
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:post.location.php

示例4:

		<?php 
    } else {
        ?>
			<?php 
        echo JText::_('COM_EASYDISCUSS_POST_IS_CURRENTLY_LOCKED');
        ?>
		<?php 
    }
    ?>
	</div>
<?php 
}
?>

<?php 
if (!$post->islock || DiscussHelper::isModerator($post->category_id)) {
    ?>
	<div class="discuss-user-reply" >
		<div class="fd-cf">
			<a name="respond" id="respond"></a>

			<div class="discuss-component-title"><?php 
    echo JText::_('COM_EASYDISCUSS_ENTRY_YOUR_RESPONSE');
    ?>
</div>
			<hr class="mv-5" style="margin-bottom: 20px;">

			<!-- Note: please update form user_type = twitter | facebook | linkedin -->
			<!-- div class="control-group">
				<a href="javascript:void(0);" class="btn btn-mini btn-facebook"><i class="icon-facebook"></i> Reply with Facebook</a>
				<a href="javascript:void(0);" class="btn btn-mini btn-twitter"><i class="icon-twitter"></i> Reply with Twitter</a>
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:post.reply.form.php

示例5:

												<?php 
        }
        ?>

												<li>
													<a href="<?php 
        echo DiscussRouter::_('index.php?option=com_easydiscuss&view=profile');
        ?>
#Subscriptions">
														<i class="icon-inbox"></i> <?php 
        echo JText::_('COM_EASYDISCUSS_VIEW_MY_SUBSCRIPTIONS');
        ?>
													</a>
												</li>
												<?php 
        if (DiscussHelper::isModerator()) {
            ?>
												<li>
													<a href="<?php 
            echo DiscussRouter::_('index.php?option=com_easydiscuss&view=assigned');
            ?>
">
														<i class="icon-check"></i> <?php 
            echo JText::_('COM_EASYDISCUSS_VIEW_MY_TICKETS');
            ?>
													</a>
												</li>
												<?php 
        }
        ?>
											</ul>
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:31,代碼來源:toolbar.php

示例6: display

 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $doc = JFactory::getDocument();
     $config = DiscussHelper::getConfig();
     // Sorting and filters.
     $sort = JRequest::getString('sort', DiscussHelper::getDefaultRepliesSorting());
     $filteractive = JRequest::getString('filter', 'allposts');
     $id = JRequest::getInt('id');
     $acl = DiscussHelper::getHelper('ACL');
     // Add noindex for print view by default.
     if (JRequest::getInt('print') == 1) {
         $doc->setMetadata('robots', 'noindex,follow');
     }
     // Get current logged in user.
     $my = JFactory::getUser();
     // Determine if the logged in user is an admin.
     $isAdmin = DiscussHelper::isSiteAdmin();
     // Load the post table out.
     $post = DiscussHelper::getTable('Post');
     $state = $post->load($id);
     // Need raw content for later use
     $post->content_raw = $post->content;
     // If id is not found, we need to redirect gracefully.
     if (!$state || !$post->published || !$id) {
         return JError::raiseError(404, JText::_('COM_EASYDISCUSS_SYSTEM_POST_NOT_FOUND'));
     }
     if ($post->private && $my->id != $post->user_id && !$isAdmin && !DiscussHelper::isModerator($post->category_id, $my->id)) {
         return JError::raiseError(404, JText::_('COM_EASYDISCUSS_SYSTEM_POST_NOT_FOUND'));
     }
     // Check whether this is a valid discussion
     if ($post->parent_id != 0 || $post->published == DISCUSS_ID_PENDING && (!$isAdmin && $post->user_id != $my->id)) {
         return JError::raiseError(404, JText::_('COM_EASYDISCUSS_SYSTEM_POST_NOT_FOUND'));
     }
     // check the discussion is under moderation
     if ($post->published == 4 && !DiscussHelper::isModerator($post->category_id, $my->id) && !$isAdmin) {
         DiscussHelper::setMessageQueue(JText::_('COM_EASYDISCUSS_NOTICE_POST_SUBMITTED_UNDER_MODERATION'), 'error');
         $app->redirect(DiscussRouter::_('index.php?option=com_easydiscuss&view=index', false));
         $app->close();
     }
     // Load the category.
     $category = DiscussHelper::getTable('Category');
     $category->load((int) $post->category_id);
     if ($post->category_id && !$category->canAccess()) {
         return JError::raiseError(404, JText::_('COM_EASYDISCUSS_SYSTEM_POST_NOT_FOUND'));
     }
     // Add pathway for category here.
     DiscussHelper::getHelper('Pathway')->setCategoryPathway($category);
     // Set breadcrumbs for this discussion.
     $this->setPathway($this->escape($post->title));
     // Mark as viewed for notifications.
     $this->logView();
     // Update hit count for this discussion.
     $post->hit();
     // Set page headers
     $this->setPageHeaders($post);
     // Before sending the title and content to be parsed, we need to store this temporarily in case it needs to be accessed.
     $post->title_clear = $post->title;
     // Filter badwords
     $post->title = DiscussHelper::wordFilter($post->title);
     $post->content = DiscussHelper::wordFilter($post->content);
     // Get the tags for this discussion
     $postsTagsModel = $this->getModel('PostsTags');
     $tags = $postsTagsModel->getPostTags($id);
     // Get adsense codes here.
     $adsense = DiscussHelper::getAdsense();
     $postsModel = DiscussHelper::getModel('Posts');
     // Get the answer for this discussion.
     $answer = $postsModel->getAcceptedReply($post->id);
     // Format the answer object.
     if ($answer) {
         $answer = DiscussHelper::formatReplies($answer, $category);
         $answer = $answer[0];
     }
     // Get a list of replies for this post.
     $data = $this->getReplies($category, $post, $sort, $answer);
     $replies = $data->replies;
     $totalReplies = $data->total;
     $hasMoreReplies = $data->more;
     $readMoreURI = $data->readmore;
     // Get comments for the post
     $commentLimit = $config->get('main_comment_pagination') ? $config->get('main_comment_pagination_count') : null;
     $post->comments = false;
     if ($config->get('main_commentpost')) {
         $comments = $post->getComments($commentLimit);
         $post->comments = DiscussHelper::formatComments($comments);
     }
     // get reply comments count
     $post->commentsCount = $post->getTotalComments();
     // Get the post access object here.
     $access = $post->getAccess($category);
     $post->access = $access;
     // Add custom values.
     $postOwner = $post->getOwner();
     $profileTable = DiscussHelper::getTable('Profile');
     if ($postOwner->id) {
         $profileTable->load($postOwner->id);
     }
     $post->user = $profileTable;
     // update user's post read flag
//.........這裏部分代碼省略.........
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:101,代碼來源:view.html.php

示例7:

	<?php 
    } else {
        ?>
		<?php 
        echo JText::_('COM_EASYDISCUSS_POST_IS_CURRENTLY_LOCKED');
        ?>
	<?php 
    }
    ?>
</div>
<?php 
}
?>

<?php 
if (!$post->islock || DiscussHelper::isModerator($post->category_id) || $access->canReply()) {
    ?>
<div class="discuss-user-reply" >
		<a name="respond" id="respond"></a>

		

		<!-- Note: please update form user_type = twitter | facebook | linkedin -->
		<!-- div class="control-group">
			<a href="javascript:void(0);" class="btn btn-mini btn-facebook"><i class="icon-facebook"></i> Reply with Facebook</a>
			<a href="javascript:void(0);" class="btn btn-mini btn-twitter"><i class="icon-twitter"></i> Reply with Twitter</a>
		</div -->

		<?php 
    if ($access->canReply()) {
        ?>
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:31,代碼來源:post.reply.form.php

示例8: ajaxSubmitReply

 /**
  * Process new reply submission called via an iframe.
  *
  * @since   2.0
  * @access  public
  */
 public function ajaxSubmitReply()
 {
     // Process when a new reply is made from bbcode / wysiwyg editor
     $my = JFactory::getUser();
     $config = DiscussHelper::getConfig();
     $ajax = new Disjax();
     $acl = DiscussHelper::getHelper('ACL');
     $post = JRequest::get('POST');
     // @task: User needs to be logged in, in order to submit a new reply.
     if (!$acl->allowed('add_reply', '0') && $my->id == 0) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_PLEASE_KINDLY_LOGIN_INORDER_TO_REPLY');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     if (!$acl->allowed('add_reply', '0')) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_ENTRY_NO_PERMISSION_TO_REPLY');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     if (!isset($post['parent_id'])) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_SYSTEM_INVALID_ID');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     $question = DiscussHelper::getTable('Post');
     $state = $question->load($post['parent_id']);
     if (!$state) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_SYSTEM_INVALID_ID');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     // Ensure that the user really has access to the discussion
     if ($question->private && $my->id != $question->user_id && !DiscussHelper::isSiteAdmin() && !DiscussHelper::isModerator($post->category_id, $my->id)) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_SYSTEM_INSUFFICIENT_PERMISSIONS');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     $questionCategory = DiscussHelper::getTable('Category');
     $questionCategory->load($question->category_id);
     $questionAccess = $question->getAccess($questionCategory);
     if (!$questionAccess->canReply()) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_ENTRY_NO_PERMISSION_TO_REPLY');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     if (empty($post['dc_reply_content'])) {
         // Append result
         $output = array();
         $output['message'] = JText::_('COM_EASYDISCUSS_ERROR_REPLY_EMPTY');
         $output['type'] = 'error';
         echo $this->_outputJson($output);
         return false;
     }
     if (empty($my->id)) {
         if (empty($post['user_type'])) {
             // Append result
             $output = array();
             $output['message'] = JText::_('COM_EASYDISCUSS_INVALID_USER_TYPE');
             $output['type'] = 'error';
             echo $this->_outputJson($output);
             return false;
         }
         if (!DiscussUserHelper::validateUserType($post['user_type'])) {
             $output = array();
             $output['message'] = JText::sprintf('COM_EASYDISCUSS_THIS_USERTYPE_HAD_BEEN_DISABLED', $post['user_type']);
             $output['type'] = 'error';
             echo $this->_outputJson($output);
             return false;
         }
         if (empty($post['poster_name']) || empty($post['poster_email'])) {
             $output = array();
             $output['message'] = JText::sprintf('COM_EASYDISCUSS_GUEST_SIGN_IN_DESC');
             $output['type'] = 'error';
             echo $this->_outputJson($output);
             return false;
         }
//.........這裏部分代碼省略.........
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:101,代碼來源:view.ajax.php

示例9: canViewReplies

 public function canViewReplies()
 {
     if (DiscussHelper::isModerator($this->id)) {
         return true;
     }
     $privCats = DiscussHelper::getPrivateCategories(DISCUSS_CATEGORY_ACL_ACTION_VIEWREPLY);
     $canView = in_array($this->id, $privCats) ? false : true;
     return $canView;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:9,代碼來源:category.php

示例10: feature

 /**
  * Responsible to feature a discussion post.
  *
  * @since	3.0
  * @access	public
  */
 public function feature()
 {
     JRequest::checkToken('request') or jexit('Invalid Token');
     $my = JFactory::getUser();
     $id = JRequest::getInt('id', 0);
     $app = JFactory::getApplication();
     // Load the post.
     $post = DiscussHelper::getTable('Post');
     $state = $post->load($id);
     if (!$state || !$id) {
         DiscussHelper::setMessageQueue(JText::_('COM_EASYDISCUSS_INVALID_POST_ID'), DISCUSS_QUEUE_ERROR);
         $app->redirect(DiscussRouter::_('index.php?option=com_easydiscuss', false));
         $app->close();
     }
     // Load acl.
     $acl = DiscussHelper::getHelper('ACL');
     // Only allow selected users to feature a discussion post.
     if (!DiscussHelper::isSiteAdmin() && !$acl->allowed('feature_post', 0) && !DiscussHelper::isModerator($post->category_id)) {
         DiscussHelper::setMessageQueue(JText::_('COM_EASYDISCUSS_NO_PERMISSION_TO_PERFORM_THE_REQUESTED_ACTION'), DISCUSS_QUEUE_ERROR);
         $app->redirect(DiscussRouter::_('index.php?option=com_easydiscuss', false));
         $app->close();
     }
     // Set the featured status.
     $task = $this->getTask();
     $post->featured = $task == 'feature' ? 1 : 0;
     $post->store();
     // Send notification to the thread starter that their post is being featured.
     // Only send when the person featuring the post is not himself.
     if ($post->user_id != $my->id && $task == 'feature') {
         $notification = DiscussHelper::getTable('Notifications');
         $notification->bind(array('title' => JText::sprintf('COM_EASYDISCUSS_FEATURED_DISCUSSION_NOTIFICATION_TITLE', $post->title), 'cid' => $post->id, 'type' => DISCUSS_NOTIFICATIONS_FEATURED, 'target' => $post->user_id, 'author' => $my->id, 'permalink' => 'index.php?option=com_easydiscuss&view=post&id=' . $post->get('id')));
         $notification->store();
         // @TODO: Send email to author?
     }
     // Redirect user back to the post.
     $message = $task == 'feature' ? JText::_('COM_EASYDISCUSS_FEATURE_POST_IS_FEATURED') : JText::_('COM_EASYDISCUSS_FEATURE_POST_IS_UNFEATURED');
     DiscussHelper::setMessageQueue($message, DISCUSS_QUEUE_SUCCESS);
     $app->redirect(DiscussRouter::getPostRoute($post->id, false));
     $app->close();
 }
開發者ID:pguilford,項目名稱:vcomcc,代碼行數:46,代碼來源:posts.php

示例11:

            echo $post->id;
            ?>
', 'reply' , '' );" class="btn btn-mini">
			<?php 
        }
        ?>
			<i class="icon-remove"></i> <?php 
        echo JText::_('COM_EASYDISCUSS_ENTRY_DELETE');
        ?>
</a>
		<?php 
    }
    ?>

		<?php 
    if ($access->canResolve() && $post->isQuestion() && !DiscussHelper::isSiteAdmin($my->id) && !DiscussHelper::isModerator($post->category_id, $my->id) && DiscussHelper::isMine($my->id)) {
        ?>
			<a class="admin-unresolve btn btn-mini" href="javascript:void(0);" onclick="discuss.post.unresolve('<?php 
        echo $post->id;
        ?>
');">
				<i class="icon-remove-sign"></i> <?php 
        echo JText::_('COM_EASYDISCUSS_ENTRY_MARK_UNRESOLVED');
        ?>
</a>

			<a class="admin-resolve btn btn-mini" href="javascript:void(0);" onclick="discuss.post.resolve('<?php 
        echo $post->id;
        ?>
');">
				<i class="icon-ok-sign"></i> <?php 
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:31,代碼來源:post.actions.php


注:本文中的DiscussHelper::isModerator方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。