当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::getSkinSettings方法代码示例

本文整理汇总了PHP中Setting::getSkinSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::getSkinSettings方法的具体用法?PHP Setting::getSkinSettings怎么用?PHP Setting::getSkinSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Setting的用法示例。


在下文中一共展示了Setting::getSkinSettings方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printIphoneArchives

function printIphoneArchives($blogid)
{
    global $database;
    $archives = array();
    $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0' . getPrivateCategoryExclusionQuery($blogid);
    $skinSetting = Setting::getSkinSettings($blogid);
    $result = POD::queryAllWithDBCache("SELECT EXTRACT(year_month FROM FROM_UNIXTIME(e.published)) period, COUNT(*) count \n\t\tFROM {$database['prefix']}Entries e\n\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\tGROUP BY period \n\t\tORDER BY period \n\t\tDESC ");
    if ($result) {
        foreach ($result as $archive) {
            array_push($archives, $archive);
        }
    }
    return $archives;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:14,代码来源:iphoneView.php

示例2: getSkinSettings

function getSkinSettings($blogid, $forceReload = false)
{
    return Setting::getSkinSettings($blogid, $forceReload);
}
开发者ID:hinablue,项目名称:TextCube,代码行数:4,代码来源:blog.service.php

示例3: setSkinSetting

function setSkinSetting($blogid, $setting)
{
    global $skinSetting;
    // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
    importlib('blogskin');
    $blogid = getBlogId();
    if (strncmp($context->getProperty('skin.skin'), 'customize/', 10) == 0) {
        if (strcmp($context->getProperty('skin.skin'), "customize/{$blogid}") != 0) {
            return false;
        }
    } else {
        $skinSetting['skin'] = Path::getBaseName($context->getProperty('skin.skin'));
        // Legacy global support. TODO: DELETE THIS LINE AFTER CHECK EVERY REFERENCES IN WHOLE SOURCE
        $context->setProperty('skin.skin', $skinSetting['skin']);
        if ($context->getProperty('skin.skin') === '.' || $context->getProperty('skin.skin') === '..') {
            return _t('실패 했습니다');
        }
    }
    $skinpath = getSkinPath($context->getProperty('skin.skin'));
    if (!is_dir($skinpath)) {
        return _t('실패 했습니다');
    }
    foreach ($setting as $key => $value) {
        Setting::setSkinSetting($key, $value, $blogid);
    }
    Setting::setSkinSetting('skin', $context->getProperty('skin.skin'), $blogid);
    Setting::setBlogSetting('useMicroformat', $setting['useMicroformat'], true);
    Setting::setBlogSetting('useAjaxComment', $setting['useAjaxComment'], true);
    Setting::setBlogSetting('useFOAF', $setting['useFOAF'] == 1 ? 1 : 0, true);
    Setting::setBlogSetting('entriesOnPage', $setting['entriesOnPage'], true);
    Setting::setBlogSetting('entriesOnList', $setting['entriesOnList'], true);
    CacheControl::flushCategory();
    CacheControl::flushTag();
    CacheControl::flushSkin();
    Setting::getSkinSettings($blogid, true);
    // refresh skin cache
    return true;
}
开发者ID:ni5am,项目名称:Textcube,代码行数:38,代码来源:skin.php

示例4: setSkinSetting

 function setSkinSetting($name, $value, $blogid = null)
 {
     global $__gCacheSkinSettings;
     global $__gCacheBlogSettings;
     global $gCacheStorage;
     if (is_null($blogid)) {
         $blogid = getBlogId();
     }
     if (!is_numeric($blogid)) {
         return null;
     }
     if (!array_key_exists($blogid, $__gCacheSkinSettings)) {
         // force loading
         Setting::getSkinSettings($blogid, false);
     }
     if ($__gCacheBlogSettings[$blogid] === false) {
         return null;
     }
     $gCacheStorage->purge();
     if (array_key_exists($name, $__gCacheSkinSettings[$blogid])) {
         // overwrite value
         $__gCacheSkinSettings[$blogid][$name] = $value;
         $query = DBModel::getInstance();
         $query->reset('SkinSettings');
         $query->setQualifier('blogid', 'equals', $blogid);
         $query->setQualifier('name', 'equals', $name, true);
         $query->setAttribute('blogid', $blogid);
         $query->setAttribute('name', $name, true);
         $query->setAttribute('value', $value, true);
         return $query->replace();
     }
     // insert new value
     $__gCacheSkinSettings[$blogid][$name] = $value;
     $query = DBModel::getInstance();
     $query->reset('SkinSettings');
     $query->setAttribute('blogid', $blogid);
     $query->setAttribute('name', $name, true);
     $query->setAttribute('value', $value, true);
     return $query->insert();
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:40,代码来源:Textcube.Function.Setting.php

示例5: getCalendar

function getCalendar($blogid, $period)
{
    global $database;
    $skinSetting = Setting::getSkinSettings($blogid);
    $pool = DBModel::getInstance();
    $pool->init("Entries");
    $pool->setAlias("Entries", "e");
    $pool->setQualifier("e.blogid", "eq", $blogid);
    $pool->setQualifier("e.draft", "eq", 0);
    $pool->setQualifier("e.category", ">=", 0);
    if (!doesHaveOwnership()) {
        $pool->setQualifier("e.visibility", ">", 0);
        $pool = getPrivateCategoryExclusionQualifier($pool, $blogid);
    }
    $calendar = array('days' => array());
    if ($period === true || !checkPeriod($period)) {
        $period = Timestamp::getYearMonth();
    }
    $calendar['period'] = $period;
    $calendar['year'] = substr($period, 0, 4);
    $calendar['month'] = substr($period, 4, 2);
    switch (POD::dbms()) {
        case 'Cubrid':
            $pool->setQualifier("TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'YYYY')", "eq", $calendar['year'], true);
            $pool->setQualifier("TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'MM')", "eq", $calendar['month'], true);
            $result = $pool->getAll("TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'DD')", array('filter' => 'distinct', 'usedbcache' => true, 'cacheprefix' => 'entry'));
            break;
        case 'SQLite3':
            $pool->setQualifier("strftime('%Y',e.published,'unixepoch')", "eq", $calendar['year'], true);
            $pool->setQualifier("strftime('%m',e.published,'unixepoch')", "eq", $calendar['month'], true);
            $result = $pool->getAll("strftime('%d',e.published,'unixepoch')", array('filter' => 'distinct', 'usedbcache' => true, 'cacheprefix' => 'entry'));
            break;
        case 'MySQL':
        case 'MySQLi':
        case 'PostgreSQL':
        default:
            $pool->setQualifier("YEAR(FROM_UNIXTIME(e.published))", "eq", $calendar['year'], true);
            $pool->setQualifier("MONTH(FROM_UNIXTIME(e.published))", "eq", $calendar['month'], true);
            $result = $pool->getAll("DAYOFMONTH(FROM_UNIXTIME(e.published))", array('filter' => 'distinct', 'usedbcache' => true, 'cacheprefix' => 'entry'));
            break;
    }
    if ($result) {
        foreach ($result as $dayArray) {
            list($day) = $dayArray;
            array_push($calendar['days'], $day);
        }
    }
    $calendar['days'] = array_flip($calendar['days']);
    return $calendar;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:50,代码来源:archive.php

示例6: getCategoriesSkin

function getCategoriesSkin()
{
    $ctx = Model_Context::getInstance();
    $setting = Setting::getSkinSettings(getBlogId());
    $skin = array('name' => "{$setting['skin']}", 'url' => $ctx->getProperty('service.path') . "/skin/tree/{$setting['tree']}", 'labelLength' => $setting['labelLengthOnTree'], 'showValue' => $setting['showValueOnTree'], 'itemColor' => "{$setting['colorOnTree']}", 'itemBgColor' => "{$setting['bgColorOnTree']}", 'activeItemColor' => "{$setting['activeColorOnTree']}", 'activeItemBgColor' => "{$setting['activeBgColorOnTree']}");
    return $skin;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:7,代码来源:blog.category.php

示例7: __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

示例8: setSkinSetting

function setSkinSetting($blogid, $setting)
{
    global $database;
    global $skinSetting;
    requireLibrary('blog.skin');
    $blogid = getBlogId();
    if (strncmp($skinSetting['skin'], 'customize/', 10) == 0) {
        if (strcmp($skinSetting['skin'], "customize/{$blogid}") != 0) {
            return false;
        }
    } else {
        $skinSetting['skin'] = Path::getBaseName($skinSetting['skin']);
        if ($skinSetting['skin'] === '.' || $skinSetting['skin'] === '..') {
            return _t('실패 했습니다');
        }
    }
    $skinpath = ROOT . '/skin/blog/' . $skinSetting['skin'];
    if (!is_dir($skinpath)) {
        return _t('실패 했습니다');
    }
    foreach ($setting as $key => $value) {
        Setting::setSkinSetting($key, $value, $blogid);
    }
    Setting::setSkinSetting('skin', $skinSetting['skin'], $blogid);
    Setting::setBlogSetting('useMicroformat', $setting['useMicroformat'], true);
    Setting::setBlogSetting('useAjaxComment', $setting['useAjaxComment'], true);
    Setting::setBlogSetting('useFOAF', $setting['useFOAF'] == 1 ? 1 : 0, true);
    Setting::setBlogSetting('entriesOnPage', $setting['entriesOnPage'], true);
    Setting::setBlogSetting('entriesOnList', $setting['entriesOnList'], true);
    CacheControl::flushCategory();
    CacheControl::flushTag();
    CacheControl::flushSkin();
    Setting::getSkinSettings($blogid, true);
    // refresh skin cache
    return true;
}
开发者ID:hinablue,项目名称:TextCube,代码行数:36,代码来源:blog.skin.php

示例9: getArchives

function getArchives($blogid, $option = 'yearmonth')
{
    global $database;
    $archives = array();
    $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0' . getPrivateCategoryExclusionQuery($blogid);
    $skinSetting = Setting::getSkinSettings($blogid);
    $archivesOnPage = $skinSetting['archivesOnPage'];
    switch (POD::dbms()) {
        case 'PostgreSQL':
            if ($option == 'year') {
                $format = 'year';
            } else {
                if ($option == 'month') {
                    $format = 'month';
                } else {
                    $format = 'year, month';
                }
            }
            $sql = "SELECT EXTRACT(YEAR FROM FROM_UNIXTIME(e.published)) AS year, EXTRACT(MONTH FROM FROM_UNIXTIME(e.published)) AS month, COUNT(*) AS count \n\t\t\t\tFROM {$database['prefix']}Entries e\n\t\t\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\t\t\tGROUP BY {$format} \n\t\t\t\tORDER BY {$format}\n\t\t\t\tDESC LIMIT {$archivesOnPage}";
            $result = POD::queryAllWithDBCache($sql, 'entry');
            if ($result) {
                foreach ($result as $archive) {
                    switch ($option) {
                        case 'year':
                            $archive['period'] = $archive['year'];
                            break;
                        case 'month':
                            $archive['period'] = sprintf("%02d", $archive['month']);
                            break;
                        case 'yearmonth':
                        default:
                            $archive['period'] = $archive['year'] . sprintf("%02d", $archive['month']);
                            break;
                    }
                    array_push($archives, $archive);
                }
            }
            break;
        case 'SQLite3':
            if ($option == 'year') {
                $format = '%Y';
            } else {
                if ($option == 'month') {
                    $format = '%m';
                } else {
                    $format = '%Y%m';
                }
            }
            $sql = "SELECT strftime('" . $format . "',e.published,'unixepoch') AS period, COUNT(*) AS count \n\t\t\t\tFROM {$database['prefix']}Entries e\n\t\t\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\t\t\tGROUP BY period \n\t\t\t\tORDER BY period \n\t\t\t\tDESC LIMIT {$archivesOnPage}";
            $result = POD::queryAllWithDBCache($sql, 'entry');
            if ($result) {
                foreach ($result as $archive) {
                    array_push($archives, $archive);
                }
            }
            break;
        case 'Cubrid':
            if ($option == 'year') {
                $format = 'YYYY';
            } else {
                if ($option == 'month') {
                    $format = 'MM';
                } else {
                    $format = 'YYYYMM';
                }
            }
            $sql = "SELECT TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, '{$format}') period, \n\t\t\t\tCOUNT(*) \"count\"\n\t\t\t\tFROM {$database['prefix']}Entries e\n\t\t\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\t\t\tGROUP BY TO_CHAR(to_timestamp('09:00:00 AM 01/01/1970')+e.published, 'YYYYMM') \n\t\t\t\tORDER BY period\n\t\t\t\tDESC FOR ORDERBY_NUM() BETWEEN 1 AND {$archivesOnPage}";
            $result = POD::queryAllWithDBCache($sql, 'entry');
            if ($result) {
                foreach ($result as $archive) {
                    array_push($archives, $archive);
                }
            }
            break;
        case 'MySQL':
        case 'MySQLi':
        default:
            if ($option == 'year') {
                $format = 'year';
            } else {
                if ($option == 'month') {
                    $format = 'month';
                } else {
                    $format = 'year_month';
                }
            }
            $sql = "SELECT EXTRACT({$format} FROM FROM_UNIXTIME(e.published)) period, COUNT(*) count \n\t\t\t\tFROM {$database['prefix']}Entries e\n\t\t\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 {$visibility} AND e.category >= 0 \n\t\t\t\tGROUP BY period \n\t\t\t\tORDER BY period \n\t\t\t\tDESC LIMIT {$archivesOnPage}";
            $result = POD::queryAllWithDBCache($sql, 'entry');
            if ($result) {
                foreach ($result as $archive) {
                    array_push($archives, $archive);
                }
            }
            break;
    }
    return $archives;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:97,代码来源:blog.archive.php


注:本文中的Setting::getSkinSettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。