本文整理匯總了PHP中JCck::_host方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCck::_host方法的具體用法?PHP JCck::_host怎麽用?PHP JCck::_host使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCck
的用法示例。
在下文中一共展示了JCck::_host方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _setMultisite
public static function _setMultisite()
{
if ((int) self::getConfig_Param('multisite', 0)) {
self::$_host = JURI::getInstance()->getHost();
self::$_sites = JCckDatabase::loadObjectList('SELECT id, title, name, guest, guest_only_viewlevel, groups, viewlevels, configuration, options FROM #__cck_core_sites WHERE published = 1', 'name');
return true;
} else {
return false;
}
}
示例2: _setMultisite
public static function _setMultisite()
{
if ((int) self::getConfig_Param('multisite', 0)) {
$alias = '';
$host = JURI::getInstance()->getHost();
$path = JURI::getInstance()->getPath();
$host2 = '';
if ($path) {
$path = substr($path, 1);
$path = substr($path, 0, strpos($path, '/'));
$host2 = $host . '/' . $path;
}
self::$_sites = JCckDatabase::loadObjectList('SELECT id, title, name, aliases, guest, guest_only_viewlevel, groups, viewlevels, configuration, options FROM #__cck_core_sites WHERE published = 1', 'name');
if (count(self::$_sites)) {
$break = 0;
foreach (self::$_sites as $s) {
if ($s->aliases != '') {
$aliases = explode('||', $s->aliases);
if (count($aliases)) {
foreach ($aliases as $a) {
if (strpos($a, '/') !== false) {
if ($a == $host2) {
$alias = $a;
$host = $s->name;
$break = 1;
break;
}
} else {
if ($a == $host) {
$alias = $a;
$host = $s->name;
$break = 1;
break;
}
}
}
}
if ($break) {
break;
}
}
}
}
self::$_host = $host;
if (isset(self::$_sites[$host])) {
self::$_sites[$host]->host = $alias ? $alias : self::$_sites[$host]->name;
}
return true;
} else {
return false;
}
}