importlib('model.blog.entry'); requireStrictRoute(); $updateDraft = 0; $entry = getEntry($blogid, $suri['id']); if (is_null($entry)) { $entry = getEntry($blogid, $suri['id'], true); $updateDraft = 1; } if (!is_null($entry)) { $entry['visibility'] = $_POST['visibility']; $entry['starred'] = $_POST['starred']; $entry['category'] = $_POST['category']; $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['title'] = $_POST['title']; $entry['content'] = $_POST['content']; $entry['contentformatter'] = $_POST['contentformatter']; $entry['contenteditor'] = $_POST['contenteditor']; $entry['slogan'] = $_POST['permalink']; $entry['acceptcomment'] = empty($_POST['acceptcomment']) ? 0 : 1; $entry['accepttrackback'] = empty($_POST['accepttrackback']) ? 0 : 1; $entry['published'] = empty($_POST['published']) ? 0 : $_POST['published']; if ($id = updateEntry($blogid, $entry, $updateDraft)) { fireEvent('UpdatePost', $id, $entry); setBlogSetting('LatestEditedEntry_user' . getUserId(), $suri['id']); Respond::ResultPage(0); } } Respond::ResultPage(-1);
function statCallback($total, $totalsize) { $this->log("* " . sprintf(_t("총 %d개의 메시지"), $total)); $lastStat = Setting::getBlogSettingGlobal('MmsPop3stat', ''); $stat = "{$total} {$totalsize}"; if ($stat == $lastStat) { $this->log("* " . _t("새로운 메시지가 없습니다")); return false; } setBlogSetting('MmsPop3stat', $stat); return true; }
<th class="content"><span class="text"><?php echo _t('내용'); ?> </span></th> <th class="delete"><span class="text"><?php echo _t('삭제'); ?> </span></th> </tr> </thead> <tbody> <?php $more = false; $mergedComments = array(); $lastVisitNotifiedPage = Setting::getBlogSettingGlobal('lastVisitNotifiedPage', null); setBlogSetting('lastVisitNotifiedPage', time()); for ($i = 0; $i < count($comments); $i++) { array_push($mergedComments, $comments[$i]); $result = getCommentCommentsNotified($comments[$i]['id']); for ($j = 0; $j < count($result); $j++) { array_push($mergedComments, $result[$j]); } } $nameNumber = array(); for ($i = 0; $i < sizeof($mergedComments); $i++) { $comment = $mergedComments[$i]; if (Filter::isFiltered('name', $comment['name'])) { $isNameFiltered = true; } else { $isNameFiltered = false; }
} else { if (isset($_GET['search']) && !empty($_GET['search'])) { $searchKeyword = trim($_GET['search']); } } // 태그 목록 출력 if (isset($_GET['tagId']) && !empty($_GET['tagId'])) { $tag = intval($_GET['tagId']); } else { $tag = null; } // 페이지당 출력되는 포스트 수. $perPage = Setting::getBlogSettingGlobal('rowsPerPage', 10); if (isset($_POST['perPage']) && in_array($_POST['perPage'], array(10, 15, 20, 25, 30))) { if ($_POST['perPage'] != $perPage) { setBlogSetting('rowsPerPage', $_POST['perPage']); $perPage = $_POST['perPage']; } } // 컨텐츠 목록 생성. if (isset($_POST['visibility']) && $_POST['visibility'] == 'template') { $categoryIdforPrint = -4; } else { $categoryIdforPrint = $categoryId; } // preserves category selection even if template tab is activated. list($entries, $paging) = getEntriesWithPagingForOwner(getBlogId(), $categoryIdforPrint, $searchKeyword, $suri['page'], $perPage, $visibility, $starred, null, $tag); // query string 생성. $paging['postfix'] = NULL; if ($categoryId != 0) { $paging['postfix'] .= "&category={$categoryId}";
function DEFENSIO_PostAction() { global $blogid, $pluginMenuURL, $pluginURL, $pluginSelfParam, $blog, $user, $blogURL, $defaultURL, $hostURL, $service, $skinSetting, $configVal; if (isset($_POST['perPage']) && is_numeric($_POST['perPage'])) { $perPage = $_POST['perPage']; setBlogSetting('rowsPerPage', $_POST['perPage']); } $l = $blogURL . "/owner/plugin/adminMenu?name=Defensio/DEFENSIO"; $l .= "&t=" . $_REQUEST['t']; if (isset($_REQUEST['page']) && $_REQUEST['page'] != '' && $_REQUEST['page'] != 1) { $l .= "&page=" . $_REQUEST['page']; } //print_r($_REQUEST); header("Location: {$l}"); exit; }
function addBlog($blogid, $userid, $identify) { global $database, $service; if (empty($userid)) { $userid = 1; // If no userid, choose the service administrator. } else { if (!POD::queryExistence("SELECT userid\n\t\t\tFROM {$database['prefix']}Users\n\t\t\tWHERE userid = " . $userid)) { return 3; } // 3: No user exists with specific userid } if (!empty($blogid)) { // If blogid, if (!POD::queryExistence("SELECT blogid\n\t\t\tFROM {$database['prefix']}BlogSettings\n\t\t\tWHERE blogid = " . $blogid)) { return 2; // 2: No blog exists with specific blogid } // Thus, blog and user exists. Now combine both. $result = POD::query("INSERT INTO {$database['prefix']}Privileges\n\t\t\t(blogid,userid,acl,created,lastlogin) \n\t\t\tVALUES({$blogid}, {$userid}, 0, UNIX_TIMESTAMP(), 0)"); 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(UTF8::lessenAsEncoding($identify, 32)); $blogName = $identify; $result = POD::queryCount("SELECT * \n\t\t\tFROM {$database['prefix']}ReservedWords\n\t\t\tWHERE word = '{$blogName}'"); if ($result && $result > 0) { return 60; // Reserved blog name. } $result = POD::queryCount("SELECT value \n\t\t\tFROM {$database['prefix']}BlogSettings \n\t\t\tWHERE name = 'name' AND value = '{$blogName}'"); if ($result && $result > 0) { return 61; // Same blogname is already exists. } $blogid = POD::queryCell("SELECT max(blogid)\n\t\t\tFROM {$database['prefix']}BlogSettings") + 1; $baseTimezone = POD::escapeString($service['timezone']); $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' => $service['language'], 'blogLanguage' => $service['language'], 'timezone' => $baseTimezone); $isFalse = false; foreach ($basicInformation as $fieldname => $fieldvalue) { if (setBlogSettingDefault($fieldname, $fieldvalue, $blogid) === false) { $isFalse = true; } } if ($isFalse == true) { POD::query("DELETE FROM {$database['prefix']}BlogSettings WHERE blogid = {$blogid}"); return 12; } if (!POD::query("INSERT INTO {$database['prefix']}SkinSettings (blogid) VALUES ({$blogid})")) { deleteBlog($blogid); return 13; } if (!POD::query("INSERT INTO {$database['prefix']}FeedSettings \n\t\t\t(blogid) VALUES ({$blogid})")) { deleteBlog($blogid); return 62; } if (!POD::query("INSERT INTO {$database['prefix']}FeedGroups \n\t\t\t(blogid, id) \n\t\t\tVALUES ({$blogid}, 0)")) { deleteBlog($blogid); return 62; } setBlogSetting('defaultEditor', 'modern', $blogid); setBlogSetting('defaultFormatter', 'ttml', $blogid); //Combine user and blog. if (POD::query("INSERT INTO {$database['prefix']}Privileges \n\t\t\t(blogid,userid,acl,created,lastlogin) \n\t\t\tVALUES({$blogid}, {$userid}, 16, UNIX_TIMESTAMP(), 0)")) { setDefaultPost($blogid, $userid); return true; } else { return 65; } } //return true; // unreachable code }
<?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('GET' => array('timezone' => array('string'))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); $timezone = new Timezone(); if (isset($_GET['timezone']) && $timezone->set($_GET['timezone'])) { setBlogSetting('timezone', $_GET['timezone']); Respond::ResultPage(0); } Respond::ResultPage(-1);
function handleSidebars(&$sval, &$obj, $previewMode) { global $service, $pluginURL, $pluginPath, $pluginName, $configVal, $configMappings; requireModel('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)) { setBlogSetting("sidebarOrder", serialize($sidebarAllOrders)); CacheControl::flushSkin(); } } }
<?php /// Copyright (c) 2004-2012, 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'; requireStrictRoute(); if (false) { fetchConfigVal(); getBlogSetting(); setBlogSetting(); } if (isset($_REQUEST['name']) && isset($adminHandlerMappings[$_REQUEST['name']])) { $IV = array('REQUEST' => array('name' => array('string'))); foreach ($adminHandlerMappings[$_GET['name']]['params'] as $param) { $ivItem = array($param['type']); if (isset($param['default']) && !is_null($param['default'])) { $ivItem['default'] = $param['default']; } if (isset($param['mandatory']) && !is_null($param['mandatory'])) { $ivItem['mandatory'] = $param['mandatory']; } $IV['REQUEST'][$param['name']] = $ivItem; } if (Validator::validate($IV)) { $plugin = $adminHandlerMappings[$_REQUEST['name']]['plugin']; $handler = $adminHandlerMappings[$_REQUEST['name']]['handler']; $pluginAccessURL = $context->getProperty('uri.blog') . '/owner/plugin/adminMenu?name=' . $plugin; $pluginMenuURL = 'invalid link'; $pluginHandlerURL = $context->getProperty('uri.blog') . '/owner/plugin/adminHandler?name=' . $plugin; $pluginSelfURL = $context->getProperty('uri.blog') . '/owner/plugin/adminHandler?name=' . $plugin . '/' . $handler;