function printIphoneCategoriesView($totalPosts, $categories) { global $blogURL, $service, $blog; requireModel('blog.category'); requireLibrary('blog.skin'); $blogid = getBlogId(); $categoryCount = 0; $categoryCountAll = 0; $parentCategoryCount = 0; $tree = array('id' => 0, 'label' => 'All Category', 'value' => $totalPosts, 'link' => "{$blogURL}/category/0", 'children' => array()); foreach ($categories as $category1) { $children = array(); if (doesHaveOwnership() || getCategoryVisibility($blogid, $category1['id']) > 1) { foreach ($category1['children'] as $category2) { if (doesHaveOwnership() || getCategoryVisibility($blogid, $category2['id']) > 1) { array_push($children, array('id' => $category2['id'], 'label' => $category2['name'], 'value' => doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries'], 'link' => "{$blogURL}/category/" . $category2['id'], 'children' => array())); $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']); } $categoryCountAll = $categoryCountAll + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']); } $parentCategoryCount = doesHaveOwnership() ? $category1['entriesinlogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll; if ($category1['id'] != 0) { array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => "{$blogURL}/category/" . $category1['id'], 'children' => $children)); } $categoryCount = 0; $categoryCountAll = 0; $parentCategoryCount = 0; } } return printIphonePrintTreeView($tree, true); }
function setBlogDescription($blogid, $description) { $context = Model_Context::getInstance(); if ($description == $context->getProperty('blog.description')) { return true; } if (Setting::setBlogSettingGlobal('description', Utils_Unicode::lessenAsEncoding($description, 255)) === false) { return false; } $context->setProperty('blog.description', $description); requireModel('blog.feed'); requireLibrary('blog.skin'); clearFeed(); CacheControl::flushSkin(); return true; }
function moblog_logrotate() { requireLibrary("function/logrotate"); cutlog(ROOT . DS . "cache" . DS . "moblog.txt", 1024 * 1024); cutlog(ROOT . DS . "cache" . DS . "pop3uidl.txt", 1024 * 1024); }
<?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) $ajaxcall = false; if (isset($_REQUEST['ajaxcall'])) { $ajaxcall = true; $ajaxmethod = $_REQUEST['ajaxcall']; } $IV = array('REQUEST' => array('coverpageNumber' => array('int'), 'modulePos' => array('int'), 'viewMode' => array('string', 'default' => ''))); require ROOT . '/library/preprocessor.php'; requireLibrary('blog.skin'); requireModel("blog.sidebar"); requireModel("blog.coverpage"); requireStrictRoute(); $ctx = Model_Context::getInstance(); $skin = new Skin($ctx->getProperty('skin.skin')); $coverpageCount = count($skin->coverpageBasicModules); $coverpageOrderData = getCoverpageModuleOrderData($coverpageCount); $coverpageNumber = $_REQUEST['coverpageNumber']; $modulePos = $_REQUEST['modulePos']; if ($coverpageNumber < 0 || $coverpageNumber >= $coverpageCount) { Respond::ErrorPage(); } if (!isset($coverpageOrderData[$coverpageNumber]) || !isset($coverpageOrderData[$coverpageNumber][$modulePos])) { Respond::ErrorPage(); } $pluginData = $coverpageOrderData[$coverpageNumber][$modulePos]; if ($pluginData['type'] != 3) { Respond::ErrorPage();
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; }
if (empty($accessInfo)) { $root = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 10); $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 10)); } else { $root = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 12); $path = stripPath(substr($_SERVER['PHP_SELF'], 0, strlen($_SERVER['PHP_SELF']) - 12)); } $_SERVER['PHP_SELF'] = rtrim($_SERVER['PHP_SELF'], '/'); $__requireBasics = array('function/string', 'function/time', 'function/javascript', 'function/html', 'function/xml', 'function/misc', 'function/image', 'function/mail'); if (isset($_POST['dbms'])) { $database['dbms'] = $_POST['dbms']; } require ROOT . '/library/include.php'; requireModel('blog.blogSetting'); requireModel('blog.entry'); requireLibrary('auth'); if (!empty($_GET['test'])) { echo getFingerPrint(); exit; } $baseLanguage = 'ko'; if (!empty($_POST['Lang'])) { $baseLanguage = $_POST['Lang']; } $locale = Locales::getInstance(); $locale->setDomain('setup'); if ($locale->setDirectory(ROOT . '/resource/locale/setup')) { $locale->set($baseLanguage, "setup"); } if (file_exists($root . '/config.php') && filesize($root . '/config.php') > 0) { header('HTTP/1.1 503 Service Unavailable');
$objEntry = new Post(); if ($objEntry->doesExist($info)) { list($entries, $paging) = getEntryWithPaging($blogid, $info); } } fireEvent('OBStart'); require ROOT . '/interface/common/blog/begin.php'; if (empty($entries)) { header('HTTP/1.1 404 Not Found'); if (empty($skin->pageError)) { dress('article_rep', '<div class="TCwarning">' . _text('존재하지 않는 페이지입니다.') . '</div>', $view); } else { dress('article_rep', NULL, $view); dress('page_error', $skin->pageError, $view); } unset($paging); } else { require ROOT . '/interface/common/blog/entries.php'; } require ROOT . '/interface/common/blog/end.php'; fireEvent('OBEnd'); exit; } else { if (!empty($info)) { echo $info; exit; } } } requireLibrary('error'); errorExit(404);
function getEntryContentView($blogid, $id, $content, $formatter, $keywords = array(), $type = 'Post', $useAbsolutePath = true, $bRssMode = false) { $ctx = Model_Context::getInstance(); requireModel('blog.attachment'); requireModel('blog.keyword'); requireLibrary('blog.skin'); $cacheKey = 'entry-' . $id . '-' . $type . ($bRssMode ? 'format' : 'summarize') . ($useAbsolutePath ? 'absoultePath' : 'relativePath') . (defined('__TEXTCUBE_MOBILE__') ? 'mobile' : ''); $cache = pageCache::getInstance(); $cache->reset($cacheKey); if (!defined('__TEXTCUBE_NO_ENTRY_CACHE__') && $cache->load()) { // If cached content exists. $view = $cache->contents; } else { // No cache is found. $content = fireEvent('Format' . $type . 'Content', $content, $id); $func = $bRssMode ? 'summarizeContent' : 'formatContent'; $view = $func($blogid, $id, $content, $formatter, $keywords, $useAbsolutePath); if (defined('__TEXTCUBE_MOBILE__')) { $view = stripHTML($view, array('a', 'abbr', 'acronym', 'address', 'b', 'blockquote', 'br', 'cite', 'code', 'dd', 'del', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'ins', 'kbd', 'li', 'ol', 'p', 'pre', 'q', 's', 'samp', 'span', 'strike', 'strong', 'sub', 'sup', 'u', 'ul', 'var')); } if (!$useAbsolutePath) { $view = avoidFlashBorder($view); } if (!empty($keywords) && is_array($keywords)) { $view = bindKeywords($keywords, $view); } // image resampling if (Setting::getBlogSettingGlobal('resamplingDefault') == true) { preg_match_all("@<img.+src=['\"](.+)['\"](.*)/?>@Usi", $view, $images, PREG_SET_ORDER); $view = preg_replace("@<img.+src=['\"].+['\"].*/?>@Usi", '[#####_#####_#####_image_#####_#####_#####]', $view); $contentWidth = Misc::getContentWidth(); if (count($images) > 0) { for ($i = 0; $i < count($images); $i++) { if (strtolower(Misc::getFileExtension($images[$i][1])) == 'gif') { $view = preg_replace('@\\[#####_#####_#####_image_#####_#####_#####\\]@', $images[$i][0], $view, 1); continue; } $attributes = preg_match('/(style="cursor: pointer;" onclick="open_img\\((.[^"]+)\\); return false;")/si', $images[$i][2], $matches) ? ' ' . $matches[1] : ''; $attributes .= preg_match('/(alt="([^"]*)")/si', $images[$i][2], $matches) ? ' ' . $matches[1] : ' alt="resize"'; $attributes .= preg_match('/(title="([^"]*)")/si', $images[$i][2], $matches) ? $title = ' ' . $matches[1] : ''; $tempFileName = array_pop(explode('/', $images[$i][1])); if (preg_match('/(.+)\\.w(\\d{1,})\\-h(\\d{1,})\\.(.+)/', $tempFileName, $matches)) { $tempFileName = $matches[1] . '.' . $matches[4]; } $newImage = $images[$i][0]; if (file_exists(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$tempFileName}")) { $tempAttributes = Misc::getAttributesFromString($images[$i][2]); $tempOriginInfo = getimagesize(__TEXTCUBE_ATTACH_DIR__ . "/{$blogid}/{$tempFileName}"); if (isset($tempAttributes['width']) && $tempOriginInfo[0] > $tempAttributes['width']) { $image = Utils_Image::getInstance(); list($tempImageURL, $tempImageWidth, $tempImageHeight, $tempImageSrc) = $image->getImageResizer($tempFileName, array('width' => $tempAttributes['width'])); $newImage = "<img src=\"{$tempImageURL}\" width=\"{$tempImageWidth}\" height=\"{$tempImageHeight}\"{$attributes}/>"; } } $view = preg_replace('@\\[#####_#####_#####_image_#####_#####_#####\\]@', $newImage, $view, 1); } } } $cache->contents = $view; $cache->update(); } $cache->reset(); $view = fireEvent('View' . $type . 'Content', $view, $id); return $view; }
function printMobileCategoriesView($totalPosts, $categories) { $context = Model_Context::getInstance(); requireModel('blog.category'); requireLibrary('blog.skin'); $blogid = $context->getProperty('blog.id'); $categoryCount = 0; $categoryCountAll = 0; $parentCategoryCount = 0; $tree = array('id' => 0, 'label' => 'All Category', 'value' => $totalPosts, 'link' => $context->getProperty('uri.blog') . "/category/0", 'children' => array()); foreach ($categories as $category1) { $children = array(); if (doesHaveOwnership() || getCategoryVisibility($blogid, $category1['id']) > 1) { foreach ($category1['children'] as $category2) { if (doesHaveOwnership() || getCategoryVisibility($blogid, $category2['id']) > 1) { array_push($children, array('id' => $category2['id'], 'label' => $category2['name'], 'value' => doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries'], 'link' => $context->getProperty('uri.blog') . "/category/" . $category2['id'], 'children' => array())); $categoryCount = $categoryCount + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']); } $categoryCountAll = $categoryCountAll + (doesHaveOwnership() ? $category2['entriesinlogin'] : $category2['entries']); } $parentCategoryCount = doesHaveOwnership() ? $category1['entriesinlogin'] - $categoryCountAll : $category1['entries'] - $categoryCountAll; if ($category1['id'] != 0) { array_push($tree['children'], array('id' => $category1['id'], 'label' => $category1['name'], 'value' => $categoryCount + $parentCategoryCount, 'link' => $context->getProperty('uri.blog') . "/category/" . $category1['id'], 'children' => $children)); } $categoryCount = 0; $categoryCountAll = 0; $parentCategoryCount = 0; } } return printMobilePrintTreeView($tree, true); }