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


PHP Setting::setBlogSetting方法代码示例

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


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

示例1: setBlogTitle

function setBlogTitle($blogid, $title)
{
    $context = Model_Context::getInstance();
    if ($title == $context->getProperty('blog.title')) {
        return true;
    }
    if (Setting::setBlogSetting('title', Utils_Unicode::lessenAsEncoding($title, 255), true) === false) {
        return false;
    }
    $context->setProperty('blog.title', $title);
    requireModel('blog.feed');
    requireLibrary('blog.skin');
    clearFeed();
    CacheControl::flushSkin();
    return true;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:16,代码来源:blog.blogSetting.php

示例2: setBlogSetting

 function setBlogSetting($name, $value)
 {
     return Setting::setBlogSetting($name, $value);
 }
开发者ID:ragi79,项目名称:Textcube,代码行数:4,代码来源:Textcube.Function.Misc.php

示例3: empty

        if ($_POST['permalink'] == '') {
            $entry['slogan'] = '';
        }
    }
    $entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1;
    $entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1;
    $entry['published'] = empty($_POST['published']) ? 0 : $_POST['published'];
    $entry['draft'] = 0;
    if (strpos($entry['slogan'], 'TCDraftPost') === 0) {
        $entry['slogan'] = $entry['title'];
    }
    if (empty($suri['id'])) {
        if ($id = addEntry($blogid, $entry)) {
            fireEvent('AddPost', $id, $entry);
            Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $id, true);
            $result = array();
            $result['error'] = ($id !== false) === true ? 0 : 1;
            $result['entryId'] = $id;
            Respond::PrintResult($result);
            exit;
        }
    } else {
        if ($id = updateEntry($blogid, $entry, $updateDraft)) {
            fireEvent('UpdatePost', $id, $entry);
            Setting::setBlogSetting('LatestEditedEntry_user' . getUserId(), $suri['id'], true);
            Respond::ResultPage(0);
            exit;
        }
    }
}
Respond::ResultPage(-1);
开发者ID:Avantians,项目名称:Textcube,代码行数:31,代码来源:index.php

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

示例5: updateEntry

