function CT_Start_Default($target) { requireModel("blog.attachment"); requireComponent("Eolin.PHP.Core"); requireComponent("Textcube.Function.misc"); global $blogid, $blogURL, $database, $service; $target .= '<ul>'; $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF; $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); if ($latestEntryId !== 0) { $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId); if ($latestEntry != false) { $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>'; } } if (Acl::check('group.administrators')) { $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF; } if ($service['reader'] != false) { $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF; } $target .= '</ul>'; return $target; }
function CT_Start_Default($target) { importlib("model.blog.attachment"); $context = Model_Context::getInstance(); $blogURL = $context->getProperty('uri.blog'); $blogid = $context->getProperty('blog.id'); $target .= '<ul>'; $target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF; $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0); if ($latestEntryId !== 0) { $latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId); if ($latestEntry != false) { $target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>'; } } if (Acl::check('group.administrators')) { $target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF; $target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF; } if ($context->getProperty('service.reader', false) != false) { $target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF; } $target .= '</ul>'; return $target; }
function _getRecentEntriesView($entries, $template) { $context = Model_Context::getInstance(); ob_start(); foreach ($entries as $entry) { $view = $template; Utils_Misc::dress('rctps_rep_link', $context->getProperty('uri.blog') . "/" . $entry['id'], $view); Utils_Misc::dress('rctps_rep_edit_link', $context->getProperty('uri.blog') . "/owner/entry/edit/" . $entry['id'], $view); Utils_Misc::dress('rctps_rep_title', htmlspecialchars(Utils_Unicode::lessenAsEm($entry['title'], 30)), $view); Utils_Misc::dress('rctps_rep_rp_cnt', "<span id=\"commentCountOnRecentEntries{$entry['id']}\">" . ($entry['comments'] > 0 ? "({$entry['comments']})" : '') . '</span>', $view); print $view; } $view = ob_get_contents(); ob_end_clean(); return $view; }
function RecentRP_getRecentCommentsView($comments, $template) { global $contentContainer; $context = Model_Context::getInstance(); ob_start(); foreach ($comments as $comment) { $view = "{$template}"; Utils_Misc::dress('rctrp_rep_link', $context->getProperty('uri.blog') . "/{$comment['entry']}#comment{$comment['id']}", $view); $contentContainer["recent_comment_{$comment['id']}"] = htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30)); Utils_Misc::dress('rctrp_rep_desc', setTempTag("recent_comment_{$comment['id']}"), $view); Utils_Misc::dress('rctrp_rep_desc', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['comment']), 30)), $view); Utils_Misc::dress('rctrp_rep_time', fireEvent('ViewRecentCommentDate', Timestamp::format3($comment['written'])), $view); Utils_Misc::dress('rctrp_rep_name', htmlspecialchars(Utils_Unicode::lessenAsEm(strip_tags($comment['name']), 10)) . $comment['secret'] . $comment['replier'], $view); print $view; } $view = ob_get_contents(); ob_end_clean(); return $view; }
function printFilterBox($mode, $title) { global $service; $filter = new Filter(); $filtersList = array(); if ($filter->open($mode, 'pattern')) { do { $filtersList[] = array(0 => $filter->id, 1 => $filter->pattern); } while ($filter->shift()); $filter->close(); } ?> <h3><?php echo $title; ?> </h3> <div class="filtering-words"> <table cellpadding="0" cellspacing="0"> <tbody id="filterbox-<?php echo $mode; ?> "<?php echo empty($filtersList) ? ' class="empty"' : ''; ?> > <?php if ($filtersList) { $id = 0; $count = 0; foreach ($filtersList as $key => $value) { $entity = $value[1]; $className = $count % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $id == sizeof($filtersList) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="content"><span title="<?php echo htmlspecialchars($entity); ?> "><?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($entity, 26)); ?> </span></td> <td class="delete"><a class="delete-button button" href="#void" onclick="deleteFilter(parentNode.parentNode,'<?php echo $mode; ?> ', '<?php echo urlencode($entity); ?> ',<?php echo $value[0]; ?> ); return false;" title="<?php echo _t('이 필터링을 제거합니다.'); ?> "><span class="text"><?php echo _t('삭제'); ?> </span></a></td> </tr> <?php $id++; $count++; } } else { ?> <tr <?php echo empty($filtersList) ? 'id="explainbox-' . $mode . '" ' : ''; ?> class="odd-line inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="empty"><?php echo _t('등록된 내용이 없습니다.'); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="input-field"> <input type="text" class="input-text" name="<?php echo $mode; ?> Value" onkeyup="if(event.keyCode=='13') {add('filterbox-<?php echo $mode; ?> ','<?php echo $mode; ?> '); return false;}" /> </div> <div class="button-box"> <input type="submit" class="add-button input-button" value="<?php echo _t('추가하기'); ?> " onclick="add('filterbox-<?php echo $mode; ?> ','<?php echo $mode; ?> '); return false;" /> </div> <?php }
function PN_Referer_Default() { global $pluginMenuURL, $pluginSelfParam; if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['page'])) { $_GET['page'] = $_POST['page']; } $page = Setting::getBlogSetting('RowsPerPageReferer', 20); if (empty($_POST['perPage'])) { $perPage = $page; } else { if ($page != $_POST['perPage']) { Setting::setBlogSetting('RowsPerPageReferer', $_POST['perPage']); $perPage = $_POST['perPage']; } else { $perPage = $_POST['perPage']; } } ?> <div id="part-statistics-rank" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t("리퍼러 순위"); ?> </span></h2> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="number"><span class="text"><?php echo _t("순위"); ?> </span></th> <th class="site"><span class="text"><?php echo _t("리퍼러"); ?> </span></th> </tr> </thead> <tbody> <?php $temp = Statistics::getRefererStatistics(getBlogId()); for ($i = 0; $i < count($temp); $i++) { $record = $temp[$i]; $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($temp) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="rank"><?php echo $i + 1; ?> .</td> <td class="site"><a href="http://<?php echo Utils_Misc::escapeJSInAttribute($record['host']); ?> " onclick="window.open(this.href); return false;"><?php echo htmlspecialchars($record['host']); ?> </a> <span class="count">(<?php echo $record['count']; ?> )</span></td> </tr> <?php } ?> </tbody> </table> </div> <hr class="hidden" /> <form id="part-statistics-log" class="part" method="post" action="<?php echo $pluginMenuURL; ?> "> <h2 class="caption"><span class="main-text"><?php echo _t("리퍼러 로그"); ?> </span></h2> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="number"><span class="text">날짜</span></th> <th class="site"><span class="text">주소</span></th> </tr> </thead> <tbody> <?php $more = false; list($referers, $paging) = Statistics::getRefererLogsWithPage($_GET['page'], $perPage); for ($i = 0; $i < count($referers); $i++) { $record = $referers[$i]; $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($referers) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="date"><?php echo Timestamp::formatDate($record['referred']); ?> </td> <td class="address"><a href="<?php echo Utils_Misc::escapeJSInAttribute($record['url']); ?> " onclick="window.open(this.href); return false;" title="<?php echo htmlspecialchars($record['url']); ?> "><?php echo fireEvent('ViewRefererURL', htmlspecialchars(Utils_Unicode::lessenAsEm($record['url'], 70)), $record); ?> </a></td> </tr> <?php } ?> </tbody> </table> <div class="data-subbox"> <div id="page-section" class="section"> <div id="page-navigation"> <span id="page-list"> <?php $paging['prefix'] = $pluginSelfParam . '&page='; $pagingTemplate = '[##_paging_rep_##]'; $pagingItemTemplate = '<a [##_paging_rep_link_##]>[[##_paging_rep_link_num_##]]</a>'; echo str_repeat("\t", 8) . Paging::getPagingView($paging, $pagingTemplate, $pagingItemTemplate) . CRLF; ?> </span> </div> <div class="page-count"> <?php echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 0); ?> <select name="perPage" onchange="document.getElementById('part-statistics-log').submit()"> <?php for ($i = 10; $i <= 30; $i += 5) { if ($i == $perPage) { ?> <option value="<?php echo $i; ?> " selected="selected"><?php echo $i; ?> </option> <?php } else { ?> <option value="<?php echo $i; ?> "><?php echo $i; ?> </option> <?php } } ?> </select> <?php echo Utils_Misc::getArrayValue(explode('%1', '한 페이지에 목록 %1건 표시'), 1); ?> </div> </div> </div> </form> <div class="clear"></div> <?php }
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 }
/// 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) define('__TEXTCUBE_IPHONE__', true); require ROOT . '/library/preprocessor.php'; requireView('iphoneView'); if (empty($suri['id'])) { printMobileHTMLHeader(); ?> <div data-role="page"> <?php printMobileHTMLMenu('', 'list'); ?> <ul data-role="listview" id="home" title="<?php echo htmlspecialchars(Utils_Unicode::lessenAsEm($context->getProperty('blog.title'), 30)); ?> " selected="true"> <?php $blogAuthor = User::getBlogOwnerName($blogid); $blogLogo = !is_null($context->getProperty('blog.logo')) && $context->getProperty('blog.logo') != "" ? printMobileImageResizer($blogid, $context->getProperty('blog.logo'), 80) : $context->getProperty('service.path') . "/resources/style/iphone/images/textcube_logo.png"; $itemsView = '<li class="blog_info">' . CRLF; $itemsView .= ' <div class="logo"><img src="' . $blogLogo . '" /></div>' . CRLF; $itemsView .= ' <div class="blog_container">' . CRLF; $itemsView .= ' <span class="title">' . htmlspecialchars($context->getProperty('blog.title')) . '</span>' . CRLF; $itemsView .= ' <span class="author">by ' . $blogAuthor . '</span>' . CRLF; $itemsView .= ' <span class="description">' . htmlspecialchars($context->getProperty('blog.description')) . '</span>' . CRLF; $itemsView .= ' </div>' . CRLF; $itemsView .= '</li>' . CRLF; print $itemsView; // Recent posts
function MT_Cover_getRecentEntries($parameters) { global $skin; $context = Model_Context::getInstance(); $data = $context->getProperty('plugin.config'); importlib("model.blog.entry"); importlib("model.blog.tag"); $data['coverMode'] = !isset($data['coverMode']) ? 1 : $data['coverMode']; if (Utils_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/" . $context->getProperty('blog.id'))) { @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id')); @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id'), 0777); } if (!is_dir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/")) { @mkdir(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/coverPostThumbnail/"); @chmod(__TEXTCUBE_CACHE_DIR__ . "/thumbnail/" . $context->getProperty('blog.id') . "/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]; } } $pool = DBModel::getInstance(); $pool->reset("BlogSettings"); $pool->setQualifier("name", "eq", 'visibility', true); $pool->setQualifier("value", "<", 2); $privateBlogId = $pool->getCell("blogid"); $pool->reset("Entries"); $pool->join("Categories", "left", array(array("e.blogid", "eq", "c.blogid"), array("e.category", "eq", "c.id"))); $pool->setQualifier("e.draft", "eq", 0); $pool->setQualifier("e.category", "beq", 0); if ($privateBlogId) { $pool->setQualifier("e.blogid", "hasnoneof", $privateBlogId); } if (Utils_Misc::isMetaBlog() == true && doesHaveOwnership() && $context->getProperty('service.type', 'single') != 'single') { $pool->setQualifier("e.visibility", ">", 1); $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0)); } else { if (!doesHaveOwnership()) { $pool->setQualifier("e.visibility", ">", 1); $pool->setQualifierSet(array("c.visibility", ">", 1), "OR", array("e.category", "eq", 0)); } } if ($data['coverMode'] != 2) { $pool->setQualifier("e.blogid", "eq", $context->getProperty("blog.id")); } list($entries, $paging) = Paging::fetch($pool, $page, $entryLength); $html = ''; foreach ((array) $entries as $entry) { $tagLabelView = ""; $blogid = $data['coverMode'] == 2 ? $entry['blogid'] : $context->getProperty('blog.id'); $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'], $context->getProperty('service.useEncodedURL', false)) : $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 .= Paging::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; }
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 /// 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) $commentListView = $skin->commentList; $itemsView = ''; foreach ($commentList['items'] as $item) { $itemView = $skin->commentListItem; dress('rplist_rep_regdate', fireEvent('ViewCommentListDate', Timestamp::format3($item['written']), $item['written']), $itemView); dress('rplist_rep_link', $context->getProperty('uri.blog') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($item['slogan'], $service['useEncodedURL']) : $item['entry']) . "#comment{$item['id']}", $itemView); dress('rplist_rep_name', htmlspecialchars($item['name']), $itemView); dress('rplist_rep_body', htmlspecialchars(fireEvent('ViewCommentListTitle', Utils_Unicode::lessenAsEm($item['comment'], 70))), $itemView); $itemsView .= $itemView; } dress('rplist_rep', $itemsView, $commentListView); dress('rplist_conform', htmlspecialchars(fireEvent('ViewCommentListHeadTitle', $commentList['title'])), $commentListView); dress('rplist_count', count($commentList['items']), $commentListView); dress('rplist', $commentListView, $view);
} else { ?> <input type="checkbox" class="input-checkbox" name="plugin" value="<?php echo $pluginDir; ?> " title="<?php echo _t('이 플러그인은 사용 중지 상태입니다. 클릭하시면 사용을 시작합니다.'); ?> " /> <?php } } if ($link) { echo sprintf('<a href="%s" title="%s - %s">%s</a>', htmlspecialchars($link), htmlspecialchars($title), _t('판번호') . ' ' . $version, $listType == 'listview' ? $title : htmlspecialchars(Utils_Unicode::lessenAsEm($title, 20))); } else { echo sprintf('<span title="%s - %s">%s</span>', htmlspecialchars($title), _t('판번호') . ' ' . $version, $listType == 'listview' ? $title : htmlspecialchars(Utils_Unicode::lessenAsEm($title, 20))); } ?> </div> <ul class="plugin-description"> <li class="author"><span class="label"><?php echo _t('제작자'); ?> : </span><a href="<?php echo htmlspecialchars($authorLink); ?> " title="<?php echo htmlspecialchars($author); ?> "><?php echo htmlspecialchars($author);
" width="150" height="150" alt="<?php echo _t('스킨 미리보기'); ?> " /> <?php } ?> </div> <div class="information"> <div id="info_<?php echo $skin['name']; ?> "> <?php if (isset($skin['skinName'])) { writeValue('<span class="skin-name">' . ($listType == 'iconview' ? Utils_Unicode::lessenAsEm($skin['skinName'], 15) : $skin['skinName']) . '</span> <span class="version">' . ($listType == 'iconview' ? Utils_Unicode::lessenAsEm($skin['version'], 5, '') : $skin['version']) . '</span>', _t('제목'), "title"); writeValue($skin['license'], _t('저작권'), "license"); writeValue($skin['maker'], _t('만든이'), "maker"); writeValue($skin['homepage'], _t('홈페이지'), "homepage"); writeValue($skin['email'], _t('e-mail'), "email"); writeValue($skin['description'], _t('설명'), "explain"); } else { writeValue($skin['name'], _t('제목')); } ?> </div> <div id="button_<?php echo $skin['name']; ?> " class="button-box"> <a class="preview-button button" href="<?php
function getLinkListView($links) { $context = Model_Context::getInstance(); if (rtrim($context->getProperty('suri.url'), '/') == $context->getProperty('uri.path')) { $home = true; } else { $home = false; } $categoryName = null; $buffer = '<ul>' . CRLF; $showXfn = Setting::getBlogSettingGlobal('useMicroformat', 3) > 1; foreach ($links as $link) { if (!doesHaveOwnership() && $link['visibility'] == 0 || !doesHaveMembership() && $link['visibility'] < 2) { continue; } if ($categoryName != $link['categoryName']) { if (!empty($categoryName)) { $buffer .= '</ul>' . CRLF . '</li>' . CRLF; } $categoryName = $link['categoryName']; $buffer .= '<li><span class="link_ct">' . htmlspecialchars($link['categoryName']) . '</span>' . CRLF . '<ul>' . CRLF; } if ($showXfn && $home && $link['xfn']) { addXfnAttrs(htmlspecialchars($link['url']), htmlspecialchars($link['xfn']), $link['url']); } $buffer .= '<li><a href="' . htmlspecialchars($link['url']) . '">' . fireEvent('ViewLink', htmlspecialchars(Utils_Unicode::lessenAsEm($link['name'], $context->getProperty('skin.linkLength')))) . '</a></li>' . CRLF; } if (!empty($categoryName)) { $buffer .= '</ul>' . CRLF . '</li>' . CRLF; } $buffer .= '</ul>' . CRLF; return $buffer; }
<td class="title"> <a href="<?php echo $trackback['url']; ?> " onclick="window.open(this.href); return false;" title="<?php echo _t('글을 건 글을 보여줍니다.'); ?> "><?php echo htmlspecialchars($trackback['subject']); ?> </a> <?php if (isset($tabsClass['received'])) { ?> <span class="excerpt"><?php echo Utils_Unicode::lessenAsEm(htmlspecialchars($trackback['excerpt']), 40); ?> </span> <?php } ?> </td> <?php if (isset($tabsClass['received'])) { ?> <td class="ip"> <?php if ($isIpFiltered) { ?> <a id="ipFilter<?php echo urlencode($trackback['ip']);
?> /owner/<?php echo $editmode; ?> /edit/<?php echo $entryModifyLink; ?> '<?php echo $entry['draft'] ? "+(confirm('" . _t('임시 저장본을 보시겠습니까?') . "') ? '?draft' : '')" : ''; ?> ; document.getElementById('list-form').submit(); return false;"><?php echo htmlspecialchars($entry['title']); ?> </a> <span class="description"><?php echo $contentLength > 0 ? Utils_Unicode::lessenAsEm(removeAllTags(strip_tags($entry['content'])), $contentLength) : ''; ?> </span> </td> <td class="category"> <?php if ($entry['category'] == 0) { ?> <a id="category_<?php echo $entry['id']; ?> " class="uncategorized" href="<?php echo $context->getProperty('uri.blog'); ?> /owner/entry?category=-10"><?php echo _t('분류 없음');
function refererkeyword() { global $pluginMenuURL, $pluginSelfParam, $configVal; $more = false; if (defined('TEXTCUBE_NAME')) { requireComponent('Textcube.Model.Statistics'); requireComponent('Textcube.Function.misc'); } else { requireComponent('Tattertools.Model.Statistics'); requireComponent('Tattertools.Function.misc'); } $data = Setting::fetchConfigVal($configVal); $showURL = 0; $limitRank = 5; $Filtering = array(); if (!is_null($data)) { $showURL = $data['showURL']; $limitRank = $data['limitRank']; $Filtering = preg_split("/[\\s,]+/", $data['WordFiltering']); } if (!empty($_POST['showURL'])) { $showURL = $_POST['showURL']; } if (!empty($_POST['showKeywordlistLight'])) { $limitRank = $_POST['showKeywordlistLight']; } $refereres = Statistics::getRefererLogs(); $keywordlist = array(); $wordlist = array(); $record = array(); $refererURL = array(); $totalpassedkeyword = 0; for ($i = 0; $i < sizeof($refereres); $i++) { $record = $refereres[$i]; if ($i == 0) { $referredend = $record['referred']; } $keyword = ""; $passthiskeyword = 0; list($keyword, ) = bringSearchWord($record['url'], $record['host']); foreach ($Filtering as $FilterWord) { if (strpos($keyword, $FilterWord) !== false) { $passthiskeyword = 1; $totalpassedkeyword++; break 1; } } if ($passthiskeyword == 0) { if (array_key_exists($keyword, $keywordlist)) { $refererURL[$keyword][$keywordlist[$keyword]] = $record['url']; $keywordlist[$keyword]++; } elseif ($keyword) { $keywordlist[$keyword] = 1; $refererURL[$keyword][0] = $record['url']; } $word = split(" ", $keyword); foreach ($word as $maira) { if (array_key_exists($maira, $wordlist)) { $wordlist[$maira]++; } elseif ($maira) { $wordlist[$maira] = 1; } } } } $referredstart = array_key_exists('referred', $record) ? $record['referred'] : null; ?> <h2 class="caption"><span class="main-text"><?php echo _t('리퍼러 검색어 통계') . " (" . Timestamp::formatDate($referredstart) . " ~ " . Timestamp::formatDate($referredend) . ")"; ?> </span></h2> <div id="statistics-counter-inbox" class="data-inbox"> <div class="title"> <span class="label"><span class="text"><?php echo _t('총 검색어 개수'); ?> </span></span> <span class="divider"> : </span> <span id="total"><?php echo count($keywordlist); ?> </span> <span class="divider"> : </span> <span class="label"><span class="text"><?php echo _t('총 리퍼러 개수'); ?> </span></span> <span class="divider"> : </span> <span id="total"><?php echo sizeof($refereres); ?> </span> <span class="divider"> : </span> <?php if ($totalpassedkeyword > 0) { ?> <span class="label"><span class="text"><?php echo _t('필터링된 리퍼러 개수'); ?> </span></span> <span class="divider"> : </span> <span id="total"><?php echo $totalpassedkeyword; ?> </span> <span class="divider"> : </span> <?php } ?> </div> <form id="refererkeyword-option" class="part" method="post" action="<?php echo $pluginMenuURL; ?> "> <div class="title"> <span class="label"><?php echo _t('검색어 순위 출력은'); ?> </span> <span class="label"><select name="showKeywordlistLight" onchange="document.getElementById('refererkeyword-option').submit()"> <option value="5"<?php if ($limitRank == 5 || $limitRank == 0) { echo " selected=\"selected\""; } ?> ><?php echo _t('5위까지만 출력합니다'); ?> </option> <option value="10"<?php if ($limitRank == 10) { echo " selected=\"selected\""; } ?> ><?php echo _t('10위까지만 출력합니다'); ?> </option> <option value="15"<?php if ($limitRank == 15) { echo " selected=\"selected\""; } ?> ><?php echo _t('15위까지만 출력합니다'); ?> </option> <option value="3939"<?php if ($limitRank == 3939) { echo " selected=\"selected\""; } ?> ><?php echo _t('모든 순위를 출력합니다'); ?> </option> </select></span> </div> <div class="title"> <span class="label"><span class="text"><?php echo _t('각 검색어가 검출된 주소를'); ?> </span></span> <span class="label"><select name="showURL" onchange="document.getElementById('refererkeyword-option').submit()"> <option value="0"<?php if ($showURL == 0 || $showURL == "") { echo " selected=\"selected\""; } ?> ><?php echo _t('출력하지 않습니다'); ?> </option> <option value="1"<?php if ($showURL == 1) { echo " selected=\"selected\""; } ?> ><?php echo _t('출력합니다'); ?> </option> </select></span> </div> </form> </div> <hr class="hidden" /> <div id="part-statistics-cloud" class="part"> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="site"><span class="text"><?php echo _t('검색어에 주로 쓰인 단어'); ?> </span></th> </tr> </thead> <tbody> <tr class="even-line inactive-class"> <td class="keywordcloud"> <?php srand((double) microtime() * 1000000); $wordlist = array_sort($wordlist, 'desc'); $original_wordlist = $wordlist; $wordkeys = array_keys($wordlist); $i = 0; $cloudstyle = array(); foreach ($wordkeys as $wordwork) { if ($wordlist[$wordwork] < 2) { unset($wordlist[$wordwork]); unset($wordkeys[$i]); } if ($wordlist[$wordwork] > 50) { $cloudstyle[$i] = "cloud1"; } elseif ($wordlist[$wordwork] > 25) { $cloudstyle[$i] = "cloud2"; } elseif ($wordlist[$wordwork] > 15) { $cloudstyle[$i] = "cloud3"; } elseif ($wordlist[$wordwork] > 6) { $cloudstyle[$i] = "cloud4"; } else { $cloudstyle[$i] = "cloud5"; } $i++; } if (count($wordkeys) <= 10) { $wordlist = $original_wordlist; $wordkeys = array_keys($wordlist); } //shuffle ($wordkeys); $beforewordvalue = ''; $wordrank = 0; for ($i = 0; $i < sizeof($wordlist); $i++) { $wordkey = $wordkeys[$i]; $wordvalue = $wordlist[$wordkey]; $wordkey = str_replace("\"", """, $wordkeys[$i]); if ($wordvalue != $beforewordvalue) { if ($wordrank == 15) { break; } $wordrank++; $beforewordvalue = $wordvalue; } $wordclassName = $i % 2 == 1 ? 'even-line' : 'odd-line'; $wordclassName .= $i == sizeof($wordlist) - 1 ? ' last-line' : ''; echo "<a class=\"" . $cloudstyle[$i] . "\">" . htmlspecialchars($wordkey) . "</a> "; } ?> </td> </tr> </tbody> </table> </div> <hr class="hidden" /> <div id="part-statistics-log" class="part"> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="number"><span class="text"><?php echo _t('순위'); ?> </span></th> <th class="number"><span class="text"><?php echo _t('개수'); ?> </span></th> <th class="searchwordtitle"><span class="text"><?php echo _t('검색어명'); ?> </span></th> </tr> </thead> <tbody> <?php $keywordlist = array_sort($keywordlist, 'desc'); $keywordkeys = array_keys($keywordlist); $beforekeywordvalue = ''; $rank = array(); $samerank = 1; $rankcount = 0; // 머리가 나빠서 죄송합니다... orz for ($i = 0; $i < sizeof($keywordlist); $i++) { $keywordkey = $keywordkeys[$i]; $keywordvalue = $keywordlist[$keywordkey]; // $keywordkey = str_replace("\"", """,$keywordkeys[$i]); if ($keywordvalue != $beforekeywordvalue) { $rankcount++; $rank[$i] = $rankcount; $beforekeywordvalue = $keywordvalue; } else { $rank[$i] = $rankcount; } } $eversamerankTotal = array_count_values($rank); $rankcount = 0; for ($i = 0; $i < sizeof($keywordlist); $i++) { $keywordkey = $keywordkeys[$i]; $keywordvalue = $keywordlist[$keywordkey]; // $keywordkey = str_replace("\"", """,$keywordkeys[$i]); if ($keywordvalue != $beforekeywordvalue) { $rankcount++; $beforekeywordvalue = $keywordvalue; $samerank = 1; } else { $samerank++; } if ($limitRank != 3939) { if ($rankcount >= 6 && $limitRank == 5) { break; } if ($rankcount >= 11 && $limitRank == 10) { break; } if ($rankcount >= 16 && $limitRank == 15) { break; } } $RefererURLthiskeyword = $refererURL[$keywordkey]; if ($eversamerankTotal[$rankcount] == 1) { $viewSameRank = ''; } else { $viewSameRank = " (" . $samerank . "/" . $eversamerankTotal[$rankcount] . ")"; } ?> <tr onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="rank"><?php echo $rankcount . _t('위') . $viewSameRank; ?> </td> <td class="rank"><?php echo $keywordvalue . _t('개'); ?> </td> <td class="address"><?php echo htmlspecialchars($keywordkey); ?> </td> </tr> <?php if ($showURL == 1) { $j = 0; foreach (array_unique($RefererURLthiskeyword) as $splitRefererURL) { $urlClassName = $j == sizeof(array_unique($RefererURLthiskeyword)) - 1 ? '' : 'noBorderBottom'; list(, $decodeURL) = bringSearchWord($splitRefererURL); ?> <tr> <td class="<?php echo $urlClassName; ?> "></td> <td class="<?php echo $urlClassName; ?> "></td> <td class="refererurl"> <?php echo "<a href=\"" . Misc::escapeJSInAttribute($splitRefererURL) . "\" onclick=\"window.open(this.href); return false;\">" . Utils_Unicode::lessenAsEm(htmlspecialchars($decodeURL), 90) . "</a>"; $j++; } } ?> </td> </tr> <?php } ?> </tbody> </table> </div> <div class="clear"></div> <?php }
function pretty_dress($view) { global $blogid, $blog, $database, $service, $stats, $skinSetting; $context = Model_Context::getInstance(); /* local static */ global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry; global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList; if (isset($_REQUEST['safe'])) { // safe mode return '<div class="coverpage-element-safebox">…</div>'; } if (isset($_REQUEST['tag'])) { // safe mode return '<div class="coverpage-element-safebox"><p>' . nl2br(htmlspecialchars($view, ENT_QUOTES)) . '</p></div>'; } $writer = User::getBlogOwnerName($blogid); $pageTitle = _t('페이지 제목'); dress('page_title', htmlspecialchars($pageTitle), $view); dress('blogger', htmlspecialchars($writer), $view); dress('title', htmlspecialchars($context->getProperty('blog.title')), $view); dress('desc', htmlspecialchars($context->getProperty('blog.description')), $view); if ($context->getProperty('blog.logo') != null) { dress('image', $context->getProperty('service.path') . "/attach/{$blogid}/" . $context->getProperty('blog.logo'), $view); } else { dress('image', $context->getProperty('service.path') . "/resources/image/spacer.gif", $view); } dress('blog_link', $context->getProperty('uri.blog') . "/", $view); dress('keylog_link', $context->getProperty('uri.blog') . "/keylog", $view); dress('localog_link', $context->getProperty('uri.blog') . "/location", $view); dress('taglog_link', $context->getProperty('uri.blog') . "/tag", $view); dress('guestbook_link', $context->getProperty('uri.blog') . "/guestbook", $view); list($view, $searchView) = Skin::cutSkinTag($view, 'search'); dress('search_name', 'search', $searchView); dress('search_text', isset($search) ? htmlspecialchars($search) : '', $searchView); dress('search_onclick_submit', 'searchBlog()', $searchView); dress('search', '<form id="TTSearchForm" action="' . parseURL($context->getProperty('uri.blog') . '/search/') . '" method="get" onsubmit="return searchBlog()">' . $searchView . '</form>', $view); dress('category', $pd_category, $view); dress('category_list', $pd_categoryXhtml, $view); dress('count_total', $stats['total'], $view); dress('count_today', $stats['today'], $view); dress('count_yesterday', $stats['yesterday'], $view); list($view, $archiveView) = Skin::cutSkinTag($view, 'archive_rep'); dress('archive_rep', getArchivesView($pd_archive, $archiveView), $view); dress('calendar', $pd_calendar, $view); list($view, $randomView) = Skin::cutSkinTag($view, 'random_tags'); dress('random_tags', getRandomTagsView($pd_tags, $randomView), $view); list($view, $recentNoticeItem) = Skin::cutSkinTag($view, 'rct_notice_rep'); list($view, $noticeView) = Skin::cutSkinTag($view, 'rct_notice'); $notices = $pd_notices; if (sizeof($notices) == 0) { $notices = array(array('title' => _t('공지 제목'), 'id' => -1)); } if (sizeof($notices) > 0) { $itemsView = ''; foreach ($notices as $notice) { $itemView = $recentNoticeItem; dress('notice_rep_title', htmlspecialchars(fireEvent('ViewNoticeTitle', Utils_Unicode::lessenAsEm($notice['title'], $skinSetting['recentNoticeLength']), $notice['id'])), $itemView); dress('notice_rep_link', "{$context->getProperty}('uri.blog')/notice/{$notice['id']}", $itemView); $itemsView .= $itemView; } dress('rct_notice_rep', $itemsView, $noticeView); dress('rct_notice', $noticeView, $view); } list($view, $authorList) = Skin::cutSkinTag($view, 'author_rep'); dress('author_rep', getAuthorListView($pd_authorList, $authorList), $view); list($view, $recentEntry) = Skin::cutSkinTag($view, 'rctps_rep'); dress('rctps_rep', getRecentEntriesView($pd_recentEntry, null, $recentEntry), $view); list($view, $recentComments) = Skin::cutSkinTag($view, 'rctrp_rep'); dress('rctrp_rep', getRecentCommentsView($pd_recentComment, null, $recentComments), $view); list($view, $recentTrackback) = Skin::cutSkinTag($view, 'rcttb_rep'); dress('rcttb_rep', getRecentTrackbacksView($pd_recentTrackback, null, $recentTrackback), $view); list($view, $s_link_rep) = Skin::cutSkinTag($view, 'link_rep'); dress('link_rep', getLinksView($pd_link, $s_link_rep), $view); dress('rss_url', "{$context->getProperty}('uri.blog')/rss", $view); dress('owner_url', "{$context->getProperty}('uri.blog')/owner", $view); dress('textcube_name', TEXTCUBE_NAME, $view); dress('textcube_version', TEXTCUBE_VERSION, $view); $tagSearches = array('@<a @i', '@</a *>@i', '@ id *= *".*"@isU', '@ onkey(down|up|press) *="@i', '@ on(click|load|unload) *="@i', '@<input +@i', '@<script.*</script *>@siU', '@<form @siU', '@</form>@siU'); $tagReplaces = array('<span ', '</span>', '', ' onnothing="', ' onnothing="', '<input disabled="disabled" ', '', '<div ', '</div>'); $view = preg_replace($tagSearches, $tagReplaces, $view); return correctCoverpageImage($view); }
function printMobileLinksView($links) { $context = Model_Context::getInstance(); if (rtrim($suri['url'], '/') == $context->getProperty('uri.path')) { $home = true; } else { $home = false; } $categoryName = ''; foreach ($links as $link) { if (!doesHaveOwnership() && $link['visibility'] == 0 || !doesHaveMembership() && $link['visibility'] < 2) { continue; } if (!empty($link['categoryName']) && $link['categoryName'] != $categoryName) { $linkView .= '<li data-theme="b">' . htmlspecialchars(Utils_Unicode::lessenAsEm($link['categoryName'], $skinSetting['linkLength'])) . '</li>' . CRLF; $categoryName = $link['categoryName']; } $linkView .= '<li><a href="' . htmlspecialchars($link['url']) . '" class="link" target="_blank">' . htmlspecialchars(Utils_Unicode::lessenAsEm($link['name'], $context->getProperty('skin.linkLength'))) . '</a></li>' . CRLF; } return $linkView; }