function getBlogContentForCoverPage() { global $blogid, $blog, $service, $stats, $skinSetting; global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry; global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList; $categories = getCategories($blogid); $totalPosts = getEntriesTotalCount($blogid); $pd_category = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true); $pd_categoryXhtml = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true); $pd_archive = getArchives($blogid); $pd_calendar = getCalendarView(getCalendar($blogid, true)); $pd_tags = getRandomTags($blogid); $pd_notices = getNotices($blogid); $pd_recentEntry = getRecentEntries($blogid); $pd_recentComment = getRecentComments($blogid); $pd_recentTrackback = getRecentTrackbacks($blogid); $pd_link = getLinks($blogid); $pd_authorList = User::getUserNamesOfBlog($blogid); }
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) define('__TEXTCUBE_MOBILE__', true); require ROOT . '/library/preprocessor.php'; requireView('mobileView'); list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']); $entry = $entries ? $entries[0] : null; printMobileHtmlHeader(htmlspecialchars($context->getProperty('blog.title'))); ?> <div id="pannels"> <!-- <h2><?php echo _t('카테고리'); ?> </h2> <?php echo getCategoriesView(getEntriesTotalCount($blogid), getCategories($blogid), true, true); ?> --> <h2><?php echo _text('최근에 달린 댓글'); ?> </h2> <?php $comments = getRecentComments($blogid); if (count($comments) > 0) { echo '<ul>'; } foreach ($comments as $comment) { ?> <li><a href="<?php echo $context->getProperty('uri.blog');
<div id="part-post-tree" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t('분류를 관리합니다'); ?> </span></h2> <div class="data-inbox"> <div id="tree-preview-box"> <div class="title"><?php echo _t('미리보기'); ?> </div> <div id="treePreview"> <?php echo getCategoriesViewInOwner(getEntriesTotalCount(getBlogId()), $categories, $selected); ?> </div> </div> <form class="section" method="post" action="<?php echo $context->getProperty('uri.blog'); ?> /owner/entry/category"> <fieldset id="property-box" class="container"> <legend><?php echo _t('분류 관리 및 설정'); ?> </legend> <input type="hidden" name="page" value="<?php
function getEntryWithPagingBySlogan($blogid, $slogan, $isNotice = false, $categoryId = false) { global $database; global $blogURL; requireModel('blog.category'); $entries = array(); $paging = $isNotice ? Paging::init("{$blogURL}/notice", '/') : Paging::init("{$blogURL}/entry", '/'); $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0'; $visibility .= $isNotice || doesHaveOwnership() ? '' : getPrivateCategoryExclusionQuery($blogid); $visibility .= doesHaveOwnership() && !Acl::check('group.editors') ? ' AND (e.userid = ' . getUserId() . ' OR e.visibility > 0)' : ''; $category = $isNotice ? 'e.category = -2' : 'e.category >= 0'; if ($categoryId !== false) { if (!$categoryId == 0) { // Not a 'total' category. $childCategories = getChildCategoryId($blogid, $categoryId); if (!empty($childCategories)) { $category = 'e.category IN (' . $categoryId . ',' . implode(",", $childCategories) . ')'; } else { $category = 'e.category = ' . $categoryId; } } } $currentEntry = POD::queryRow("SELECT e.*, c.label AS categoryLabel \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.slogan = '" . POD::escapeString($slogan) . "' \n\t\t\tAND e.draft = 0 {$visibility} AND {$category}"); $result = POD::query("SELECT e.id, e.slogan \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.draft = 0 {$visibility} AND {$category} \n\t\tORDER BY e.published DESC"); if (!$result || !$currentEntry) { return array($entries, $paging); } if ($categoryId !== false) { $paging['pages'] = $categoryId == 0 ? getEntriesTotalCount($blogid) : getEntriesCountByCategory($blogid, $categoryId); $paging['postfix'] = '?category=' . $categoryId; } else { $paging['pages'] = $isNotice ? getNoticesTotalCount($blogid) : getEntriesTotalCount($blogid); } for ($i = 1; $entry = POD::fetch($result); $i++) { if ($entry['slogan'] != $slogan) { if (array_push($paging['before'], $entry['slogan']) > 4) { if ($i == 5) { $paging['first'] = array_shift($paging['before']); } else { array_shift($paging['before']); } } continue; } $paging['page'] = $i; array_push($entries, $currentEntry); $paging['after'] = array(); for ($i++; count($paging['after']) < 4 && ($entry = POD::fetch($result)); $i++) { array_push($paging['after'], $entry['slogan']); } if ($i < $paging['pages']) { while ($entry = POD::fetch($result)) { $paging['last'] = $entry['slogan']; } } if (count($paging['before']) > 0) { $paging['prev'] = $paging['before'][count($paging['before']) - 1]; } if (isset($paging['after'][0])) { $paging['next'] = $paging['after'][0]; } return array($entries, $paging); } $paging['page'] = $paging['pages'] + 1; return array($entries, $paging); }
<?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('tree' => array('string', 'default' => 'base'), 'colorOnTree' => array('string', 'default' => '000000'), 'bgColorOnTree' => array('string', 'default' => ''), 'activeColorOnTree' => array('string', 'default' => '000000'), 'activeBgColorOnTree' => array('string', 'default' => ''), 'labelLengthOnTree' => array('int', 'default' => 30), 'showValueOnTree' => array('string', 'mandatory' => false))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); if (isset($suri['id'])) { $categories = getCategories($blogid); Respond::PrintResult(array('code' => urlencode(getCategoriesViewInSkinSetting(getEntriesTotalCount($blogid), $categories, $suri['id'])))); exit; } else { if (setTreeSetting($blogid, $_POST)) { header("Location: {$context->getProperty}('uri.blog')/owner/skin/setting"); } else { } }
function getDefaultCenterPanel($mapping) { $ctx = Model_Context::getInstance(); $blogid = $ctx->getProperty('blog.id'); ?> <div id="<?php echo $mapping['plugin']; ?> " class="section"> <h3 class="caption<?php echo isset($_REQUEST['edit']) ? ' visible' : ' invisible'; ?> "> <span><?php echo _t('알림판'); if (isset($_REQUEST['edit'])) { ?> <a id="<?php echo $mapping['plugin']; ?> widgetup" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=-1&edit"><?php echo _t('위로'); ?> </a> <a id="<?php echo $mapping['plugin']; ?> widgetdown" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard?edit&pos=<?php echo $positionCounter; ?> &rel=1&edit"><?php echo _t('아래로'); ?> </a> <?php } ?> </span> </h3> <?php if (isset($_REQUEST['edit'])) { ?> </div> <?php return true; } else { // Get default data $stats = Statistics::getStatistics($blogid); $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); $comments = getRecentComments($blogid, 10); $guestbooks = getRecentGuestbook($blogid, 10); list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10); $trackbacks = getRecentTrackbacks($blogid, 10); $recents = array(); // title, date, link, category foreach ($comments as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment')); } foreach ($commentNotifies as $comment) { array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify')); } foreach ($guestbooks as $guestbook) { array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook')); } foreach ($trackbacks as $trackback) { array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback')); } $sort_array = array(); foreach ($recents as $uniqid => $row) { // Sorting. foreach ($row as $key => $value) { if (!array_key_exists($key, $sort_array)) { $sort_array[$key] = array(); } $sort_array[$key][$uniqid] = $value; } } if (!empty($sort_array)) { array_multisort($sort_array['date'], SORT_DESC, $recents); } $recents = array_slice($recents, 0, 14); ?> <div id="shortcut-collection"> <h4 class="caption"><span><?php echo _t('바로가기'); ?> </span></h4> <ul> <li class="newPost"><a class="newPost" href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/post"><span><?php echo _t('새 글 쓰기'); ?> </span></a></li> <?php if ($latestEntryId !== 0) { $latestEntry = getEntry($blogid, $latestEntryId); if (!is_null($latestEntry)) { ?> <li class="modifyPost"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/entry/edit/<?php echo $latestEntry['id']; ?> "><?php echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))); ?> </a></li> <?php } } if ($ctx->getProperty('service.reader') == true) { ?> <li class="rssReader"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/network/reader"><?php echo _t('RSS로 등록한 이웃 글 보기'); ?> </a></li> <?php } if (Acl::check("group.administrators")) { ?> <li class="deleteCache"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php echo _t('캐시 지우기'); ?> </a></li> <?php if (Acl::check("group.creators")) { ?> <li class="optimizeStorage"><a href="<?php echo $ctx->getProperty('uri.blog'); ?> /owner/data" onclick="optimizeData();return false;"><?php echo _t('저장소 최적화'); ?> </a></li> <?php } } ?> <li class="clear"></li> </ul> </div> <div id="total-information"> <h4 class="caption"><span><?php echo _t('요약'); ?> </span></h4> <table class="posts-line"> <caption><?php echo _t('글'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('글'); ?> </td> <td class="sum"><?php echo number_format(getEntriesTotalCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('댓글'); ?> </td> <td class="sum"><?php echo number_format(getCommentCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('방명록'); ?> </td> <td class="sum"><?php echo number_format(getGuestbookCount($blogid)); ?> </td> </tr> <tr> <td class="type"><?php echo _t('걸린 글'); ?> </td> <td class="sum"><?php echo number_format(getTrackbackCount($blogid)); ?> </td> </tr> </tbody> </table> <table class="visitors-line"> <caption><?php echo _t('방문자'); ?> </caption> <thead> <th>type</th> <th>sum</th> </thead> <tbody> <tr> <td class="type"><?php echo _t('오늘'); ?> </td> <td class="sum"><?php echo number_format($stats['today']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('어제'); ?> </td> <td class="sum"><?php echo number_format($stats['yesterday']); ?> </td> </tr> <tr> <td class="type"><?php echo _t('7일 평균'); ?> </td> <td class="sum"><?php $weekly = Statistics::getWeeklyStatistics(); $weeklycount = 0; foreach ($weekly as $day) { $weeklycount += $day['visits']; } echo number_format($weeklycount / 7); unset($weekly); unset($weeklycount); ?> </td> </tr> <tr> <td class="type"><?php echo _t('총방문자'); ?> </td> <td class="sum"><?php echo number_format($stats['total']); ?> </td> </tr> </tbody> </table> </div> <div id="myBlogInfo"> <h4 class="caption"><span><a href="<?php echo $ctx->getProperty('uri.blog') . '/owner/communication/comment'; ?> "><?php echo _t('알림판'); ?> </a></span></h4> <table class="recent"> <caption>asdasd</caption> <thead> <tr> <th scope="col" class="date"><?php echo _t('날짜'); ?> </th> <th scope="col" class="category"><?php echo _t('종류'); ?> </th> <th scope="col"><?php echo _t('내용'); ?> </th> </tr> </thead> <tbody> <?php foreach ($recents as $item) { ?> <tr class="<?php echo $item['category']; ?> "> <td class="date"><?php echo Timestamp::format('%m/%d', $item['date']); ?> </td> <td class="category"> <?php switch ($item['category']) { case 'trackback': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/trackback?status=received">' . _t('걸린글') . '</a>'; break; case 'comment': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=comment">' . _t('댓글') . '</a>'; break; case 'commentNotify': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/notify">' . _t('알리미') . '</a>'; break; case 'guestbook': echo '<a href="' . $ctx->getProperty('uri.blog') . '/owner/communication/comment?status=guestbook">' . _t('방명록') . '</a>'; break; } ?> </td> <td class="title"><a href="<?php echo $item['link']; ?> "><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 20)); ?> </a></td> </tr> <?php } ?> </tbody> </table> </div> <?php $noticeURL = TEXTCUBE_NOTICE_URL; $noticeURLRSS = $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko") . "/rss"; $noticeEntries = array(); if (!is_null(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language')))) { $noticeEntries = unserialize(Setting::getServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'))); } else { list($result, $feed, $xml) = getRemoteFeed($noticeURLRSS); if ($result == 0) { $xmls = new XMLStruct(); $xmls->setXPathBaseIndex(1); $noticeEntries = array(); if ($xmls->open($xml, $ctx->getProperty('service.encoding'))) { if ($xmls->getAttribute('/rss', 'version')) { for ($i = 1; $link = $xmls->getValue("/rss/channel/item[{$i}]/link"); $i++) { $item = array('permalink' => rawurldecode($link)); $item['title'] = $xmls->getValue("/rss/channel/item[{$i}]/title"); if ($xmls->getValue("/rss/channel/item[{$i}]/pubDate")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/pubDate")); } else { if ($xmls->getValue("/rss/channel/item[{$i}]/dc:date")) { $item['written'] = parseDate($xmls->getValue("/rss/channel/item[{$i}]/dc:date")); } else { $item['written'] = 0; } } array_push($noticeEntries, $item); } } } Setting::setServiceSetting('TextcubeNotice' . $ctx->getProperty('blog.language'), serialize($noticeEntries)); } } ?> <div id="textcube-notice"> <h4 class="caption"><span><a href="<?php echo $noticeURL . ($ctx->getProperty('blog.language') ? $ctx->getProperty('blog.language') : "ko"); ?> "><?php echo _t('공지사항'); ?> </a></span></h4> <?php if (count($noticeEntries) > 0) { array_splice($noticeEntries, 3, count($noticeEntries) - 3); ?> <table> <tbody> <?php foreach ($noticeEntries as $item) { ?> <tr> <td class="date"><?php echo Timestamp::format2($item['written']); ?> </td> <td class="title"><a href="<?php echo $item['permalink']; ?> " onclick="return openLinkInNewWindow(this);" ><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($item['title'], 35)); ?> </a></td> </tr> <?php } ?> </tbody> </table> <?php } else { ?> <div id="fail-notice"> <?php echo _t('공지사항을 가져올 수 없습니다. 잠시 후 다시 시도해 주십시오.'); ?> </div> <?php } ?> </div> <?php } ?> </div> <?php }
?> <li><a href="#textcube" class="link"><span class="colorText"><span class="c1">T</span><span class="c2">e</span><span class="c3">x</span><span class="c4">t</span><span class="c5">c</span><span class="c6">u</span><span class="c7">b</span><span class="c8">e</span></span></a></li> </ul> <?php echo printMobileHTMLFooter(); ?> </div> <?php ?> <div data-role="page" id="categories"> <?php printMobileHTMLMenu(); ?> <ul data-role="listview" title="Categories" selected="false"> <?php $totalPosts = getEntriesTotalCount($blogid); $categories = getCategories($blogid); print printMobileCategoriesView($totalPosts, $categories, true); ?> </ul> </div> <div data-role="page" id="archives"> <?php printMobileHTMLMenu(); ?> <ul data-role="listview" title="Archives" selected="false"> <?php $archives = getArchives($blogid); print printMobileArchivesView($archives); ?> </ul>
function getEntryWithPagingBySlogan($blogid, $slogan, $isSpecialEntry = false, $categoryId = false) { importlib('model.blog.category'); $ctx = Model_Context::getInstance(); importlib('model.blog.category'); $entries = array(); $paging = $isSpecialEntry ? $isSpecialEntry == 'page' ? Paging::init($ctx->getProperty('uri.blog') . "/page", '/') : Paging::init($ctx->getProperty('uri.blog') . "/notice", '/') : Paging::init($ctx->getProperty('uri.blog') . "/entry", '/'); if ($categoryId !== false) { if ($categoryId != 0) { // Not a 'total' category. $childCategories = getChildCategoryId($blogid, $categoryId); } } $pool = DBModel::getInstance(); $pool->init("Entries"); $pool->setAlias("Entries", "e"); $pool->setAlias("Categories", "c"); $pool->join("Categories", "left", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id"))); if (!doesHaveOwnership()) { $pool->setQualifier("e.visibility", ">", 0); } if (!($isSpecialEntry || doesHaveOwnership())) { $pool = getPrivateCategoryExclusionQualifier($pool, $blogid); } if (doesHaveOwnership() && !Acl::check('group.editors')) { $pool->setQualifierSet(array('e.userid', 'eq', getUserId()), 'OR', array('e.visibility', '>', 0)); } if ($isSpecialEntry) { if ($isSpecialEntry == 'page') { $pool->setQualifier("e.category", "=", -3); } else { $pool->setQualifier("e.category", "=", -2); } } else { $pool->setQualifier("e.category", ">=", 0); } if ($categoryId !== false) { if (!empty($childCategories)) { $pool->setQualifier("e.category", "hasoneof", $childCategories); } else { $pool->setQualifier("e.category", "eq", $categoryId); } } $pool->setQualifier("e.blogid", "eq", $blogid); $pool->setQualifier("e.slogan", "eq", $slogan, true); $pool->setQualifier("e.draft", "eq", 0); $currentEntry = $pool->getRow("e.*, c.label AS categoryLabel"); $pool->unsetQualifier("e.id"); $pool->setOrder("e.published", "DESC"); $result = $pool->getAll("e.id, e.slogan"); if (!$result || !$currentEntry) { return array($entries, $paging); } if ($categoryId !== false) { $paging['pages'] = $categoryId == 0 ? getEntriesTotalCount($blogid) : getEntriesCountByCategory($blogid, $categoryId); $paging['postfix'] = '?category=' . $categoryId; } else { $paging['pages'] = $isSpecialEntry ? $isSpecialEntry == 'page' ? getPagesTotalCount($blogid) : getNoticesTotalCount($blogid) : getEntriesTotalCount($blogid); } for ($i = 1; $entry = array_shift($result); $i++) { if ($entry['slogan'] != $slogan) { if (array_push($paging['before'], $entry['slogan']) > 4) { if ($i == 5) { $paging['first'] = array_shift($paging['before']); } else { array_shift($paging['before']); } } continue; } $paging['page'] = $i; array_push($entries, $currentEntry); $paging['after'] = array(); for ($i++; count($paging['after']) < 4 && ($entry = array_shift($result)); $i++) { array_push($paging['after'], $entry['slogan']); } if ($i < $paging['pages']) { while ($entry = array_shift($result)) { $paging['last'] = $entry['slogan']; } } if (count($paging['before']) > 0) { $paging['prev'] = $paging['before'][count($paging['before']) - 1]; } if (isset($paging['after'][0])) { $paging['next'] = $paging['after'][0]; } return array($entries, $paging); } $paging['page'] = $paging['pages'] + 1; return array($entries, $paging); }
?> .js"></script> <script type="text/javascript">jQuery.noConflict();</script> <script type="text/javascript" src="<?php echo $context->getProperty('service.path'); ?> /resources/script/EAF4.js"></script> <script type="text/javascript" src="<?php echo $context->getProperty('service.path'); ?> /resources/script/common3.min.js"></script> <script type="text/javascript" src="<?php echo $context->getProperty('service.path'); ?> /resources/script/owner.js"></script> <style type="text/css"> /*<![CDATA[*/ body { background-color : #FFFFFF; } /*]]>*/ </style> </head> <body id="tree-iframe"> <?php echo getCategoriesViewInSkinSetting(getEntriesTotalCount(getBlogId()), getCategories(getBlogId()), $selected); ?> </body> </html>