本文整理汇总了PHP中Setting::setBlogSettingGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::setBlogSettingGlobal方法的具体用法?PHP Setting::setBlogSettingGlobal怎么用?PHP Setting::setBlogSettingGlobal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::setBlogSettingGlobal方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: KeywordUI_handleConfig
function KeywordUI_handleConfig($data)
{
$config = Setting::fetchConfigVal($data);
if ($config['useKeywordAsTag'] == true) {
Setting::setBlogSettingGlobal('useKeywordAsTag', true);
}
return true;
}
示例2: publishEntries
function publishEntries()
{
$ctx = Model_Context::getInstance();
$pool = DBModel::getInstance();
$blogid = getBlogId();
$closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', INT_MAX);
if ($closestReservedTime < Timestamp::getUNIXtime()) {
$pool->init("Entries");
$pool->setQualifier("blogid", "eq", $blogid);
$pool->setQualifier("draft", "eq", 0);
$pool->setQualifier("visibility", "<", 0);
$pool->setQualifier("published", "<", Timestamp::getUNIXtime());
$entries = $pool->getAll("id, visibility, category");
if (count($entries) == 0) {
return;
}
foreach ($entries as $entry) {
$pool->init("Entries");
$pool->setQualifier("blogid", "eq", $blogid);
$pool->setQualifier("draft", "eq", 0);
$pool->setQualifier("id", "eq", $entry['id']);
$pool->setAttribute("visibility", 0);
$result = $pool->update();
if ($entry['visibility'] == -3) {
if ($result && setEntryVisibility($entry['id'], 2)) {
$updatedEntry = getEntry($blogid, $entry['id']);
if (!is_null($updatedEntry)) {
fireEvent('UpdatePost', $entry['id'], $updatedEntry);
setEntryVisibility($entry['id'], 3);
}
}
} else {
if ($result) {
setEntryVisibility($entry['id'], abs($entry['visibility']));
$updatedEntry = getEntry($blogid, $entry['id']);
if (!is_null($updatedEntry)) {
fireEvent('UpdatePost', $entry['id'], $updatedEntry);
}
}
}
}
$pool->init("Entries");
$pool->setQualifier("blogid", "eq", $blogid);
$pool->setQualifier("draft", "eq", 0);
$pool->setQualifier("visibility", "<", 0);
$pool->setQualifier("published", ">", Timestamp::getUNIXtime());
$newClosestTime = $pool->getCell("min(published)");
if (!empty($newClosestTime)) {
Setting::setBlogSettingGlobal('closestReservedPostTime', $newClosestTime);
} else {
Setting::setBlogSettingGlobal('closestReservedPostTime', INT_MAX);
}
}
}
示例3: metaWeblog_editPost
function metaWeblog_editPost()
{
$params = func_get_args();
$result = api_login($params[1], $params[2]);
if ($result) {
return $result;
}
$post = api_make_post($params[3], $params[4], $params[0]);
$post->created = null;
if (!$post) {
return new XMLRPCFault(1, "Textcube editing error");
}
$ret = $post->update();
// 기존 글의 파일들 지우기 (잘 찾아서)
// 새로 업로드 된 파일들 옮기기
api_update_attaches_with_replace($post->id);
fireEvent('UpdatePostByBlogAPI', $id, $post);
RSS::refresh();
$post->close();
if ($ret != false) {
Setting::setBlogSettingGlobal('LatestEditedEntry', $post->id);
}
return $ret ? true : false;
}
示例4: setBlogSetting
function setBlogSetting($name, $value, $blogid = null)
{
return Setting::setBlogSettingGlobal($name, $value, $blogid);
}
示例5: array
if (isset($_GET['trashType'])) {
$_POST['trashType'] = $_GET['trashType'];
}
$IV = array('GET' => array('page' => array('int', 1, 'default' => 1)), 'POST' => array('category' => array('int', 'default' => 0), 'site' => array('string', 'default' => ''), 'url' => array('url', 'default' => ''), 'ip' => array('ip', 'default' => ''), 'withSearch' => array(array('on'), 'mandatory' => false), 'search' => array('string', 'default' => ''), 'perPage' => array('int', 10, 30, 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.response.remote");
requireModel("blog.trash");
$categoryId = empty($_POST['category']) ? 0 : $_POST['category'];
$site = empty($_POST['site']) ? '' : $_POST['site'];
$url = empty($_POST['url']) ? '' : $_POST['url'];
$ip = empty($_POST['ip']) ? '' : $_POST['ip'];
$search = empty($_POST['withSearch']) || empty($_POST['search']) ? '' : trim($_POST['search']);
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
$perPage = $_POST['perPage'];
Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}
$tabsClass = array();
$tabsClass['postfix'] = null;
$tabsClass['postfix'] .= isset($_POST['category']) ? '&category=' . $_POST['category'] : '';
$tabsClass['postfix'] .= isset($_POST['site']) ? '&site=' . $_POST['site'] : '';
$tabsClass['postfix'] .= isset($_POST['ip']) ? '&ip=' . $_POST['ip'] : '';
$tabsClass['postfix'] .= isset($_POST['search']) ? '&search=' . $_POST['search'] : '';
$tabsClass['trash'] = true;
list($trackbacks, $paging) = getTrashTrackbackWithPagingForOwner($blogid, $categoryId, $site, $url, $ip, $search, $suri['page'], $perPage);
require ROOT . '/interface/common/owner/header.php';
?>
<script type="text/javascript">
//<![CDATA[
function changeState(caller, value, mode) {
try {
示例6: addBlog
function addBlog($blogid, $userid, $identify)
{
$ctx = Model_Context::getInstance();
$pool = DBModel::getInstance();
if (empty($userid)) {
$userid = 1;
// If no userid, choose the service administrator.
} else {
$pool->reset('Users');
$pool->setQualirifer('userid', 'eq', $userid);
if (!$pool->doesExist('userid')) {
return 3;
}
// 3: No user exists with specific userid
}
if (!empty($blogid)) {
// If blogid,
$pool->reset('BlogSettings');
$pool->setQualirifer('blogid', 'eq', $blogid);
if (!$pool->doesExist('blogid')) {
return 2;
}
// 2: No blog exists with specific blogid
// Thus, blog and user exists. Now combine both.
$pool->reset('Privileges');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('userid', $userid);
$pool->setAttribute('acl', 0);
$pool->setAttribute('created', Timestamp::getUNIXtime());
$pool->setAttribute('lastlogin', 0);
$result = $pool->insert();
return $result;
} else {
// If no blogid, create a new blog.
if (!preg_match('/^[a-zA-Z0-9]+$/', $identify)) {
return 4;
}
// Wrong Blog name
$identify = POD::escapeString(Utils_Unicode::lessenAsEncoding($identify, 32));
$blogName = $identify;
$pool->reset('ReservedWords');
$pool->setQualifier('word', 'eq', $blogName, true);
$result = $pool->getCount();
if ($result && $result > 0) {
return 60;
// Reserved blog name.
}
$pool->reset('BlogSettings');
$pool->setQualifier('name', 'eq', 'name', true);
$pool->setQualifier('value', 'eq', $blogName, true);
$result = $pool->getCount('value');
if ($result && $result > 0) {
return 61;
// Same blogname is already exists.
}
$pool->reset('BlogSettings');
$blogid = $pool->getCell('max(blogid)') + 1;
$basicInformation = array('name' => $identify, 'defaultDomain' => 0, 'title' => '', 'description' => '', 'logo' => '', 'logoLabel' => '', 'logoWidth' => 0, 'logoHeight' => 0, 'useFeedViewOnCategory' => 1, 'useSloganOnPost' => 1, 'useSloganOnCategory' => 1, 'useSloganOnTag' => 1, 'entriesOnPage' => 10, 'entriesOnList' => 10, 'entriesOnRSS' => 10, 'commentsOnRSS' => 10, 'publishWholeOnRSS' => 1, 'publishEolinSyncOnRSS' => 1, 'allowWriteOnGuestbook' => 1, 'allowWriteDblCommentOnGuestbook' => 1, 'visibility' => 2, 'language' => $ctx->getProperty('service.language'), 'blogLanguage' => $ctx->getProperty('service.language'), 'timezone' => $ctx->getProperty('service.timezone'));
$isFalse = false;
foreach ($basicInformation as $fieldname => $fieldvalue) {
if (Setting::setBlogSettingDefault($fieldname, $fieldvalue, $blogid) === false) {
$isFalse = true;
}
}
if ($isFalse == true) {
$pool->reset('BlogSettings');
$pool->setQualifier('blogid', 'eq', $blogid);
$pool->delete();
return 12;
}
$pool->reset('SkinSettings');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('name', 'skin', true);
$pool->setAttribute('value', $ctx->getProperty('service.skin'), true);
if (!$pool->insert()) {
deleteBlog($blogid);
return 13;
}
$pool->reset('FeedSettings');
$pool->setAttribute('blogid', $blogid);
if (!$pool->insert()) {
deleteBlog($blogid);
return 62;
}
$pool->reset('FeedGroups');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('id', 0);
if (!$pool->insert()) {
deleteBlog($blogid);
return 62;
}
Setting::setBlogSettingGlobal('defaultEditor', 'modern', $blogid);
Setting::setBlogSettingGlobal('defaultFormatter', 'ttml', $blogid);
//Combine user and blog.
$pool->reset('Privileges');
$pool->setAttribute('blogid', $blogid);
$pool->setAttribute('userid', $userid);
$pool->setAttribute('acl', 16);
$pool->setAttribute('created', Timestamp::getUNIXtime());
$pool->setAttribute('lastlogin', 0);
//.........这里部分代码省略.........
示例7: moblog_manage
function moblog_manage()
{
global $blogURL;
if (Acl::check('group.administrators') && $_SERVER['REQUEST_METHOD'] == 'POST') {
Setting::setBlogSettingGlobal('MmsPop3Email', $_POST['pop3email']);
Setting::setBlogSettingGlobal('MmsPop3Host', $_POST['pop3host']);
Setting::setBlogSettingGlobal('MmsPop3Port', $_POST['pop3port']);
Setting::setBlogSettingGlobal('MmsPop3Ssl', !empty($_POST['pop3ssl']) ? 1 : 0);
Setting::setBlogSettingGlobal('MmsPop3Username', $_POST['pop3username']);
Setting::setBlogSettingGlobal('MmsPop3Password', $_POST['pop3password']);
Setting::setBlogSettingGlobal('MmsPop3Visibility', $_POST['pop3visibility']);
Setting::setBlogSettingGlobal('MmsPop3Category', $_POST['pop3category']);
Setting::setBlogSettingGlobal('MmsPop3Fallbackuserid', getUserId());
Setting::setBlogSettingGlobal('MmsPop3MinSize', 0);
Setting::setBlogSettingGlobal('MmsPop3AllowOnly', !empty($_POST['pop3allowonly']) ? 1 : 0);
Setting::setBlogSettingGlobal('MmsPop3Allow', $_POST['pop3allow']);
Setting::setBlogSettingGlobal('MmsPop3Subject', $_POST['pop3subject']);
}
$pop3email = Setting::getBlogSettingGlobal('MmsPop3Email', '');
$pop3host = Setting::getBlogSettingGlobal('MmsPop3Host', 'localhost');
$pop3port = Setting::getBlogSettingGlobal('MmsPop3Port', 110);
$pop3ssl = Setting::getBlogSettingGlobal('MmsPop3Ssl', 0) ? " checked=1 " : "";
$pop3username = Setting::getBlogSettingGlobal('MmsPop3Username', '');
$pop3password = Setting::getBlogSettingGlobal('MmsPop3Password', '');
$pop3minsize = Setting::getBlogSettingGlobal('MmsPop3MinSize', 0);
$pop3category = Setting::getBlogSettingGlobal('MmsPop3Category', 0);
$pop3fallheadercharset = Setting::getBlogSettingGlobal('MmsPop3Fallbackcharset', 'euc-kr');
$pop3visibility = Setting::getBlogSettingGlobal('MmsPop3Visibility', '2');
$pop3mmsallowonly = Setting::getBlogSettingGlobal('MmsPop3AllowOnly', '0');
$pop3mmsallow = Setting::getBlogSettingGlobal('MmsPop3Allow', '');
$pop3subject = Setting::getBlogSettingGlobal('MmsPop3Subject', '%Y-%M-%D');
?>
<hr class="hidden" />
<div id="part-setting-editor" class="part">
<h2 class="caption"><span class="main-text"><?php
echo _t('MMS 메시지 확인용 메일 환경 설정');
?>
</span></h2>
<?php
if (!Acl::check("group.administrators")) {
?>
<div id="editor-section" class="section">
<dl id="formatter-line" class="line">
<dt><span class="label"><?php
echo _t('MMS 수신 이메일');
?>
</span></dt>
<dd>
<?php
if (empty($pop3email)) {
?>
<?php
echo _t('비공개');
?>
<?php
} else {
?>
<?php
echo $pop3email;
?>
<?php
}
?>
</dd>
<dd>
<?php
if (empty($pop3email)) {
?>
<?php
echo _t('이동전화에서 보내는 이메일을 수신할 주소가 공개되지 않았습니다');
?>
<?php
} else {
?>
<?php
echo _t('이동전화를 이용하여 위 메일로 이메일을 보내면 블로그에 게시됩니다');
?>
<?php
}
?>
</dd>
</dl>
</div>
<?php
} else {
?>
<script type="text/javascript">
function changehost(packedhost)
{
var h = packedhost.split( ':' );
document.forms['editor-form']['pop3host'].value = h[0];
document.forms['editor-form']['pop3port'].value = h[1];
document.forms['editor-form']['pop3ssl'].checked = !!parseInt(h[2]);
}
function renderhosts()
{
var hosts = "<?php
echo _t('PREDEFINED POP3 HOSTS');
?>
//.........这里部分代码省略.........
示例8: array
$IV = array('POST' => array('visibility' => array('int', 0, 3), 'starred' => array('int', 0, 2), 'category' => array('int', 'default' => 0), 'title' => array('string'), 'content' => array('string'), 'contentformatter' => array('string'), 'contenteditor' => array('string'), 'permalink' => array('string', 'default' => ''), 'location' => array('string', 'default' => '/'), 'latitude' => array('number', 'default' => null, 'min' => -90.0, 'max' => 90.0, 'bypass' => true), 'longitude' => array('number', 'default' => null, 'min' => -180.0, 'max' => 180.0, 'bypass' => true), 'tag' => array('string', 'default' => ''), 'acceptcomment' => array(array('0', '1'), 'default' => '0'), 'accepttrackback' => array(array('0', '1'), 'default' => '0'), 'published' => array('int', 0, 'default' => 1), 'draft' => array(array('0', '1'), 'default' => '0')));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.entry");
requireStrictRoute();
$entry = array();
$entry['visibility'] = $_POST['visibility'];
$entry['starred'] = $_POST['starred'];
$entry['category'] = empty($_POST['category']) ? 0 : $_POST['category'];
$entry['title'] = $_POST['title'];
if (isset($_POST['permalink']) && $_POST['permalink'] != '') {
$entry['slogan'] = $_POST['permalink'];
}
$entry['content'] = $_POST['content'];
$entry['contentformatter'] = $_POST['contentformatter'];
$entry['contenteditor'] = $_POST['contenteditor'];
$entry['location'] = empty($_POST['location']) ? '/' : $_POST['location'];
$entry['latitude'] = empty($_POST['latitude']) || $_POST['latitude'] == "null" ? null : $_POST['latitude'];
$entry['longitude'] = empty($_POST['longitude']) || $_POST['longitude'] == "null" ? null : $_POST['longitude'];
$entry['tag'] = empty($_POST['tag']) ? '' : $_POST['tag'];
$entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1;
$entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1;
$entry['published'] = empty($_POST['published']) ? 1 : $_POST['published'];
$entry['draft'] = empty($_POST['draft']) ? 0 : $_POST['draft'];
if ($id = addEntry($blogid, $entry)) {
fireEvent('AddPost', $id, $entry);
Setting::setBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), $id);
}
$result = array();
$result['error'] = ($id !== false) === true ? 0 : 1;
$result['entryId'] = $id;
Respond::PrintResult($result);
示例9: array
<?php
/// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('frontpage' => array('string', 'default' => '')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (!empty($_POST['frontpage'])) {
if (in_array($_POST['frontpage'], array('entry', 'cover', 'line'))) {
Setting::setBlogSettingGlobal('frontpage', $_POST['frontpage']);
Respond::ResultPage(0);
}
}
Respond::ResultPage(-1);
示例10: setGuestbook
function setGuestbook($blogid, $write, $comment)
{
if (!is_numeric($write) || !is_numeric($comment)) {
return false;
}
if (Setting::setBlogSettingGlobal('allowWriteOnGuestbook', $write) && Setting::setBlogSettingGlobal('allowWriteDblCommentOnGuestbook', $comment)) {
return true;
} else {
return false;
}
}
示例11: array
for($i = 0; $i < (2-$seperatorCount); $i++) {
array_push($newlayout, array('plugin' => 'TextcubeSeparator'));
}
array_push($newlayout, array('plugin' => 'defaultDashboardWidget'));
} else {
array_splice($newlayout, $defaultWidgetPosition, 0, array(array('plugin' => 'defaultDashboardWidget')));
}*/
$modified = true;
}
}
if (count($centerMappings) > 0 || count($addedlayout) > 0 || $modified == true) {
$saveLayout = array_values($newlayout);
for ($i = 0; $i < count($saveLayout); $i++) {
unset($saveLayout[$i]['title']);
}
Setting::setBlogSettingGlobal('centerLayout', serialize($saveLayout));
}
unset($addedlayout);
unset($layout);
unset($oldcenterlayout);
if (isset($_REQUEST['ajaxcall'])) {
Respond::ResultPage(0);
exit;
}
$editClass = NULL;
if (isset($_REQUEST['edit'])) {
$editClass = "-edit";
?>
<script src="<?php
echo $ctx->getProperty('service.path');
?>
示例12: requireLibrary
require ROOT . '/library/preprocessor.php';
requireLibrary('blog.skin');
requireModel("blog.sidebar");
requireStrictRoute();
$ctx = Model_Context::getInstance();
$skin = new Skin($ctx->getProperty('skin.skin'));
$sidebarCount = count($skin->sidebarBasicModules);
$sidebarOrder = getSidebarModuleOrderData($sidebarCount);
if ($_REQUEST['targetPos'] < 0 || $_REQUEST['targetPos'] > count($sidebarOrder[$_REQUEST['sidebarNumber']]) || $_REQUEST['targetSidebarNumber'] < 0 || $_REQUEST['targetSidebarNumber'] >= count($sidebarOrder)) {
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
header('Location: ' . $context->getProperty('uri.blog') . '/owner/skin/sidebar' . $_REQUEST['viewMode']);
} else {
Respond::ResultPage(-1);
}
} else {
if ($_REQUEST['sidebarNumber'] == $_REQUEST['targetSidebarNumber'] && $_REQUEST['modulePos'] < $_REQUEST['targetPos']) {
$_REQUEST['targetPos']--;
}
$temp = array_splice($sidebarOrder[$_REQUEST['sidebarNumber']], $_REQUEST['modulePos'], 1);
array_splice($sidebarOrder[$_REQUEST['targetSidebarNumber']], $_REQUEST['targetPos'], 0, $temp);
Setting::setBlogSettingGlobal("sidebarOrder", serialize($sidebarOrder));
$skin->purgeCache();
}
if ($_REQUEST['viewMode'] != '') {
$_REQUEST['viewMode'] = '?' . $_REQUEST['viewMode'];
}
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
header('Location: ' . $context->getProperty('uri.blog') . '/owner/skin/sidebar' . $_REQUEST['viewMode']);
} else {
Respond::ResultPage(0);
}
示例13:
<?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)
require ROOT . '/library/preprocessor.php';
if (array_key_exists('useBlogAPI', $_REQUEST)) {
if ($_REQUEST['useBlogAPI'] == "yes" || $_REQUEST['useBlogAPI'] == "1" || $_REQUEST['useBlogAPI'] == "true") {
$useBlogAPI = '1';
} else {
$useBlogAPI = '0';
}
} else {
$useBlogAPI = '0';
}
if (!array_key_exists('defaultEditor', $_REQUEST) || !array_key_exists('defaultFormatter', $_REQUEST)) {
Respond::ResultPage(-1);
}
if (Setting::setBlogSettingGlobal("defaultEditor", $_REQUEST['defaultEditor']) && Setting::setBlogSettingGlobal("defaultFormatter", $_REQUEST['defaultFormatter']) && Setting::setBlogSettingGlobal("useBlogAPI", $useBlogAPI) && Setting::setBlogSettingGlobal("blogApiPassword", $_REQUEST['blogApiPassword'])) {
Respond::ResultPage(0);
}
Respond::ResultPage(-1);
示例14: empty
$site = empty($_POST['site']) ? '' : $_POST['site'];
$url = empty($_POST['url']) ? '' : $_POST['url'];
$ip = empty($_POST['ip']) ? '' : $_POST['ip'];
$search = empty($_POST['withSearch']) || empty($_POST['search']) ? '' : trim($_POST['search']);
$perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10);
if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) {
$perPage = $_POST['perPage'];
Setting::setBlogSettingGlobal('rowsPerPage', $_POST['perPage']);
}
$deleteTrackbacksFromSameIP = intval(Setting::getBlogSettingGlobal('deleteTrackbacksFromSameIP', 0));
if (isset($_POST['deleteItemsFromSameIP'])) {
if ($_POST['deleteItemsFromSameIP'] == '1') {
Setting::setBlogSettingGlobal('deleteTrackbacksFromSameIP', 1);
$deleteTrackbacksFromSameIP = 1;
} else {
Setting::setBlogSettingGlobal('deleteTrackbacksFromSameIP', 0);
$deleteTrackbacksFromSameIP = 0;
}
}
$tabsClass = array();
$tabsClass['postfix'] = null;
$tabsClass['postfix'] .= isset($_POST['category']) ? '&category=' . $_POST['category'] : '';
$tabsClass['postfix'] .= isset($_POST['name']) ? '&name=' . $_POST['name'] : '';
$tabsClass['postfix'] .= isset($_POST['ip']) ? '&ip=' . $_POST['ip'] : '';
$tabsClass['postfix'] .= isset($_POST['search']) ? '&search=' . $_POST['search'] : '';
if (!empty($tabsClass['postfix'])) {
$tabsClass['postfix'] = ltrim($tabsClass['postfix'], '/');
}
if (isset($_POST['status'])) {
if ($_POST['status'] == 'received') {
$tabsClass['received'] = true;
示例15: publishEntries
function publishEntries()
{
global $database;
$blogid = getBlogId();
$closestReservedTime = Setting::getBlogSettingGlobal('closestReservedPostTime', INT_MAX);
if ($closestReservedTime < Timestamp::getUNIXtime()) {
$entries = POD::queryAll("SELECT id, visibility, category\n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published < UNIX_TIMESTAMP()");
if (count($entries) == 0) {
return;
}
foreach ($entries as $entry) {
$result = POD::query("UPDATE {$database['prefix']}Entries \n\t\t\t\tSET visibility = 0 \n\t\t\t\tWHERE blogid = {$blogid} AND id = {$entry['id']} AND draft = 0");
if ($entry['visibility'] == -3) {
if ($result && setEntryVisibility($entry['id'], 2)) {
$updatedEntry = getEntry($blogid, $entry['id']);
if (!is_null($updatedEntry)) {
fireEvent('UpdatePost', $entry['id'], $updatedEntry);
setEntryVisibility($entry['id'], 3);
}
}
} else {
if ($result) {
setEntryVisibility($entry['id'], abs($entry['visibility']));
$updatedEntry = getEntry($blogid, $entry['id']);
if (!is_null($updatedEntry)) {
fireEvent('UpdatePost', $entry['id'], $updatedEntry);
}
}
}
}
$newClosestTime = POD::queryCell("SELECT min(published)\n\t\t\tFROM {$database['prefix']}Entries\n\t\t\tWHERE blogid = {$blogid} AND draft = 0 AND visibility < 0 AND published > UNIX_TIMESTAMP()");
if (!empty($newClosestTime)) {
Setting::setBlogSettingGlobal('closestReservedPostTime', $newClosestTime);
} else {
Setting::setBlogSettingGlobal('closestReservedPostTime', INT_MAX);
}
}
}