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


PHP RSMembershipHelper::checkURL方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:JozefAB,项目名称:qk,代码行数:50,代码来源:helper.php

示例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);
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:41,代码来源:rsmembership.php


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