當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Setting::getBlogSettingsGlobal方法代碼示例

本文整理匯總了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');
    }
}
開發者ID:hinablue,項目名稱:TextCube,代碼行數:19,代碼來源:blog.service.php

示例2: getBlogSettingsGlobal

 function getBlogSettingsGlobal($blogid = null)
 {
     return Setting::getBlogSettingsGlobal($blogid);
 }
開發者ID:ragi79,項目名稱:Textcube,代碼行數:4,代碼來源:Textcube.Function.Misc.php

示例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
;
開發者ID:Avantians,項目名稱:Textcube,代碼行數:25,代碼來源:messages.php

示例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;
 }
開發者ID:ragi79,項目名稱:Textcube,代碼行數:33,代碼來源:Textcube.Function.Setting.php

示例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();
 }
開發者ID:webhacking,項目名稱:Textcube,代碼行數:85,代碼來源:URIHandler.php


注:本文中的Setting::getBlogSettingsGlobal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。