function updateEntry($blogid, $entry, $updateDraft = 0)
{
    global $database, $blog, $gCacheStorage;
    requireModel('blog.tag');
    requireModel('blog.locative');
    requireModel('blog.attachment');
    requireModel('blog.category');
    requireModel('blog.feed');
    requireComponent('Textcube.Data.Tag');
    if ($entry['id'] == 0) {
        return false;
    }
    $oldEntry = POD::queryRow("SELECT *\n\t\tFROM {$database['prefix']}Entries\n\t\tWHERE blogid = {$blogid}\n\t\tAND id = {$entry['id']}\n\t\tAND draft = 0");
    if (empty($oldEntry)) {
        return false;
    }
    if (empty($entry['userid'])) {
        $entry['userid'] = getUserId();
    }
    $entry['title'] = UTF8::lessenAsEncoding(trim($entry['title']));
    $entry['location'] = UTF8::lessenAsEncoding(trim($entry['location']));
    $entry['slogan'] = array_key_exists('slogan', $entry) ? trim($entry['slogan']) : '';
    if (empty($entry['slogan'])) {
        $slogan = $slogan0 = getSlogan($entry['title']);
    } else {
        $slogan = $slogan0 = getSlogan($entry['slogan']);
    }
    $slogan = POD::escapeString(UTF8::lessenAsEncoding($slogan, 255));
    $title = POD::escapeString($entry['title']);
    if ($entry['category'] == -1) {
        if ($entry['visibility'] == 1 || $entry['visibility'] == 3) {
            return false;
        }
        if (POD::queryCell("SELECT count(*) \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND id <> {$entry['id']} \n\t\t\t\tAND draft = 0 \n\t\t\t\tAND title = '{$title}' \n\t\t\t\tAND category = -1") > 0) {
            return false;
        }
    }
    if ($entry['category'] < 0) {
        if ($entry['visibility'] == 1) {
            $entry['visibility'] = 0;
        }
        if ($entry['visibility'] == 3) {
            $entry['visibility'] = 2;
        }
    }
    if ($entry['category'] == -4) {
        $entry['visibility'] = 0;
    }
    $result = POD::queryCount("SELECT slogan \n\t\tFROM {$database['prefix']}Entries \n\t\tWHERE blogid = {$blogid} \n\t\tAND slogan = '{$slogan}' \n\t\tAND id = {$entry['id']} \n\t\tAND draft = 0\n\t\tLIMIT 1");
    if ($result == 0) {
        // if changed
        $result = POD::queryCount("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND slogan = '{$slogan}' AND draft = 0 LIMIT 1");
        for ($i = 1; $result > 0; $i++) {
            if ($i > 1000) {
                return false;
            }
            $slogan = POD::escapeString(UTF8::lessenAsEncoding($slogan0, 245) . '-' . $i);
            $result = POD::queryCount("SELECT slogan FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND slogan = '{$slogan}' AND draft = 0 LIMIT 1");
        }
    }
    $tags = getTagsWithEntryString($entry['tag']);
    Tag::modifyTagsWithEntryId($blogid, $entry['id'], $tags);
    $location = POD::escapeString($entry['location']);
    $latitude = isset($entry['latitude']) && !is_null($entry['latitude']) ? $entry['latitude'] : 'NULL';
    $longitude = isset($entry['longitude']) && !is_null($entry['longitude']) ? $entry['longitude'] : 'NULL';
    $content = POD::escapeString($entry['content']);
    $contentformatter = POD::escapeString($entry['contentformatter']);
    $contenteditor = POD::escapeString($entry['contenteditor']);
    switch ($entry['published']) {
        case 0:
            $published = 'published';
            break;
        case 1:
            $published = 'UNIX_TIMESTAMP()';
            break;
        default:
            $published = $entry['published'];
            $entry['visibility'] = 0 - $entry['visibility'];
            if ($entry['visibility'] < 0) {
                $closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', 9999999999);
                if ($published < $closestReservedTime) {
                    Setting::setBlogSetting('closestReservedPostTime', $published, true);
                }
            }
            break;
    }
    $result = POD::query("UPDATE {$database['prefix']}Entries\n\t\t\tSET\n\t\t\t\tuserid             = {$entry['userid']},\n\t\t\t\tvisibility         = {$entry['visibility']},\n\t\t\t\tstarred            = {$entry['starred']},\n\t\t\t\tcategory           = {$entry['category']},\n\t\t\t\tdraft              = 0,\n\t\t\t\tlocation           = '{$location}',\n\t\t\t\tlatitude           = {$latitude},\n\t\t\t\tlongitude          = {$longitude},\n\t\t\t\ttitle              = '{$title}',\n\t\t\t\tcontent            = '{$content}',\n\t\t\t\tcontentformatter   = '{$contentformatter}',\n\t\t\t\tcontenteditor      = '{$contenteditor}',\n\t\t\t\tslogan             = '{$slogan}',\n\t\t\t\tacceptcomment      = {$entry['acceptcomment']},\n\t\t\t\taccepttrackback    = {$entry['accepttrackback']},\n\t\t\t\tpublished          = {$published},\n\t\t\t\tmodified           = UNIX_TIMESTAMP()\n\t\t\tWHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = {$updateDraft}");
    if ($result) {
        @POD::query("DELETE FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = 1");
    }
    updateCategoryByEntryId($blogid, $entry['id'], 'update', array('category' => array($oldEntry['category'], $entry['category']), 'visibility' => array($oldEntry['visibility'], $entry['visibility'])));
    CacheControl::flushEntry($entry['id']);
    $gCacheStorage->purge();
    if ($entry['visibility'] == 3) {
        syndicateEntry($entry['id'], 'modify');
    }
    POD::query("UPDATE {$database['prefix']}Attachments SET parent = {$entry['id']} WHERE blogid = {$blogid} AND parent = 0");
    if ($entry['visibility'] >= 2) {
        clearFeed();
    }
//.........这里部分代码省略.........
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:blog.entry.php

示例6: array

        break;
    }
}
$newParameter = array();
foreach ($parameters as $item) {
    if (isset($_REQUEST[$item['name']])) {
        switch ($item['type']) {
            case 'string':
                break;
            case 'int':
                if (!is_numeric($_REQUEST[$item['name']])) {
                    continue;
                }
                break;
            default:
                continue;
                break;
        }
        $newParameter[$item['name']] = $_REQUEST[$item['name']];
    }
}
$eventName = 'ModifyPluginParam_' . $plugin;
fireEvent($eventName, null, $plugin);
$coverpageOrderData[$coverpageNumber][$modulePos]['parameters'] = $newParameter;
Setting::setBlogSetting("coverpageOrder", serialize($coverpageOrderData));
if ($ajaxcall == false) {
    if ($_REQUEST['viewMode'] != '') {
        $_REQUEST['viewMode'] = '?' . $_REQUEST['viewMode'];
    }
    header('Location: ' . $context->getProperty('uri.blog') . '/owner/skin/coverpage' . $_REQUEST['viewMode']);
}
开发者ID:ragi79,项目名称:Textcube,代码行数:31,代码来源:index.php

示例7: PN_Referer_Default

