本文整理汇总了PHP中XenForo_Application::getRequestPaths方法的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_Application::getRequestPaths方法的具体用法?PHP XenForo_Application::getRequestPaths怎么用?PHP XenForo_Application::getRequestPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XenForo_Application
的用法示例。
在下文中一共展示了XenForo_Application::getRequestPaths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setRequestPaths
/**
* Sets the request paths for this request.
*/
public function setRequestPaths()
{
$requestPaths = XenForo_Application::getRequestPaths($this->_request);
XenForo_Application::set('requestPaths', $requestPaths);
}
示例2: setRequestPaths
/**
* Sets the request paths for this request.
*/
public function setRequestPaths()
{
if (!XenForo_Application::isRegistered('requestPaths')) {
$requestPaths = XenForo_Application::getRequestPaths($this->_request);
XenForo_Application::set('requestPaths', $requestPaths);
}
}
示例3: actionPurchase
public function actionPurchase()
{
$visitor = XenForo_Visitor::getInstance();
$xenOptions = XenForo_Application::get('options');
$paidContentId = $this->_input->filterSingle('paid_content_id', XenForo_Input::UINT);
$paidContentModel = $this->_getPaidContentModel();
$paidContentItem = $paidContentModel->preparePaidContent($this->_getPaidContentItemOrError($paidContentId));
$paidContentHandler = $paidContentModel->getPaidContentHandler($paidContentItem['content_type']);
if (!$paidContentHandler) {
return $this->responseNoPermission();
}
$content = $paidContentHandler->getContentById($paidContentItem['content_id']);
if (!$content) {
return $this->responseNoPermission();
}
if (!$visitor['user_id'] && ($paidContentItem['user_group_ids'] == -1 || in_array(XenForo_Model_User::$defaultRegisteredGroupId, explode(',', $paidContentItem['user_group_ids'])))) {
return $this->responseReroute('XenForo_ControllerPublic_Register', 'index');
}
if (!$paidContentModel->canPurchasePaidContentItem($paidContentItem)) {
return $this->responseNoPermission();
}
if ($this->_checkCsrfFromToken(null, false)) {
$paths = XenForo_Application::getRequestPaths(new Zend_Controller_Request_Http());
$baseUrl = $paths['fullBasePath'];
$params = array('cmd' => '_xclick', 'amount' => $paidContentItem['cost_amount'], 'business' => $paidContentItem['paypal_email'] ? $paidContentItem['paypal_email'] : $xenOptions->payPalPrimaryAccount, 'currency_code' => $paidContentItem['currency'], 'item_name' => $paidContentHandler->getTitleForContent($content), 'quantity' => 1, 'no_note' => 1, 'custom' => implode(',', array($visitor->user_id, $paidContentItem['paid_content_id'], 'token', $visitor->csrf_token_page)), 'charset' => 'utf-8', 'email' => $visitor->email, 'return' => XenForo_Link::buildPublicLink('full:paid-content/purchase-success'), 'cancel_return' => XenForo_Link::buildPublicLink('full:index'), 'notify_url' => $baseUrl . 'paid_content_callback.php');
$payPalUrl = $this->_input->filterSingle('payPalUrl', XenForo_Input::STRING);
if (!$payPalUrl) {
$payPalUrl = 'https://www.paypal.com/cgi-bin/websrc';
}
// Redirect to paypal
$url = $payPalUrl . '?' . XenForo_Link::buildQueryString($params);
header('Location: ' . $url);
exit;
}
$viewParams = array('title' => $paidContentHandler->getTitleForContent($content), 'breadCrumbs' => $paidContentHandler->getBreadcrumbsForContent($content), 'paidContentItem' => $paidContentItem);
return $this->responseView('ThemeHouse_PayForContent_ViewPublic_PaidContent_PurchaseConfirm', 'th_purchase_confirm_payforcontent', $viewParams);
}