本文整理汇总了PHP中XenForo_Link::getCanonicalLinkPrefix方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Link::getCanonicalLinkPrefix方法的具体用法?PHP XenForo_Link::getCanonicalLinkPrefix怎么用?PHP XenForo_Link::getCanonicalLinkPrefix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Link
的用法示例。
在下文中一共展示了XenForo_Link::getCanonicalLinkPrefix方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAddReply
/**
*
* @see XenForo_ControllerPublic_Thread::actionAddReply()
*/
public function actionAddReply()
{
$response = parent::actionAddReply();
if ($response instanceof XenForo_ControllerResponse_Redirect) {
$xenOptions = XenForo_Application::get('options');
if ($xenOptions->th_moderateReplies_moderateMessage) {
$message = $response->redirectMessage;
if ($message instanceof XenForo_Phrase && $message->getPhraseName() == 'your_message_has_been_posted') {
$target = XenForo_Link::getCanonicalLinkPrefix() . XenForo_Link::convertUriToAbsoluteUri($response->redirectTarget);
$result = $this->parseRouteUrl($target);
if ($result) {
$match = $result['match'];
$controllerName = $match->getControllerName();
if ($controllerName == 'XenForo_ControllerPublic_Thread') {
$response->redirectMessage = new XenForo_Phrase('message_submitted_displayed_pending_approval');
} elseif ($controllerName == 'XenForo_ControllerPublic_Post') {
$post = $this->_getPostModel()->getPostById($result['params']['post_id']);
if ($post['message_state'] == 'moderated') {
$response->redirectMessage = new XenForo_Phrase('message_submitted_displayed_pending_approval');
}
}
}
}
}
}
return $response;
}