当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_Helper_Cookie::clearIdFromCookie方法代码示例

本文整理汇总了PHP中XenForo_Helper_Cookie::clearIdFromCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Helper_Cookie::clearIdFromCookie方法的具体用法?PHP XenForo_Helper_Cookie::clearIdFromCookie怎么用?PHP XenForo_Helper_Cookie::clearIdFromCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenForo_Helper_Cookie的用法示例。


在下文中一共展示了XenForo_Helper_Cookie::clearIdFromCookie方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deletePost

 public function deletePost($postID)
 {
     if (!($post = $this->getModelFromCache('XenForo_Model_Post')->getPostById($postID))) {
         return false;
     }
     $this->getModelFromCache('XenForo_Model_Post')->deletePost($post['post_id'], 'hard');
     XenForo_Helper_Cookie::clearIdFromCookie($post['post_id'], 'inlinemod_posts');
     return true;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:9,代码来源:Threads.php

示例2: _deleteContent

 protected function _deleteContent(array $content, $reason, array $viewingUser)
 {
     $dw = XenForo_DataWriter::create('XenForo_DataWriter_DiscussionMessage_ProfilePost', XenForo_DataWriter::ERROR_SILENT);
     if ($dw->setExistingData($content)) {
         $dw->setExtraData(XenForo_DataWriter_DiscussionMessage::DATA_DELETE_REASON, $reason);
         $dw->set('message_state', 'deleted');
         $dw->save();
     }
     XenForo_Model_Log::logModeratorAction('profile_post', $content, 'delete_soft', array('reason' => $reason), $this->_getProfilePostModel()->getProfileUserFromProfilePost($content));
     XenForo_Helper_Cookie::clearIdFromCookie($content['profile_post_id'], 'inlinemod_profilePosts');
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:ProfilePost.php

示例3: actionDelete

 /**
  * Deletes a profile post.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionDelete()
 {
     $profilePostId = $this->_input->filterSingle('profile_post_id', XenForo_Input::UINT);
     list($profilePost, $user) = $this->getHelper('UserProfile')->assertProfilePostValidAndViewable($profilePostId);
     $hardDelete = $this->_input->filterSingle('hard_delete', XenForo_Input::UINT);
     $deleteType = $hardDelete ? 'hard' : 'soft';
     $profilePostModel = $this->_getProfilePostModel();
     if (!$profilePostModel->canDeleteProfilePost($profilePost, $user, $deleteType, $errorPhraseKey)) {
         throw $this->getErrorOrNoPermissionResponseException($errorPhraseKey);
     }
     if ($this->isConfirmedPost()) {
         $reason = $this->_input->filterSingle('reason', XenForo_Input::STRING);
         $dw = XenForo_DataWriter::create('XenForo_DataWriter_DiscussionMessage_ProfilePost');
         $dw->setExistingData($profilePostId);
         if ($deleteType == 'hard') {
             $dw->delete();
         } else {
             $dw->setExtraData(XenForo_DataWriter_DiscussionMessage::DATA_DELETE_REASON, $reason);
             $dw->set('message_state', 'deleted');
             $dw->save();
         }
         $options = array('authorAlert' => $this->_input->filterSingle('send_author_alert', XenForo_Input::BOOLEAN), 'authorAlertReason' => $this->_input->filterSingle('author_alert_reason', XenForo_Input::STRING));
         if ($options['authorAlert'] && $profilePostModel->canSendProfilePostActionAlert($profilePost, $user)) {
             $profilePostModel->sendModeratorActionAlertForProfilePost('delete', $dw->getMergedData(), $user, $options['authorAlertReason']);
         }
         XenForo_Model_Log::logModeratorAction('profile_post', $profilePost, 'delete_' . $deleteType, array('reason' => $reason), $user);
         XenForo_Helper_Cookie::clearIdFromCookie($profilePostId, 'inlinemod_profilePosts');
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('members', $user));
     } else {
         $viewParams = array('profilePost' => $profilePost, 'user' => $user, 'canHardDelete' => $profilePostModel->canDeleteProfilePost($profilePost, $user, 'hard'), 'canSendAlert' => $profilePostModel->canSendProfilePostActionAlert($profilePost, $user));
         return $this->responseView('XenForo_ViewPublic_ProfilePost_Delete', 'profile_post_delete', $viewParams);
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:38,代码来源:ProfilePost.php

示例4: actionLeave

 /**
  * Leave a (user's) conversation.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionLeave()
 {
     $conversationId = $this->_input->filterSingle('conversation_id', XenForo_Input::UINT);
     $conversation = $this->_getConversationOrError($conversationId);
     $deleteType = $this->_input->filterSingle('delete_type', XenForo_Input::STRING);
     if ($this->isConfirmedPost()) {
         $this->_getConversationModel()->deleteConversationForUser($conversationId, XenForo_Visitor::getUserId(), $deleteType);
         XenForo_Helper_Cookie::clearIdFromCookie($conversationId, 'inlinemod_conversations');
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('conversations'));
     } else {
         $viewParams = array('conversation' => $conversation);
         return $this->responseView('XenForo_ViewPublic_Conversation_Leave', 'conversation_leave', $viewParams);
     }
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:19,代码来源:Conversation.php

示例5: actionDelete

 /**
  * Deletes an existing post.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionDelete()
 {
     $postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);
     $ftpHelper = $this->getHelper('ForumThreadPost');
     list($post, $thread, $forum) = $ftpHelper->assertPostValidAndViewable($postId);
     $hardDelete = $this->_input->filterSingle('hard_delete', XenForo_Input::UINT);
     $deleteType = $hardDelete ? 'hard' : 'soft';
     $this->_assertCanDeletePost($post, $thread, $forum, $deleteType);
     $postModel = $this->_getPostModel();
     if ($this->isConfirmedPost()) {
         $options = array('reason' => $this->_input->filterSingle('reason', XenForo_Input::STRING), 'authorAlert' => $this->_input->filterSingle('send_author_alert', XenForo_Input::BOOLEAN), 'authorAlertReason' => $this->_input->filterSingle('author_alert_reason', XenForo_Input::STRING));
         if ($thread['discussion_state'] != 'visible' || $post['message_state'] != 'visible' || $post['user_id'] == XenForo_Visitor::getUserId()) {
             $options['authorAlert'] = false;
         }
         $dw = $postModel->deletePost($postId, $deleteType, $options, $forum);
         if ($post['post_id'] == $thread['first_post_id']) {
             XenForo_Model_Log::logModeratorAction('thread', $thread, 'delete_' . $deleteType, array('reason' => $options['reason']));
         } else {
             XenForo_Model_Log::logModeratorAction('post', $post, 'delete_' . $deleteType, array('reason' => $options['reason']), $thread);
         }
         XenForo_Helper_Cookie::clearIdFromCookie($postId, 'inlinemod_posts');
         if ($dw->discussionDeleted() || !$post['position']) {
             XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
             return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('forums', $forum));
         } else {
             return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(XenForo_Link::buildPublicLink('threads', $thread)));
         }
     } else {
         $viewParams = array('post' => $post, 'thread' => $thread, 'forum' => $forum, 'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum), 'canHardDelete' => $postModel->canDeletePost($post, $thread, $forum, 'hard'), 'redirect' => $this->getDynamicRedirect(XenForo_Link::buildPublicLink('threads', $thread)));
         return $this->responseView('XenForo_ViewPublic_Post_Delete', 'post_delete', $viewParams);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:37,代码来源:Post.php

示例6: actionDelete

 /**
  * Deletes an existing post.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionDelete()
 {
     $postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);
     $ftpHelper = $this->getHelper('ForumThreadPost');
     list($post, $thread, $forum) = $ftpHelper->assertPostValidAndViewable($postId);
     $hardDelete = $this->_input->filterSingle('hard_delete', XenForo_Input::UINT);
     $deleteType = $hardDelete ? 'hard' : 'soft';
     $this->_assertCanDeletePost($post, $thread, $forum, $deleteType);
     $postModel = $this->_getPostModel();
     if ($this->isConfirmedPost()) {
         $options = array('reason' => $this->_input->filterSingle('reason', XenForo_Input::STRING));
         $dw = $postModel->deletePost($postId, $deleteType, $options);
         XenForo_Helper_Cookie::clearIdFromCookie($postId, 'inlinemod_posts');
         if ($dw->discussionDeleted()) {
             XenForo_Helper_Cookie::clearIdFromCookie($thread['thread_id'], 'inlinemod_threads');
             return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('forums', $forum));
         } else {
             return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(XenForo_Link::buildPublicLink('threads', $thread)));
         }
     } else {
         $viewParams = array('post' => $post, 'thread' => $thread, 'forum' => $forum, 'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum), 'canHardDelete' => $postModel->canDeletePost($post, $thread, $forum, 'hard'));
         return $this->responseView('XenForo_ViewPublic_Post_Delete', 'post_delete', $viewParams);
     }
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:29,代码来源:Post.php

示例7: actionDelete

 /**
  * Deletes an existing thread.
  *
  * @return XenForo_ControllerResponse_Abstract
  */
 public function actionDelete()
 {
     $threadId = $this->_input->filterSingle('thread_id', XenForo_Input::UINT);
     $ftpHelper = $this->getHelper('ForumThreadPost');
     list($thread, $forum) = $ftpHelper->assertThreadValidAndViewable($threadId);
     $threadModel = $this->_getThreadModel();
     $hardDelete = $this->_input->filterSingle('hard_delete', XenForo_Input::UINT);
     $deleteType = $hardDelete ? 'hard' : 'soft';
     $this->_assertCanDeleteThread($thread, $forum, $deleteType);
     if ($this->isConfirmedPost()) {
         $input = $this->_input->filter(array('reason' => XenForo_Input::STRING, 'send_starter_alert' => XenForo_Input::BOOLEAN, 'starter_alert_reason' => XenForo_Input::STRING));
         $options = array('reason' => $input['reason']);
         $threadModel->deleteThread($threadId, $deleteType, $options);
         XenForo_Model_Log::logModeratorAction('thread', $thread, 'delete_' . $deleteType, array('reason' => $options['reason']));
         if ($thread['discussion_state'] == 'visible' && $input['send_starter_alert'] && $thread['user_id'] && $thread['user_id'] != XenForo_Visitor::getUserId()) {
             $this->_getThreadModel()->sendModeratorActionAlert('delete', $thread, $input['starter_alert_reason']);
         }
         XenForo_Helper_Cookie::clearIdFromCookie($threadId, 'inlinemod_threads');
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('forums', $forum));
     } else {
         return $this->responseView('XenForo_ViewPublic_Thread_Delete', 'thread_delete', array('thread' => $thread, 'forum' => $forum, 'nodeBreadCrumbs' => $ftpHelper->getNodeBreadCrumbs($forum), 'canHardDelete' => $threadModel->canDeleteThread($thread, $forum, 'hard')));
     }
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:28,代码来源:Thread.php

示例8: _deleteContent

 protected function _deleteContent(array $content, $reason, array $viewingUser)
 {
     $this->_getPostModel()->deletePost($content['post_id'], 'soft', array('reason' => $reason));
     XenForo_Model_Log::logModeratorAction('post', $content, 'delete_soft', array('reason' => $reason), $content);
     XenForo_Helper_Cookie::clearIdFromCookie($content['post_id'], 'inlinemod_posts');
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:6,代码来源:Post.php

示例9: actionDelete

 public function actionDelete()
 {
     list($post, $team, $category) = $this->_getTeamHelper()->assertPostValidAndViewable();
     if (!$this->_getPostModel()->canDeletePost($post, $team, $category, $key)) {
         throw $this->getErrorOrNoPermissionResponseException($key);
     }
     if ($this->isConfirmedPost()) {
         $this->_getPostModel()->deletePost($post, $team);
         XenForo_Helper_Cookie::clearIdFromCookie($post['post_id'], 'inlinemod_teamPosts');
         return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, $this->getDynamicRedirect(XenForo_Link::buildPublicLink(TEAM_ROUTE_PREFIX, $team)));
     } else {
         $viewParams = array('post' => $post, 'team' => $team, 'category' => $category, 'categoryBreadcrumbs' => $this->_getCategoryModel()->getCategoryBreadcrumb($category), 'redirect' => $this->getDynamicRedirect(XenForo_Link::buildPublicLink(TEAM_ROUTE_PREFIX, $team)));
         return $this->responseView('Nobita_Teams_ViewPublic_Post_Delete', 'Team_post_delete', $viewParams);
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:15,代码来源:Post.php


注:本文中的XenForo_Helper_Cookie::clearIdFromCookie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。