function PN_Referer_Default()
{
    global $pluginMenuURL, $pluginSelfParam;
    if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['page'])) {
        $_GET['page'] = $_POST['page'];
    }
    $page = Setting::getBlogSetting('RowsPerPageReferer', 20);
    if (empty($_POST['perPage'])) {
        $perPage = $page;
    } else {
        if ($page != $_POST['perPage']) {
            Setting::setBlogSetting('RowsPerPageReferer', $_POST['perPage']);
            $perPage = $_POST['perPage'];
        } else {
            $perPage = $_POST['perPage'];
        }
    }
    ?>
						<div id="part-statistics-rank" class="part">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("리퍼러 순위");
    ?>
</span></h2>
							
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="number"><span class="text"><?php 
    echo _t("순위");
    ?>
</span></th>
										<th class="site"><span class="text"><?php 
    echo _t("리퍼러");
    ?>
</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $temp = Statistics::getRefererStatistics(getBlogId());
    for ($i = 0; $i < count($temp); $i++) {
        $record = $temp[$i];
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($temp) - 1 ? ' last-line' : '';
        ?>
									<tr class="<?php 
        echo $className;
        ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
										<td class="rank"><?php 
        echo $i + 1;
        ?>
.</td>
										<td class="site"><a href="http://<?php 
        echo Utils_Misc::escapeJSInAttribute($record['host']);
        ?>
" onclick="window.open(this.href); return false;"><?php 
        echo htmlspecialchars($record['host']);
        ?>
</a> <span class="count">(<?php 
        echo $record['count'];
        ?>
)</span></td>
									</tr>
<?php 
    }
    ?>
								</tbody>
							</table>
						</div>
						
						<hr class="hidden" />
						
						<form id="part-statistics-log" class="part" method="post" action="<?php 
    echo $pluginMenuURL;
    ?>
">
							<h2 class="caption"><span class="main-text"><?php 
    echo _t("리퍼러 로그");
    ?>
</span></h2>
							
							<table class="data-inbox" cellspacing="0" cellpadding="0">
								<thead>
									<tr>
										<th class="number"><span class="text">날짜</span></th>
										<th class="site"><span class="text">주소</span></th>
									</tr>
								</thead>
								<tbody>
