本文整理汇总了PHP中RSMembershipHelper::checkURL方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::checkURL方法的具体用法?PHP RSMembershipHelper::checkURL怎么用?PHP RSMembershipHelper::checkURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSMembershipHelper
的用法示例。
在下文中一共展示了RSMembershipHelper::checkURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkShared
public static function checkShared()
{
$option = RSMembershipHelper::getOption();
if (!$option) {
return;
}
$app = JFactory::getApplication();
// Get the language
$lang = JFactory::getLanguage();
$lang->load('com_rsmembership');
$msg = JText::_('COM_RSMEMBERSHIP_MEMBERSHIP_NEED_SUBSCRIPTION');
// Get the database object
$db = JFactory::getDBO();
list($memberships, $extras) = RSMembershipHelper::getUserSubscriptions();
$has_access = false;
$found_shared = false;
$redirect = '';
if (!$app->isAdmin()) {
// Check the articles, categories and sections
if ($option == 'com_content') {
RSMembershipHelper::checkContent($has_access, $found_shared, $redirect, $memberships, $extras);
}
// Menu - Itemid
RSMembershipHelper::checkMenu($has_access, $found_shared, $redirect, $memberships, $extras);
}
$instances = RSMembership::getSharedContentPlugins();
foreach ($instances as $instance) {
if (method_exists($instance, 'checkShared')) {
$instance->checkShared($option, $has_access, $found_shared, $redirect, $memberships, $extras);
}
}
// Custom URL
RSMembershipHelper::checkURL($has_access, $found_shared, $redirect, $memberships, $extras);
if (!$found_shared) {
$has_access = true;
}
if ($found_shared && $has_access) {
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_rsmembership/tables');
$row = JTable::getInstance('Log', 'RSMembershipTable');
$row->date = JFactory::getDate()->toSql();
$row->user_id = JFactory::getUser()->get('id');
$row->path = '[URL] ' . JUri::getInstance()->toString();
$row->ip = $_SERVER['REMOTE_ADDR'];
$row->store();
}
if (!$has_access) {
$redirect = empty($redirect) ? JURI::root() : JRoute::_($redirect, false);
$app->redirect($redirect, $msg);
}
}
示例2: checkShared
function checkShared()
{
$option = RSMembershipHelper::getOption();
if (!$option) {
return;
}
$mainframe =& JFactory::getApplication();
// Get the language
$lang =& JFactory::getLanguage();
$lang->load('com_rsmembership');
$msg = JText::_('RSM_MEMBERSHIP_NEED_SUBSCRIPTION');
// Get the database object
$db = JFactory::getDBO();
list($memberships, $extras) = RSMembershipHelper::getUserSubscriptions();
$has_access = false;
$found_shared = false;
$redirect = '';
if (!$mainframe->isAdmin()) {
// Check the articles, categories and sections
if ($option == 'com_content') {
RSMembershipHelper::checkContent($has_access, $found_shared, $redirect, $memberships, $extras);
}
// Menu - Itemid
RSMembershipHelper::checkMenu($has_access, $found_shared, $redirect, $memberships, $extras);
}
$instances = RSMembership::getSharedContentPlugins();
foreach ($instances as $instance) {
if (method_exists($instance, 'checkShared')) {
$instance->checkShared($option, $has_access, $found_shared, $redirect, $memberships, $extras);
}
}
// Custom URL
RSMembershipHelper::checkURL($has_access, $found_shared, $redirect, $memberships, $extras);
if (!$found_shared) {
$has_access = true;
}
if (!$has_access) {
$redirect = empty($redirect) ? JURI::root() : JRoute::_($redirect, false);
$mainframe->redirect($redirect, $msg);
}
}