function KeywordUI_handleConfig($data) { $config = Setting::fetchConfigVal($data); if ($config['useKeywordAsTag'] == true) { Setting::setBlogSettingGlobal('useKeywordAsTag', true); } return true; }
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); } } }
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; }
function setBlogSetting($name, $value, $blogid = null) { return Setting::setBlogSettingGlobal($name, $value, $blogid); }
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 {
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); if ($pool->insert()) { setDefaultPost($blogid, $userid); return true; } else { return 65; } } //return true; // unreachable code }
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'); ?> "; if( hosts == 'PREDEFINED POP3 HOSTS' ) { hosts = "gmail:pop.gmail.com:995:1/hanmail:pop.hanmail.net:995:1/naver:pop.naver.com:110:0/nate:mail.nate.com:110:0"; } hosts = "Localhost:localhost:110:0/" + hosts; hosts = hosts.split('/'); for( var i=0; i<hosts.length; i++ ) { var h = hosts[i]; var n = h.split(':')[0]; var v = h.substr(n.length+1); document.write( "<option value=\""+v+"\">"+n+"</option>" ); } } </script> <form id="editor-form" class="data-inbox" method="post" action="<?php echo $blogURL; ?> /owner/plugin/adminMenu?name=CL_Moblog/moblog_manage"> <div id="editor-section" class="section"> <fieldset class="container"> <legend><?php echo _t('MMS 환경을 설정합니다'); ?> </legend> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('MMS용 이메일'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3email" value="<?php echo $pop3email; ?> " /> <?php echo _t('(필진에 공개 됩니다. 사진을 찍어 이메일로 보내면 포스팅이 됩니다)'); ?> </dd> </dl> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('POP3 호스트'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3host" value="<?php echo $pop3host; ?> " /> <select onchange="changehost(this.value)"> <option value=""><?php echo _t('선택하세요'); ?> </option> <script type="text/javascript">renderhosts()</script> </select> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 포트'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3port" value="<?php echo $pop3port; ?> " /> <input type="checkbox" name="pop3ssl" value="1" <?php echo $pop3ssl; ?> /> SSL </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 아이디'); ?> </span></dt> <dd> <input type="text" style="width:14em" class="input-text" name="pop3username" value="<?php echo $pop3username; ?> " /> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('POP3 비밀번호'); ?> </span></dt> <dd> <input type="password" style="width:14em" class="input-text" name="pop3password" value="<?php echo $pop3password; ?> " /> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> <h2 class="caption"><span class="main-text"><?php echo _t('글 쓰기 환경 설정'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('제목'); ?> </span></dt> <dd> <input type="text" style="width:24em" class="input-text" id="pop3subject" name="pop3subject" value="<?php echo $pop3subject; ?> " /> (<?php echo _t('%Y:년, %M:월, %D:일'); ?> ) <input type="button" value="<?php echo _t("초기화"); ?> " onclick="document.getElementById('pop3subject').value='%Y-%M-%D';return false;" /> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('공개여부'); ?> </span></dt> <dd> <span id="status-private" class="status-private"><input type="radio" id="visibility_private" class="radio" name="pop3visibility" value="0"<?php echo $pop3visibility == 0 ? ' checked="checked"' : ''; ?> /><label for="visibility_private"><?php echo _t('비공개'); ?> </label></span> <span id="status-protected" class="status-protected"><input type="radio" id="visibility_protected" class="radio" name="pop3visibility" value="1"<?php echo $pop3visibility == 1 ? ' checked="checked"' : ''; ?> /><label for="visibility_protected"><?php echo _t('보호'); ?> </label></span> <span id="status-public" class="status-public"><input type="radio" id="visibility_public" class="radio" name="pop3visibility" value="2"<?php echo $pop3visibility == 2 ? ' checked="checked"' : ''; ?> /><label for="visibility_public"><?php echo _t('공개'); ?> </label></span> <span id="status-syndicated" class="status-syndicated"><input type="radio" id="visibility_syndicated" class="radio" name="pop3visibility" value="3"<?php echo $pop3visibility == 3 ? ' checked="checked"' : ''; ?> /><label for="visibility_syndicated"><?php echo _t('발행'); ?> </label></span> </dd> </dl> <dl id="editor-line" class="line"> <dt><span class="label"><?php echo _t('분류'); ?> </span></dt> <dd> <select id="category" name="pop3category"> <optgroup class="category" label="<?php echo _t('분류'); ?> "> <?php foreach (getCategories(getBlogId()) as $category) { ?> <?php if ($category['id'] != 0) { ?> <option value="<?php echo $category['id']; ?> " <?php echo $category['id'] == $pop3category ? 'selected' : ''; ?> > <?php echo ($category['visibility'] > 1 ? '' : _t('(비공개)')) . htmlspecialchars($category['name']); ?> </option> <?php } ?> <?php foreach ($category['children'] as $child) { ?> <?php if ($category['id'] != 0) { ?> <option value="<?php echo $child['id']; ?> " <?php echo $child['id'] == $pop3category ? 'selected' : ''; ?> > ― <?php echo ($category['visibility'] > 1 && $child['visibility'] > 1 ? '' : _t('(비공개)')) . htmlspecialchars($child['name']); ?> </option> <?php } ?> <?php } ?> <?php } ?> </optgroup> </select> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> <h2 class="caption"><span class="main-text"><?php echo _t('메일 필터링 설정'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('허용 목록'); ?> </span></dt> <dd> <input type="radio" id="pop3allowonly" name="pop3allowonly" value="1" <?php echo $pop3mmsallowonly ? 'checked="checked"' : ''; ?> /> <label for="pop3allowonly"><?php echo _t('다음 송신자로부터 전송된 메일만 MMS로 인식하여 처리합니다'); ?> </label> </dd> <dd> <input type="radio" id="pop3allowlist" name="pop3allowonly" value="0" <?php echo $pop3mmsallowonly ? '' : 'checked="checked"'; ?> /> <label for="pop3allowlist"><?php echo _t('다음 송신자로부터 전송된 메일도 MMS로 인식하여 처리합니다'); ?> </label> </dd> <dd> <input type="text" maxlength="128" name="pop3allow" value="<?php echo htmlentities($pop3mmsallow); ?> " style="width:90%" /> </dd> <dd> <?php echo _t('여러 개인 경우 전화번호 혹은 이메일 주소를 쉼표나 공백으로 구별하여 나열합니다'); ?> </dd> <dd> </dd> </dl> <div class="button-box"> <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기'); ?> " /> </div> </div> </form> <h2 class="caption"><span class="main-text"><?php echo _t('MMS 메시지 테스트'); ?> </span></h2> <div id="editor-section" class="section"> <dl id="formatter-line" class="line"> <dt><span class="label"><?php echo _t('명령'); ?> </span></dt> <dd> <input type="button" class="save-button input-button wide-button" value="<?php echo _t('로그보기'); ?> " onclick="document.getElementById('pop3_debug').src='<?php echo $blogURL; ?> /plugin/moblog/check?check=1&rnd='+((new Date()).getTime())" /> <input type="button" class="save-button input-button wide-button" value="<?php echo _t('시험하기'); ?> " onclick="document.getElementById('pop3_debug').src='<?php echo $blogURL; ?> /plugin/moblog/check?rnd='+((new Date()).getTime())" /> </dd> </dl> </div> <iframe src="about:blank" class="debug_message" id="pop3_debug" style="width:100%; height:400px"> </iframe> <?php } ?> </div> <?php }
$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);
<?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);
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; } }
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'); ?>
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); }
<?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);
$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;
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); } } }
function setBlogSetting($name, $value, $global = null) { if (is_null($global)) { $name = 'plugin_' . $name; } return Setting::setBlogSettingGlobal($name, $value); }
<?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('useResamplingAsDefault' => array('string', 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; $isAjaxRequest = false; // checkAjaxRequest(); // 기본 설정 if (isset($_POST['useResamplingAsDefault']) && $_POST['useResamplingAsDefault'] == "yes") { Setting::setBlogSettingGlobal("resamplingDefault", "yes"); } else { Setting::removeBlogSettingGlobal("resamplingDefault"); } CacheControl::flushEntry(); $isAjaxRequest ? Respond::PrintResult($errorResult) : header("Location: " . $_SERVER['HTTP_REFERER']);
<?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) $IV = array('POST' => array('adminSkin' => array('directory', 'default' => 'default'))); require ROOT . '/library/preprocessor.php'; if (empty($_POST['adminSkin']) || !file_exists(ROOT . "/skin/admin/{$_POST['adminSkin']}/index.xml") || !Setting::setBlogSettingGlobal("adminSkin", $_POST['adminSkin'])) { Respond::ResultPage(false); } else { Respond::ResultPage(true); }
function save() { global $database; importlib('model.common.setting'); if (isset($this->name)) { $this->name = trim($this->name); if (!BlogSetting::validateName($this->name)) { return $this->_error('name'); } Setting::setBlogSettingGlobal('name', $this->name); } if (isset($this->secondaryDomain)) { $this->secondaryDomain = trim($this->secondaryDomain); if (!Validator::domain($this->secondaryDomain)) { return $this->_error('secondaryDomain'); } Setting::setBlogSettingGlobal('secondaryDomain', $this->secondaryDomain); } if (isset($this->defaultDomain)) { Setting::setBlogSettingGlobal('defaultDomain', Validator::getBit($this->defaultDomain)); } if (isset($this->title)) { $this->title = trim($this->title); Setting::setBlogSettingGlobal('title', $this->title); } if (isset($this->description)) { $this->description = trim($this->description); Setting::setBlogSettingGlobal('description', $this->description); } if (isset($this->banner)) { if (strlen($this->banner) != 0 && !Validator::filename($this->banner)) { return $this->_error('banner'); } Setting::setBlogSettingGlobal('logo', $this->banner); } if (isset($this->useSloganOnPost)) { Setting::setBlogSettingGlobal('useSloganOnPost', Validator::getBit($this->useSloganOnPost)); } if (isset($this->useSloganOnCategory)) { Setting::setBlogSettingGlobal('useSloganOnCategory', Validator::getBit($this->useSloganOnCategory)); } if (isset($this->useSloganOnTag)) { Setting::setBlogSettingGlobal('useSloganOnTag', Validator::getBit($this->useSloganOnTag)); } if (isset($this->postsOnPage)) { if (!Validator::number($this->postsOnPage, 1)) { return $this->_error('postsOnPage'); } Setting::setBlogSettingGlobal('entriesOnPage', $this->postsOnPage); } if (isset($this->postsOnList)) { if (!Validator::number($this->postsOnList, 1)) { return $this->_error('postsOnList'); } Setting::setBlogSettingGlobal('entriesOnList', $this->postsOnList); } if (isset($this->postsOnFeed)) { if (!Validator::number($this->postsOnFeed, 1)) { return $this->_error('postsOnFeed'); } Setting::setBlogSettingGlobal('entriesOnRSS', $this->postsOnFeed); } if (isset($this->publishWholeOnFeed)) { Setting::setBlogSettingGlobal('publishWholeOnRSS', Validator::getBit($this->publishWholeOnFeed)); } if (isset($this->acceptGuestComment)) { Setting::setBlogSettingGlobal('allowWriteOnGuestbook', Validator::getBit($this->acceptGuestComment)); } if (isset($this->acceptcommentOnGuestComment)) { Setting::setBlogSettingGlobal('allowWriteDblCommentOnGuestbook', Validator::getBit($this->acceptcommentOnGuestComment)); } if (isset($this->language)) { if (!Validator::language($this->language)) { return $this->_error('language'); } Setting::setBlogSettingGlobal('language', $this->language); } if (isset($this->timezone)) { if (empty($this->timezone)) { return $this->_error('timezone'); } Setting::setBlogSettingGlobal('timezone', $this->timezone); } return true; }
} // 블로그 아이콘 처리. if ($_POST['deleteBlogIcon'] == "yes") { unlink(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/index.gif"); array_push($errorText, _t('블로그 아이콘을 초기화 하였습니다.')); } if (!empty($_FILES['blogIcon']['tmp_name'])) { $fileExt = Path::getExtension($_FILES['blogIcon']['name']); if (!in_array($fileExt, array('.gif', '.jpg', '.jpeg', '.png'))) { array_push($errorText, _t('블로그 아이콘을 변경하지 못했습니다.')); } else { Attachment::confirmFolder(); if (move_uploaded_file($_FILES['blogIcon']['tmp_name'], __TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/index.gif")) { @chmod(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/index.gif", 0666); array_push($errorText, _t('블로그 아이콘을 변경하였습니다.')); } else { } } } Setting::setBlogSettingGlobal('useBlogIconAsIphoneShortcut', $_POST['useBlogIconAsIphoneShortcut']); if (!empty($errorText)) { $errorText = urlencode(implode('<br />', $errorText)); } else { $errorText = urlencode(_T('저장되었습니다')); } $url = $_SERVER['HTTP_REFERER']; $pos = strpos($url, '?message='); if ($pos != false) { $url = substr($url, 0, $pos); } header("Location: " . $url . '?message=' . $errorText);
clearFeed(); $result = true; } } if (isset($_POST['acceptComments'])) { if (Setting::setBlogSettingGlobal('acceptComments', $_POST['acceptComments'])) { $result = true; } } if (isset($_POST['acceptTrackbacks'])) { if (Setting::setBlogSettingGlobal('acceptTrackbacks', $_POST['acceptTrackbacks'])) { $result = true; } } if (isset($_POST['useiPhoneUI'])) { if ($_POST['useiPhoneUI'] == 1) { $useiPhoneUI = true; } else { $useiPhoneUI = false; } if (Setting::setBlogSettingGlobal('useiPhoneUI', $useiPhoneUI)) { $result = true; } } if ($result) { $gCacheStorage = globalCacheStorage::getInstance(); $gCacheStorage->purge(); Respond::ResultPage(0); } else { Respond::ResultPage(-1); }
<?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('viewtype' => array(array('listview', 'iconview'), 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); $backupListView = Setting::getBlogSettingGlobal('skinViewType'); // 하나라도 저장에 실패하면 롤백. if (!Setting::setBlogSettingGlobal("skinViewType", $_POST['viewtype'])) { Setting::setBlogSettingGlobal("skinViewType", $backupListView); Respond::ResultPage(1); } else { Respond::ResultPage(0); }
<?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) $IV = array('POST' => array('publishWholeOnRSS' => array('int', 0, 1, 'default' => 0), 'publishEolinSyncOnRSS' => array('int', 0, 1, 'default' => 0), 'entriesOnRSS' => array('int', 'default' => 5), 'commentsOnRSS' => array('int', 'default' => 5), 'useFeedViewOnCategory' => array('int', 0, 1, 'default' => 1), 'rssURL' => array('url', 'mandatory' => false), 'atomURL' => array('url', 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); setCommentsOnRSS($blogid, $_POST['commentsOnRSS']); setEntriesOnRSS($blogid, $_POST['entriesOnRSS']); // Feed range Setting::setBlogSettingGlobal('publishWholeOnRSS', $_POST['publishWholeOnRSS']); Setting::setBlogSettingGlobal('publishEolinSyncOnRSS', $_POST['publishEolinSyncOnRSS']); // Category Feed Setting::setBlogSettingGlobal('useFeedViewOnCategory', $_POST['useFeedViewOnCategory']); Setting::setBlogSettingGlobal('atomURL', $_POST['atomURL']); Setting::setBlogSettingGlobal('rssURL', $_POST['rssURL']); clearFeed(); CacheControl::flushSkin(); Respond::ResultPage(0);
<?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'; Respond::ResultPage(Setting::setBlogSettingGlobal($_POST['name'], $_POST['value']));
function setOpenIDLogoDisplay($mode) { if (!Acl::check(array("group.administrators"))) { return false; } return Setting::setBlogSettingGlobal("OpenIDLogoDisplay", $mode); }
function setBlogSettingRowsPerPage($value) { return Setting::setBlogSettingGlobal('rowsPerPage', $value, getBlogId()); }
function handleSidebars(&$sval, &$obj, $previewMode) { global $service, $pluginURL, $pluginPath, $pluginName, $configVal, $configMappings; importlib('model.blog.sidebar'); $newSidebarAllOrders = array(); // [sidebar id][element id](type, id, parameters) // type : 1=skin text, 2=default handler, 3=plug-in // id : type1=sidebar i, type2=handler id, type3=plug-in handler name // parameters : type1=sidebar j, blah blah~ $sidebarCount = count($obj->sidebarBasicModules); $sidebarAllOrders = getSidebarModuleOrderData($sidebarCount); if ($previewMode == true) { $sidebarAllOrders = null; } else { if (is_null($sidebarAllOrders)) { $sidebarAllOrders = array(); } } for ($i = 0; $i < $sidebarCount; $i++) { $str = ""; if (!is_null($sidebarAllOrders) && array_key_exists($i, $sidebarAllOrders)) { $currentSidebarOrder = $sidebarAllOrders[$i]; for ($j = 0; $j < count($currentSidebarOrder); $j++) { if ($currentSidebarOrder[$j]['type'] == 1) { // skin text $skini = $currentSidebarOrder[$j]['id']; $skinj = $currentSidebarOrder[$j]['parameters']; if (isset($obj->sidebarBasicModules[$skini]) && isset($obj->sidebarBasicModules[$skini][$skinj])) { $str .= $obj->sidebarBasicModules[$skini][$skinj]['body']; } } else { if ($currentSidebarOrder[$j]['type'] == 2) { // default handler // TODO : implement } else { if ($currentSidebarOrder[$j]['type'] == 3) { // plugin $plugin = $currentSidebarOrder[$j]['id']['plugin']; $handler = $currentSidebarOrder[$j]['id']['handler']; include_once ROOT . "/plugins/{$plugin}/index.php"; if (function_exists($handler)) { $str .= "[##_temp_sidebar_element_{$i}_{$j}_##]"; $parameter = $currentSidebarOrder[$j]['parameters']; $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"]['plugin'] = $plugin; $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"]['handler'] = $handler; $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"]['parameters'] = $parameter; } else { $obj->sidebarStorage["temp_sidebar_element_{$i}_{$j}"] = ""; } } else { // WHAT? } } } } } else { $newSidebarAllOrders[$i] = array(); for ($j = 0; $j < count($obj->sidebarBasicModules[$i]); $j++) { $str .= $obj->sidebarBasicModules[$i][$j]['body']; array_push($newSidebarAllOrders[$i], array('type' => '1', 'id' => "{$i}", 'parameters' => "{$j}")); } if (!is_null($sidebarAllOrders)) { $sidebarAllOrders[$i] = $newSidebarAllOrders[$i]; } } dress("sidebar_{$i}", $str, $sval); } if (count($newSidebarAllOrders) > 0) { if ($previewMode == false && !is_null($sidebarAllOrders)) { Setting::setBlogSettingGlobal("sidebarOrder", serialize($sidebarAllOrders)); CacheControl::flushSkin(); } } }
<?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('GET' => array('coverpageNumber' => array('int'), 'modulePos' => array('int'), 'viewMode' => array('string', 'default' => ''))); require ROOT . '/library/preprocessor.php'; importlib('blogskin'); importlib("model.blog.sidebar"); importlib("model.blog.coverpage"); $skin = new Skin($skinSetting['skin']); $coverpageCount = count($skin->coverpageBasicModules); $coverpageOrder = deleteCoverpageModuleOrderData(getCoverpageModuleOrderData($coverpageCount), $_GET['coverpageNumber'], $_GET['modulePos']); Setting::setBlogSettingGlobal("coverpageOrder", serialize($coverpageOrder)); //Respond::PrintResult(array('error' => 0)); if ($_GET['viewMode'] != '') { $_GET['viewMode'] = '?' . $_GET['viewMode']; } header('Location: ' . $context->getProperty('uri.blog') . '/owner/skin/coverpage' . $_GET['viewMode']);
$visibilityText = _t('방명록'); $midfix = 'Guestbook'; } } } else { $tabsClass['comment'] = true; $visibilityText = _t('댓글'); $midfix = 'Comment'; } $deleteCommentsFromSameIP = intval(Setting::getBlogSettingGlobal('delete' . $midfix . 'sFromSameIP', 0)); if (isset($_POST['deleteItemsFromSameIP'])) { if ($_POST['deleteItemsFromSameIP'] == '1') { Setting::setBlogSettingGlobal('delete' . $midfix . 'sFromSameIP', 1); $deleteCommentsFromSameIP = 1; } else { Setting::setBlogSettingGlobal('delete' . $midfix . 'sFromSameIP', 0); $deleteCommentsFromSameIP = 0; } } if (isset($tabsClass['comment']) && $tabsClass['comment'] == true) { list($comments, $paging) = getCommentsWithPagingForOwner($blogid, $categoryId, $name, $ip, $search, $suri['page'], $perPage); } else { list($comments, $paging) = getGuestbookWithPagingForOwner($blogid, $name, $ip, $search, $suri['page'], $perPage); } require ROOT . '/interface/common/owner/header.php'; ?> <script type="text/javascript"> //<![CDATA[ (function($) { deleteCommentNow = function(id) { if (!confirm("<?php