本文整理汇总了PHP中Setting::getBlogSettingsGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getBlogSettingsGlobal方法的具体用法?PHP Setting::getBlogSettingsGlobal怎么用?PHP Setting::getBlogSettingsGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::getBlogSettingsGlobal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultURL
function getDefaultURL($blogid)
{
$context = Model_Context::getInstance();
$blog = Setting::getBlogSettingsGlobal($blogid);
// Load specific blog's setting
switch ($context->getProperty('service.type')) {
case 'domain':
if (!empty($blog['defaultDomain']) && !empty($blog['secondaryDomain'])) {
return 'http://' . $blog['secondaryDomain'] . ($context->getProperty('service.port') ? ':' . $context->getProperty('service.port') : '') . $context->getProperty('service.path');
} else {
return 'http://' . $blog['name'] . '.' . $context->getProperty('service.domain') . ($context->getProperty('service.port') ? ':' . $context->getProperty('service.port') : '') . $context->getProperty('service.path');
}
case 'path':
return 'http://' . $context->getProperty('service.domain') . ($context->getProperty('service.port') ? ':' . $context->getProperty('service.port') : '') . $context->getProperty('service.path') . '/' . $blog['name'];
case 'single':
default:
return 'http://' . $context->getProperty('service.domain') . ($context->getProperty('service.port') ? ':' . $context->getProperty('service.port') : '') . $context->getProperty('service.path');
}
}
示例2: getBlogSettingsGlobal
function getBlogSettingsGlobal($blogid = null)
{
return Setting::getBlogSettingsGlobal($blogid);
}
示例3: header
<?php
if (!defined('ROOT')) {
header('HTTP/1.1 403 Forbidden');
header("Connection: close");
exit;
}
// TODO: generalize for multiple language support e.g. skin language
$setting = Setting::getBlogSettingsGlobal($blogid);
require 'owner/' . $setting['language'] . '.php';
echo "__text = {\n";
foreach ($__text as $key => $value) {
$key = str_replace("\n", "\\n", addslashes($key));
$value = str_replace("\n", "\\n", addslashes($value));
echo "\t'{$key}': '{$value}',\n";
}
echo <<<EOT
\t'': '' // dummy
};
function _t(msg) {
\treturn __text[msg] || msg;
}
EOT
;
示例4: removeBlogSettingGlobal
function removeBlogSettingGlobal($name, $blogid = null)
{
global $database;
global $__gCacheBlogSettings;
// share blog.service.php
global $gCacheStorage;
if (is_null($blogid)) {
$blogid = getBlogId();
}
if (!is_numeric($blogid)) {
return null;
}
if (!array_key_exists($blogid, $__gCacheBlogSettings)) {
// force loading
Setting::getBlogSettingsGlobal($blogid);
}
if ($__gCacheBlogSettings[$blogid] === false) {
return null;
}
$escape_name = POD::escapeString($name);
if (array_key_exists($name, $__gCacheBlogSettings[$blogid])) {
// overwrite value
$gCacheStorage->purge();
unset($__gCacheBlogSettings[$blogid][$name]);
$query = DBModel::getInstance();
$query->reset('BlogSettings');
$query->setQualifier('blogid', 'equals', $blogid);
$query->setQualifier('name', 'equals', $name);
return $query->delete();
}
// already not exist
return true;
}
示例5: __URIvariableParser
private function __URIvariableParser()
{
global $suri, $blog, $blogid, $skinSetting, $gCacheStorage;
// To support legacy for global variables.
$blogid = $this->blogid;
$gCacheStorage = globalCacheStorage::getInstance();
// Initialize global cache
$suri = $this->suri;
$blog = Setting::getBlogSettingsGlobal($this->blogid);
$blog['id'] = $this->blogid;
$skinSetting = Setting::getSkinSettings($this->blogid);
if (!is_null($this->context->getProperty('service.serviceURL'))) {
$this->uri['service'] = $this->context->getProperty('service.serviceURL');
}
if (!isset($this->uri['service'])) {
$this->uri['service'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $this->context->getProperty('service.domain') . (!is_null($this->context->getProperty('service.port')) ? ':' . $this->context->getProperty('service.port') : '') . $this->context->getProperty('service.path');
}
$this->context->useNamespace('service');
switch ($this->context->getProperty('service.type')) {
case 'domain':
$this->uri['path'] = $this->context->getProperty('path');
$blog['primaryBlogURL'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $blog['name'] . '.' . $this->context->getProperty('domain') . (!is_null($this->context->getProperty('port')) ? ':' . $this->context->getProperty('port') : '') . $this->uri['path'];
if (!empty($blog['secondaryDomain'])) {
$blog['secondaryBlogURL'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $blog['secondaryDomain'] . (!is_null($this->context->getProperty('port')) ? ':' . $this->context->getProperty('port') : '') . $this->uri['path'];
} else {
$blog['secondaryBlogURL'] = null;
}
if ($blog['defaultDomain']) {
$this->uri['default'] = $blog['secondaryBlogURL'];
if ($_SERVER['HTTP_HOST'] == $blog['secondaryDomain']) {
$this->uri['base'] = $this->context->getProperty('path');
} else {
$this->uri['base'] = $this->uri['default'];
}
} else {
$this->uri['default'] = $blog['primaryBlogURL'];
if ($_SERVER['HTTP_HOST'] == $blog['name'] . '.' . $this->context->getProperty('domain')) {
$this->uri['base'] = $this->context->getProperty('path');
} else {
$this->uri['base'] = $this->uri['default'];
}
}
break;
case 'path':
$this->uri['path'] = $this->context->getProperty('path') . '/' . $blog['name'];
$blog['primaryBlogURL'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $this->context->getProperty('domain') . (!is_null($this->context->getProperty('port')) ? ':' . $this->context->getProperty('port') : '') . $this->uri['path'];
$blog['secondaryBlogURL'] = null;
$this->uri['default'] = $blog['primaryBlogURL'];
if ($_SERVER['HTTP_HOST'] == $this->context->getProperty('domain')) {
$this->uri['base'] = $this->context->getProperty('path') . '/' . $blog['name'];
} else {
$this->uri['base'] = $this->uri['default'];
}
break;
case 'single':
default:
$this->uri['path'] = $this->context->getProperty('path');
$blog['primaryBlogURL'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $this->context->getProperty('domain') . (!is_null($this->context->getProperty('port')) ? ':' . $this->context->getProperty('port') : '') . $this->uri['path'];
$blog['secondaryBlogURL'] = null;
$this->uri['default'] = $blog['primaryBlogURL'] . $this->__getFancyURLpostfix();
if ($_SERVER['HTTP_HOST'] == $this->context->getProperty('domain')) {
$this->uri['base'] = $this->context->getProperty('path');
} else {
$this->uri['base'] = $this->uri['default'];
}
break;
}
$this->uri['host'] = ($this->context->getProperty('service.useSSL', false) ? 'https://' : '//') . $_SERVER['HTTP_HOST'] . (!is_null($this->context->getProperty('port')) ? ':' . $this->context->getProperty('port') : '');
$this->uri['blog'] = $this->uri['path'] . $this->__getFancyURLpostfix();
$this->uri['folder'] = rtrim($this->uri['blog'] . $suri['directive'], '/');
$this->uri['permalink'] = rtrim($this->uri['default'] . rtrim($this->suri['directive'], '/') . (empty($this->suri['id']) ? '/' . $this->suri['value'] : '/' . $this->suri['id']), '/');
$this->uri['basicblog'] = $this->uri['blog'];
if (defined('__TEXTCUBE_MOBILE__')) {
$this->uri['blog'] .= '/m';
$_SESSION['mode'] = 'mobile';
} else {
if (defined('__TEXTCUBE_IPHONE__')) {
$this->uri['blog'] .= '/i';
$_SESSION['mode'] = 'mobile';
}
}
$this->blog = $blog;
$this->skin = $skinSetting;
$this->updateContext();
}