本文整理匯總了PHP中JFactory::getUSER方法的典型用法代碼示例。如果您正苦於以下問題:PHP JFactory::getUSER方法的具體用法?PHP JFactory::getUSER怎麽用?PHP JFactory::getUSER使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JFactory
的用法示例。
在下文中一共展示了JFactory::getUSER方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: site
function site()
{
$db = JFactory::getDBO();
$user = JFactory::getUSER();
//geting usertype from user
$arrMultiGroups[] = $user->usertype;
//get multigrop names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$user->id}";
$db->setQuery($sqlGetMultigroups);
$multiGroups = $db->loadObjectList();
if (!empty($multiGroups)) {
foreach ($multiGroups as $mgrp) {
$arrMultiGroups[] = $mgrp->name;
}
}
$queryModules = "SELECT axo_section, axo_value FROM #__noixacl_rules WHERE aco_section = 'com_modules' AND aco_value = 'block' AND aro_value IN ('" . implode("','", $arrMultiGroups) . "')";
$db->setQuery($queryModules);
$hideModules = $db->loadObjectList();
if (!empty($hideModules)) {
jimport('joomla.application.module.helper');
foreach ($hideModules as $module) {
$moduleInstance =& JModuleHelper::getModule(str_replace('mod_', '', $module->axo_section), $module->axo_value);
$moduleInstance->position = NULL;
}
}
}