本文整理汇总了PHP中RSMembershipHelper::_is_match方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::_is_match方法的具体用法?PHP RSMembershipHelper::_is_match怎么用?PHP RSMembershipHelper::_is_match使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSMembershipHelper
的用法示例。
在下文中一共展示了RSMembershipHelper::_is_match方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkURL
public static function checkURL(&$has_access, &$found_shared, &$redirect, $memberships, $extras)
{
$option = RSMembershipHelper::getOption();
$app = JFactory::getApplication();
$type = $app->isAdmin() ? 'backendurl' : 'frontendurl';
$shared = RSMembershipHelper::getShared($type, $option . '%');
// Get the database object
$db = JFactory::getDBO();
$query = $db->getQuery(true);
if (!empty($shared)) {
foreach ($shared as $share) {
$what = isset($share->membership_id) ? 'membership_id' : 'extra_value_id';
$where = isset($share->membership_id) ? $memberships : $extras;
$table = isset($share->membership_id) ? '#__rsmembership_memberships' : '#__rsmembership_extra_values';
$url = RSMembershipHelper::parseQuery($share->params);
$current_query = array();
foreach ($url as $q => $value) {
$var = JFactory::getApplication()->input->get($q, false, 'string');
if ($var !== false) {
$current_query[] = $q . '=' . $var;
}
}
$current_query = $option . (!empty($current_query) ? '&' . implode('&', $current_query) : '');
if ($current_query == $share->params || RSMembershipHelper::_is_match($current_query, $share->params)) {
$found_shared = true;
if (in_array($share->{$what}, $where)) {
$has_access = true;
break;
} else {
// Get the redirect page
$query->clear();
$query->select($db->qn('share_redirect'))->from($db->qn($table))->where($db->qn('id') . ' = ' . $db->q($share->{$what}));
$db->setQuery($query);
$redirect = $db->loadResult();
}
}
}
}
}
示例2: checkURL
function checkURL(&$has_access, &$found_shared, &$redirect, $memberships, $extras)
{
$option = RSMembershipHelper::getOption();
$mainframe =& JFactory::getApplication();
$type = $mainframe->isAdmin() ? 'backendurl' : 'frontendurl';
$shared = RSMembershipHelper::getShared($type, $option . '%');
// Get the database object
$db =& JFactory::getDBO();
if (!empty($shared)) {
foreach ($shared as $share) {
$what = isset($share->membership_id) ? 'membership_id' : 'extra_value_id';
$where = isset($share->membership_id) ? $memberships : $extras;
$table = isset($share->membership_id) ? '#__rsmembership_memberships' : '#__rsmembership_extra_values';
$query = RSMembershipHelper::parseQuery($share->params);
$current_query = array();
foreach ($query as $q => $value) {
$var = JRequest::getVar($q, false, 'request', 'none', JREQUEST_ALLOWRAW);
if ($var !== false) {
$current_query[] = $q . '=' . $var;
}
}
$current_query = $option . (!empty($current_query) ? '&' . implode('&', $current_query) : '');
if ($current_query == $share->params || RSMembershipHelper::_is_match($current_query, $share->params)) {
$found_shared = true;
if (in_array($share->{$what}, $where)) {
$has_access = true;
break;
} else {
// Get the redirect page
$db->setQuery("SELECT `share_redirect` FROM " . $table . " WHERE `id`='" . $share->{$what} . "'");
$redirect = $db->loadResult();
}
}
}
}
}