<?php 
    $more = false;
    list($referers, $paging) = Statistics::getRefererLogsWithPage($_GET['page'], $perPage);
    for ($i = 0; $i < count($referers); $i++) {
        $record = $referers[$i];
        $className = $i % 2 == 1 ? 'even-line' : 'odd-line';
        $className .= $i == sizeof($referers) - 1 ? ' last-line' : '';
        ?>
									<tr class="<?php 
        echo $className;
//.........这里部分代码省略.........
开发者ID:Avantians,项目名称:Textcube,代码行数:101,代码来源:index.php

示例8: PN_Subscription_setTime

function PN_Subscription_setTime($target)
{
    requireComponent("Textcube.Function.Setting");
    Setting::setBlogSetting('LatestRSSrefresh', time());
    return true;
}
开发者ID:ragi79,项目名称:Textcube,代码行数:6,代码来源:index.php

示例9: define

<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_HEADER_XML__', true);
require ROOT . '/library/preprocessor.php';
if ($_POST['visibility'] == 'private') {
    $visibility = 'private';
} else {
    $visibility = 'public';
}
$password = Setting::getBlogSetting('LinePassword', null, true);
if (is_null($password)) {
    $password = md5(generatePassword());
    Setting::setBlogSetting('LinePassword', $password, true);
}
$provider = new Model_OpenSearchProvider();
$provider->setDescriptor('ShortName', Setting::getBlogSetting('title', 'TITLE', true));
$provider->setDescriptor('Description', Setting::getBlogSetting('description', 'DESCRIPTION', true));
$provider->setDescriptor('Url', null);
$provider->addAttribute('/OpenSearchDescription', 'xmlns', 'http://a9.com/-/spec/opensearch/1.1/');
$provider->addAttribute('/OpenSearchDescription/Url', 'type', 'text/html');
$provider->addAttribute('/OpenSearchDescription/Url', 'template', $context->getProperty('uri.default') . '/line?key=' . $password . '&amp;mode=' . $visibility . '&amp;content={searchTerms}');
$provider->setDescriptor('Language', Setting::getBlogSetting('language', 'ko-kr', true));
$provider->setDescriptor('OutputEncoding', 'utf-8');
$provider->setDescriptor('InputEncoding', 'utf-8');
$provider->generate();
echo $provider->_xmlcontent;
开发者ID:Avantians,项目名称:Textcube,代码行数:29,代码来源:index.php

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

示例11: updateEntry

function updateEntry($blogid, $entry, $updateDraft = 0)
{
    $gCacheStorage = globalCacheStorage::getInstance();
    $pool = DBModel::getInstance();
    importlib('model.blog.tag');
    importlib('model.blog.locative');
    importlib('model.blog.attachment');
    importlib('model.blog.category');
    importlib('model.blog.feed');
    if ($entry['id'] == 0) {
        return false;
    }
    $pool->init("Entries");
    $pool->setQualifier("blogid", "eq", $blogid);
    $pool->setQualifier("id", "eq", $entry['id']);
    $pool->setQualifier("draft", "eq", 0);
    $oldEntry = $pool->getRow();
    if (empty($oldEntry)) {
        return false;
    }
    if (empty($entry['userid'])) {
        $entry['userid'] = getUserId();
    }
    $entry['title'] = Utils_Unicode::lessenAsEncoding(trim($entry['title']));
    $entry['location'] = Utils_Unicode::lessenAsEncoding(trim($entry['location']));
    $entry['slogan'] = array_key_exists('slogan', $entry) ? trim($entry['slogan']) : '';
    if (empty($entry['slogan'])) {
        $slogan = $slogan0 = getSlogan($entry['title']);
    } else {
        $slogan = $slogan0 = getSlogan($entry['slogan']);
    }
    $slogan = Utils_Unicode::lessenAsEncoding($slogan, 255);
    if ($entry['category'] == -1) {
        if ($entry['visibility'] == 1 || $entry['visibility'] == 3) {
            return false;
        }
        $pool->init("Entries");
        $pool->setQualifier("blogid", "eq", $blogid);
        $pool->setQualifier("id", "neq", $entry['id']);
        $pool->setQualifier("draft", "eq", 0);
        $pool->setQualifier("title", "eq", $entry['title'], true);
        $pool->setQualifier("category", "eq", -1);
        if ($pool->getCount() > 0) {
            return false;
        }
    }
    if ($entry['category'] < 0) {
        if ($entry['visibility'] == 1) {
            $entry['visibility'] = 0;
        }
        if ($entry['visibility'] == 3) {
            $entry['visibility'] = 2;
        }
    }
    if ($entry['category'] == -4) {
        $entry['visibility'] = 0;
    }
    $slogan = getUniqueSlogan($blogid, $slogan, $entry['id'], true);
    $tags = getTagsWithEntryString($entry['tag']);
    Tag::modifyTagsWithEntryId($blogid, $entry['id'], $tags);
    $latitude = isset($entry['latitude']) && !is_null($entry['latitude']) ? $entry['latitude'] : null;
    $longitude = isset($entry['longitude']) && !is_null($entry['longitude']) ? $entry['longitude'] : null;
    switch ($entry['published']) {
        case 0:
            $published = $oldEntry['published'];
            break;
        case 1:
            $published = Timestamp::getUNIXtime();
            break;
        default:
            $published = $entry['published'];
            $entry['visibility'] = 0 - $entry['visibility'];
            if ($entry['visibility'] < 0) {
                $closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', 9999999999.0);
                if ($published < $closestReservedTime) {
                    Setting::setBlogSetting('closestReservedPostTime', $published, true);
                }
            }
            break;
    }
    $pool->reset("Entries");
    $pool->setAttribute("userid", $entry['userid']);
    $pool->setAttribute("draft", 0);
    $pool->setAttribute("visibility", $entry['visibility']);
    $pool->setAttribute("starred", $entry['starred']);
    $pool->setAttribute("category", $entry['category']);
    $pool->setAttribute("title", $entry['title'], true);
    $pool->setAttribute("slogan", $slogan, true);
    $pool->setAttribute("content", $entry['content'], true);
    $pool->setAttribute("contentformatter", $entry['contentformatter'], true);
    $pool->setAttribute("contenteditor", $entry['contenteditor'], true);
    $pool->setAttribute("location", $entry['location'], true);
    $pool->setAttribute("latitude", $latitude);
    $pool->setAttribute("longitude", $longitude);
    $pool->setAttribute("acceptcomment", $entry['acceptcomment']);
    $pool->setAttribute("accepttrackback", $entry['accepttrackback']);
    $pool->setAttribute("published", $published);
    $pool->setAttribute("modified", Timestamp::getUNIXtime());
    $pool->setQualifier("blogid", "eq", $blogid);
    $pool->setQualifier("id", "eq", $entry['id']);
//.........这里部分代码省略.........
开发者ID:ni5am,项目名称:Textcube,代码行数:101,代码来源:entry.php

示例12: PN_Subscription_setTime

function PN_Subscription_setTime($target)
{
    Setting::setBlogSetting('LatestRSSrefresh', time());
    return true;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:5,代码来源:index.php


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