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


PHP Setting::setSkinSetting方法代码示例

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


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

示例1: getContentWidth

 function getContentWidth()
 {
     $context = Model_Context::getInstance();
     if ($context->getProperty('skin.contentWidth') == NULL) {
         // Legacy code. ( < 1.8.4 does not have contentWidth information in DB)
         $contentWidth = 550;
         if ($skin = $context->getProperty('skin.skin')) {
             if ($xml = @file_get_contents(ROOT . "/skin/blog/{$skin}/index.xml")) {
                 $xmls = new XMLStruct();
                 $xmls->open($xml, $context->getProperty('service.encoding'));
                 if ($xmls->getValue('/skin/default/contentWidth')) {
                     $contentWidth = $xmls->getValue('/skin/default/contentWidth');
                 }
             }
         }
         Setting::setSkinSetting('contentWidth', $contentWidth);
         return $contentWidth;
     } else {
         return $context->getProperty('skin.contentWidth');
     }
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:21,代码来源:Textcube.Function.Misc.php

示例2: save

 public function save()
 {
     if (isset($this->skin)) {
         if (strncmp($this->skin, 'customize/', 10) == 0) {
             if (strcmp($this->skin, "customize/" . getBlogId()) != 0) {
                 return $this->_error('skin');
             }
         } else {
             if (!Validator::filename($this->skin)) {
                 return $this->_error('skin');
             }
         }
         if (!Validator::path($this->skin) || !file_exists(ROOT . '/skin/' . $this->skin)) {
             return $this->_error('skin');
         }
         Setting::setSkinSetting('skin', $this->skin);
     }
     if (isset($this->entriesOnRecent)) {
         if (!Validator::number($this->entriesOnRecent, 1)) {
             return $this->_error('entriesOnRecent');
         }
         Setting::setSkinSetting('entriesOnRecent', $this->entriesOnRecent);
     }
     if (isset($this->commentsOnRecent)) {
         if (!Validator::number($this->commentsOnRecent, 1)) {
             return $this->_error('commentsOnRecent');
         }
         Setting::setSkinSetting('commentsOnRecent', $this->commentsOnRecent);
     }
     if (isset($this->trackbacksOnRecent)) {
         if (!Validator::number($this->trackbacksOnRecent, 1)) {
             return $this->_error('trackbacksOnRecent');
         }
         Setting::setSkinSetting('trackbacksOnRecent', $this->trackbacksOnRecent);
     }
     if (isset($this->commentsOnGuestbook)) {
         if (!Validator::number($this->commentsOnGuestbook, 1)) {
             return $this->_error('commentsOnGuestbook');
         }
         Setting::setSkinSetting('commentsOnGuestbook', $this->commentsOnGuestbook);
     }
     if (isset($this->tagsOnTagbox)) {
         if (!Validator::number($this->tagsOnTagbox, 1)) {
             return $this->_error('tagsOnTagbox');
         }
         Setting::setSkinSetting('tagsOnTagbox', $this->tagsOnTagbox);
     }
     if (isset($this->alignOnTagbox)) {
         if (!Validator::number($this->alignOnTagbox, 1, 3)) {
             return $this->_error('alignOnTagbox');
         }
         Setting::setSkinSetting('tagboxAlign', $this->alignOnTagbox);
     }
     if (isset($this->expandComment)) {
         Setting::setSkinSetting('expandComment', Validator::getBit($this->expandComment));
     }
     if (isset($this->expandTrackback)) {
         Setting::setSkinSetting('expandTrackback', Validator::getBit($this->expandTrackback));
     }
     if (isset($this->recentNoticeLength)) {
         if (!Validator::number($this->recentNoticeLength, 0)) {
             return $this->_error('recentNoticeLength');
         }
         Setting::setSkinSetting('recentNoticeLength', $this->recentNoticeLength);
     }
     if (isset($this->recentPageLength)) {
         if (!Validator::number($this->recentPageLength, 0)) {
             return $this->_error('recentPageLength');
         }
         Setting::setSkinSetting('recentPageLength', $this->recentPageLength);
     }
     if (isset($this->recentTrackbackLength)) {
         if (!Validator::number($this->recentTrackbackLength, 0)) {
             return $this->_error('recentTrackbackLength');
         }
         Setting::setSkinSetting('recentTrackbackLength', $this->recentTrackbackLength);
     }
     if (isset($this->linkLength)) {
         if (!Validator::number($this->linkLength, 0)) {
             return $this->_error('linkLength');
         }
         Setting::setSkinSetting('linkLength', $this->linkLength);
     }
     if (isset($this->showListOnCategory)) {
         Setting::setSkinSetting('showListOnCategory', Validator::getBit($this->showListOnCategory));
     }
     if (isset($this->showListOnArchive)) {
         Setting::setSkinSetting('showListOnArchive', Validator::getBit($this->showListOnArchive));
     }
     if (isset($this->tree)) {
         if (!Validator::directory($this->tree) || !file_exists(ROOT . '/skin/tree/' . $this->tree)) {
             return $this->_error('tree');
         }
         Setting::setSkinSetting('tree', $this->tree);
     }
     if (isset($this->colorOnTree)) {
         Setting::setSkinSetting('colorOnTree', $this->colorOnTree);
     }
     if (isset($this->bgcolorOnTree)) {
         Setting::setSkinSetting('bgcolorOnTree', $this->bgcolorOnTree);
//.........这里部分代码省略.........
开发者ID:ragi79,项目名称:Textcube,代码行数:101,代码来源:Textcube.Data.SkinSetting.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($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


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