<input type="submit" class="revert-button input-button" value="<?php echo _t('복구'); ?> " onclick="revertTrackbacks(); return false;" /> </div> <div id="page-section" class="section"> <div id="page-navigation"> <span id="page-list"> <?php //$paging['url'] = 'document.getElementById('list-form').page.value='; //$paging['prefix'] = ''; //$paging['postfix'] = '; document.getElementById('list-form').submit()'; $pagingTemplate = '[##_paging_rep_##]'; $pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>'; print getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false); ?> </span> <span id="total-count"><?php echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']); ?> </span> </div> <div class="page-count"> <?php echo getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0); ?> <select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()"> <?php for ($i = 10; $i <= 30; $i += 5) {
</div> <hr class="hidden" /> <div id="page-section" class="section"> <h2><?php echo _t('페이지 네비게이션'); ?> </h2> <div id="page-navigation"> <span id="page-list"> <?php $pagingTemplate = '[##_paging_rep_##]'; $pagingItemTemplate = '<a [##_paging_rep_link_##]>[##_paging_rep_link_num_##]</a>'; echo str_repeat("\t", 12) . getPagingView($paging, $pagingTemplate, $pagingItemTemplate, false) . CRLF; ?> </span> <span id="total-count"><?php echo _f('총 %1건', empty($paging['total']) ? "0" : $paging['total']); ?> </span> </div> <div class="page-count"> <?php echo getArrayValue(explode('%1', _t('한 페이지에 글 %1건 표시')), 0); ?> <select name="perPage" onchange="document.getElementById('list-form').page.value=1; document.getElementById('list-form').submit()"> <?php for ($i = 10; $i <= 30; $i += 5) {
function MT_Cover_getRecentEntries($parameters) { global $database, $blog, $service, $serviceURL, $suri, $configVal, $defaultURL, $skin; requireModel("blog.entry"); requireModel("blog.tag"); $data = Setting::fetchConfigVal($configVal); $data['coverMode'] = !isset($data['coverMode']) ? 1 : $data['coverMode']; if (Misc::isMetaBlog() != true) { $data['coverMode'] = 1; } $data['screenshot'] = !isset($data['screenshot']) ? 1 : $data['screenshot']; $data['screenshotSize'] = !isset($data['screenshotSize']) ? 90 : $data['screenshotSize']; $data['paging'] = !isset($data['paging']) ? '2' : $data['paging']; $data['contentLength'] = !isset($data['contentLength']) ? 250 : $data['contentLength']; if (isset($parameters['preview'])) { // preview mode $retval = '표지에 최신 글 목록을 추가합니다.'; return htmlspecialchars($retval); } $entryLength = isset($parameters['entryLength']) ? $parameters['entryLength'] : 10; if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail")) { @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail"); @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail", 0777); } if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId())) { @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId()); @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId(), 0777); } if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/coverPostThumbnail/")) { @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/coverPostThumbnail/"); @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . getBlogId() . "/coverPostThumbnail/", 0777); } $page = $data['paging'] == '1' && !empty($_GET['page']) ? intval($_GET['page']) : 1; $cache = new PageCache(); $cache->name = 'MT_Cover_RecentPS'; if ($cache->load()) { //If successful loads $cache->contents = unserialize($cache->contents); // If coverpage is single mode OR coverpage is coverblog and cache is not expired, return cache contents. if (($data['coverMode'] == 1 || $data['coverMode'] == 2) && array_key_exists($page, $cache->contents) && Timestamp::getUNIXtime() - $cache->dbContents < 300) { return $cache->contents[$page]; } } if (Misc::isMetaBlog() == true && doesHaveOwnership() && $service['type'] != 'single') { $visibility = 'AND e.visibility > 1 AND (c.visibility > 1 OR e.category = 0)'; } else { $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 1 AND (c.visibility > 1 OR e.category = 0)'; } $multiple = $data['coverMode'] == 2 ? '' : 'e.blogid = ' . getBlogId() . ' AND'; $privateBlogId = POD::queryColumn("SELECT blogid \n\t\tFROM {$database['prefix']}BlogSettings\n\t\tWHERE name = 'visibility'\n\t\tAND value < 2"); if (!empty($privateBlogId)) { $privateBlogs = ' AND e.blogid NOT IN (' . implode(',', $privateBlogId) . ')'; } else { $privateBlogs = ''; } list($entries, $paging) = Paging::fetch("SELECT e.blogid, e.id, e.userid, e.title, e.content, e.slogan, e.category, e.published, e.contentformatter, c.label\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 {$multiple} e.draft = 0 {$visibility} AND e.category >= 0 {$privateBlogs}\n\t\tORDER BY published DESC", $page, $entryLength); $html = ''; foreach ((array) $entries as $entry) { $tagLabelView = ""; $blogid = $data['coverMode'] == 2 ? $entry['blogid'] : getBlogId(); $entryTags = getTags($blogid, $entry['id']); $defaultURL = getDefaultURL($blogid); if (sizeof($entryTags) > 0) { $tags = array(); foreach ($entryTags as $entryTag) { $tags[$entryTag['name']] = "<a href=\"{$defaultURL}/tag/" . (Setting::getBlogSettingGlobal('useSloganOnTag', true) ? URL::encode($entryTag['name'], $service['useEncodedURL']) : $entryTag['id']) . '">' . htmlspecialchars($entryTag['name']) . '</a>'; } $tagLabelView = "<div class=\"post_tags\"><span>TAG : </span>" . implode(",\r\n", array_values($tags)) . "</div>"; } if (empty($entry['category'])) { $entry['label'] = _text('분류없음'); $entry['link'] = "{$defaultURL}/category"; } else { $entry['link'] = "{$defaultURL}/category/" . (Setting::getBlogSettingGlobal('useSloganOnCategory', true) ? URL::encode($entry['label'], $service['useEncodedURL']) : $entry['category']); } $permalink = "{$defaultURL}/" . (Setting::getBlogSettingGlobal('useSloganOnPost', true) ? "entry/" . URL::encode($entry['slogan'], $service['useEncodedURL']) : $entry['id']); $html .= '<div class="coverpost">' . CRLF; if ($imageName = MT_Cover_getAttachmentExtract($entry['content'])) { if (($tempImageSrc = MT_Cover_getImageResizer($blogid, $imageName, $data['screenshotSize'])) && $data['screenshot'] == 1) { $html .= '<div class="img_preview"><a href="' . $permalink . '"><img src="' . $tempImageSrc . '" alt="" /></a></div>' . CRLF; } } $html .= ' <div class="content_box">'; $html .= ' <h2><a href="' . $permalink . '">' . htmlspecialchars($entry['title']) . '</a></h2>' . CRLF; $html .= ' <div class="post_info">' . CRLF; $html .= ' <span class="category"><a href="' . htmlspecialchars($entry['link']) . '">' . htmlspecialchars($entry['label']) . '</a></span>' . CRLF; $html .= ' <span class="date">' . Timestamp::format5($entry['published']) . '</span>' . CRLF; $html .= ' <span class="author"><span class="preposition">by </span>' . User::getName($entry['userid']) . '</span>' . CRLF; $html .= ' </div>' . CRLF; $html .= ' <div class="post_content">' . htmlspecialchars(Utils_Unicode::lessenAsEm(removeAllTags(stripHTML($entry['content'])), $data['contentLength'])) . '</div>' . CRLF; $html .= $tagLabelView; $html .= ' <div class="clear"></div>' . CRLF; $html .= ' </div>'; $html .= '</div>' . CRLF; } if ($data['paging'] == '1') { $paging['page'] = $page; $paging['total'] = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries e WHERE {$multiple} e.draft = 0 {$visibility} AND e.category >= 0"); $html .= getPagingView($paging, $skin->paging, $skin->pagingItem) . CRLF; $html .= '<script type="text/javascript">' . CRLF; $html .= '//<![CDATA[' . CRLF; if ($paging['page'] > 1) { $html .= 'var prevURL = "' . $paging['url'] . '?page=' . ($paging['page'] - 1) . '"' . CRLF; } if ($paging['page'] < $paging['total']) { $html .= 'var nextURL = "' . $paging['url'] . '?page=' . ($paging['page'] + 1) . '"' . CRLF; } $html .= '//]]>' . CRLF; $html .= '</script>'; } $target = $html; $cache->contents[$page] = $target; $cache->contents = serialize($cache->contents); $cache->dbContents = Timestamp::getUNIXtime(); $cache->update(); unset($cache); return $target; }
<?php } } ?> </tbody> </table> </div> </div> <?php $paging = array('url' => "", 'prefix' => '?page=', 'postfix' => '', 'total' => 0, 'pages' => 0, 'page' => 0); $paging['pages'] = $pages; $paging['page'] = $page; $pagingTemplate = '[##_paging_rep_##]'; $pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>'; ?> <div id="page-navigation"> <span id="page-list"><?php echo getPagingView($paging, $pagingTemplate, $pagingItemTemplate); ?> </span> <span id="total-count"><?php echo _f('총 %1명의 사용자', $usercount); ?> </span> </div> <?php $page = isset($_GET['page']) ? $_GET['page'] : 1; // end header require ROOT . '/interface/common/control/footer.php';
} if (preg_match("@\\[##_link_list_##\\]@iU", $view)) { dress('link_list', getLinkListView(getLinks($blogid)), $view, false, true); } if (preg_match("@\\[##_paging_##\\]@iU", $view)) { if (isset($paging)) { if (isset($cache) && strpos($cache->name, 'Paging') !== false) { if ($cache->load()) { $pagingView = $cache->contents; } else { $pagingView = getPagingView($paging, $skin->paging, $skin->pagingItem); $cache->contents = $pagingView; $cache->update(); } } else { $pagingView = getPagingView($paging, $skin->paging, $skin->pagingItem); } dress('paging_list', $pagingView, $view, false, true); if (!empty($entries) || $suri['directive'] == '/guestbook') { dress('paging', $pagingView, $view, false, true); } $url = URL::encode($paging['url'], $service['useEncodedURL']); $prefix = $paging['prefix']; $postfix = isset($paging['postfix']) ? $paging['postfix'] : ''; // prev_page, next_page for legacy support. dress('prev_page', isset($paging['prev']) ? "href='{$url}{$prefix}{$paging['prev']}{$postfix}'" : '', $view); dress('prev_page_title', isset($paging['prev_title']) ? $paging['prev_title'] : '', $view); dress('next_page', isset($paging['next']) ? "href='{$url}{$prefix}{$paging['next']}{$postfix}'" : '', $view); dress('next_page_title', isset($paging['next_title']) ? $paging['next_title'] : '', $view); } else { if (isset($cache) && strpos($cache->name, 'Paging') !== false && $cache->load()) {