function PN_Visitor_Default() { global $pluginMenuURL, $pluginHandlerURL; $blogid = getBlogId(); $stats = Statistics::getStatistics($blogid); $date = isset($_GET['date']) ? $_GET['date'] : date('Ym', strtotime("now")); ?> <!-- This tab space below this line is inserted for the indentation of original admin page --> <script type="text/javascript"> //<![CDATA[ <?php if (Acl::check('group.owners')) { ?> function setTotalStatistics() { if (confirm("방문자의 수를 초기화하면 방문객의 수가 0이 됩니다.\n정말 초기화하시겠습니까?")) { var request = new HTTPRequest("GET", "<?php echo $pluginHandlerURL; ?> /PN_Visitor_Default_set&ajaxcall"); request.onSuccess = function() { //document.getElementById("total").innerHTML = 0; window.location = '<?php echo $pluginMenuURL; ?> '; return true; } request.onError = function() { alert("저장하지 못했습니다."); return false; } request.send(); } } <?php } ?> function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } window.addEventListener("load", execLoadFunction, false); function execLoadFunction() { tempDiv = document.createElement("DIV"); tempDiv.style.clear = "both"; document.getElementById("part-statistics-visitor").appendChild(tempDiv); } //]]> </script> <form method="post" action="<?php echo $pluginHandlerURL; ?> PN_Visitor_Default_set"> <div id="part-statistics-visitor" class="part"> <h2 class="caption"><span class="main-text">방문자 통계정보를 보여줍니다</span></h2> <div id="statistics-counter-inbox" class="data-inbox"> <div class="title"> <span class="label"><span class="text">현재까지의 방문자 수</span></span> <span class="divider"> : </span> <span id="total"><?php echo number_format($stats['total']); ?> </span> </div> <?php if (Acl::check('group.owners')) { ?> <a class="init-button button" href="<?php echo $pluginHandlerURL; ?> /PN_Visitor_Default_set" onclick="setTotalStatistics(); return false;"><span class="text">초기화</span></a> <?php } ?> </div> <hr class="hidden" /> <table id="statistics-month-inbox" class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><span class="text">월별 방문자 수</span></th> </tr> </thead> <tbody> <?php $temp = Statistics::getMonthlyStatistics($blogid); for ($i = 0; $i < sizeof($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')" onclick="window.location.href='<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> '"> <td class="date"><a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> "><?php echo Timestamp::formatDate2(Utils_Misc::getTimeFromPeriod($record['datemark'])); ?> </a></td> <td class="count"><a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $record['datemark']; ?> "><?php echo $record['visits']; ?> </a></td> </tr> <?php } ?> </tbody> </table> <hr class="hidden" /> <table id="statistics-day-inbox" class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><span class="text">일별 방문자 수</span></th> </tr> </thead> <tbody> <?php if (isset($date)) { $temp = Statistics::getDailyStatistics($date); for ($i = 0; $i < sizeof($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"> <td class="date"><?php echo Timestamp::formatDate(Utils_Misc::getTimeFromPeriod($record['datemark'])); ?> </td> <td class="count"><?php echo $record['visits']; ?> </td> </tr> <?php } } ?> </tbody> </table> </div> </form> <?php }
} else { $currentSite = $siteNumber[$trackback['site']]; } $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($trackbacks) - 1 ? ' last-line' : ''; ?> <tr class="<?php echo $className; ?> inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="selection"><input type="checkbox" class="checkbox" name="entry" value="<?php echo $trackback['id']; ?> " onclick="document.getElementById('allChecked').checked=false; toggleThisTr(this);" /></td> <td class="date"><?php echo Timestamp::formatDate($trackback['written']); ?> </td> <td class="site"> <?php if ($isFilterURL) { ?> <a id="urlFilter<?php echo $currentSite; ?> -<?php echo $i; ?> " class="block-icon bullet" href="<?php echo $context->getProperty('uri.blog'); ?>
inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')"> <td class="selection"> <input id="commentCheckId<?php echo $comment['id']; ?> " type="checkbox" class="checkbox" name="entry" value="<?php echo $comment['id']; ?> " /> <label for="commentCheckId<?php echo $comment['id']; ?> "></label> </td> <td class="date"><?php echo Timestamp::formatDate($comment['written']); ?> </td> <td class="site"><a href="<?php echo $comment['siteUrl']; ?> " onclick="window.open(this.href); return false;" title="<?php echo _t('사이트를 연결합니다.'); ?> "><?php echo htmlspecialchars($comment['siteTitle']); ?> </a></td> <td class="name"> <?php if ($isNameFiltered) {
"><?php echo User::getName($entry['userid']); ?> </span> </td> <td class="response"> <a href="<?php echo $context->getProperty('uri.blog') . (isset($blog['useSloganOnPost']) && $blog['useSloganOnPost'] == 1 ? '/entry/' . $entry['slogan'] : '/' . $entry['id']) . '#entry' . $entry['id'] . 'Comment'; ?> "><?php echo $entry['comments'] + $entry['trackbacks']; ?> </a> </td> <td class="date"><?php echo Timestamp::formatDate($entry['published']); ?> </td> <td class="status"> <?php if ($entry['category'] == -4) { ?> <span id="templateInstruction"><?php echo _t('서식'); ?> </span> <?php } else { if ($entry['visibility'] == 0) { ?> <span id="privateIcon_<?php
<?php /// Copyright (c) 2004-2016, Needlworks / Tatter Network Foundation /// All rights reserved. Licensed under the GPL. /// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT) if (!empty($listView)) { dress('list', $listView, $view); } else { if (isset($list) && isset($skin)) { $listView = $skin->list; $itemsView = ''; foreach ($list['items'] as $item) { $author = User::getName($item['userid']); $itemsView .= str_replace(array('[##_list_rep_regdate_##]', '[##_list_rep_name_##]', '[##_list_rep_author_##]', '[##_list_rep_link_##]', '[##_list_rep_title_##]', '[##_list_rep_rp_cnt_##]'), array(fireEvent('ViewListDate', Timestamp::formatDate($item['published']), $item['published']), fireEvent('ViewListName', htmlspecialchars($author)), fireEvent('ViewListName', htmlspecialchars($author)), (!empty($skinSetting['showListWithTotalEntries']) ? "#entry_" . $item['id'] : $context->getProperty('uri.blog') . "/" . ($context->getProperty('blog.useSloganOnPost') ? 'entry/' . URL::encode($item['slogan'], $service['useEncodedURL']) : $item['id'])) . (isset($list['category']) ? '?category=' . $list['category'] : ''), fireEvent('ViewListTitle', htmlspecialchars($item['title'])), $item['comments'] > 0 ? "{$item['comments']}" : ''), $skin->listItem); } dress('list_rep', $itemsView, $listView); dress('list_conform', fireEvent('ViewListHeadTitle', htmlspecialchars($list['title'])), $listView); dress('list_count', isset($list['count']) ? $list['count'] : '0', $listView); dress('list_rss_url', $context->getProperty('uri.default') . '/rss/' . $listFeedURL, $listView); dress('list_atom_url', $context->getProperty('uri.default') . '/atom/' . $listFeedURL, $listView); $listView = fireEvent('ViewList', $listView, $list); if (empty($entries)) { $listView = $listView . CRLF . '[##_paging_list_##]'; } dress('list', $listView, $view); if (isset($cache)) { $cache->contents = $listView; $cache->dbContents = $paging; $cache->update(); } }
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 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 PN_Subscription_Default() { global $pluginMenuURL, $pluginSelfParam, $totalSubscribers, $updatedSubscribers; $blogid = getBlogId(); $temp = getSubscriptionStatistics($blogid); $aggregatorInfo = organizeAggregatorInfo($temp); Setting::setBlogSetting('SubscriberCount', $totalSubscribers); ?> <script type="text/javascript"> //<![CDATA[ window.addEventListener("load", execLoadFunction, false); function execLoadFunction() { //removeItselfById('log-pages-submit'); } //]]> </script> <div id="part-statistics-total" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t("전체 피드 통계"); ?> </span></h2> <dl class="data-inbox"> <dt class="number"><span class="text"><?php echo _t("전체 구독자수"); ?> </span></dt> <dd class="number"><span class="text"><?php echo _f("%1 명", $totalSubscribers); ?> </span></dd> <dt class="aggregator"><span class="text"><?php echo _t("구독기"); ?> </span></dt> <dd class="aggregator"><span class="text"><?php echo _f("%1 종류의 구독기 및 크롤러가 구독중입니다.", sizeof($aggregatorInfo)); ?> </span></dd> <dt class="lastRSSupdate"><span class="text"><?php echo _t("최종 RSS 갱신일"); ?> </span></dt> <dd class="lastRSSupdate"><span class="text"><?php echo Setting::getBlogSetting('LatestRSSrefresh', null) !== null ? Timestamp::format5(Setting::getBlogSetting('LatestRSSrefresh', null)) : _t('정보가 갱신되지 않았습니다'); ?> </span></dd> <dt class="updatedAggregators"><span class="text"><?php echo _t("이후 갱신된 RSS 구독기"); ?> </span></dt> <dd class="updatedAggregators"><span class="text"><?php echo $updatedSubscribers; ?> </span></dd> </dl> </div> <hr class="hidden" /> <div id="part-statistics-rank" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t("피드 구독 순위"); ?> </span></h2> <div class="main-explain-box"> <p class="explain"> <?php echo _t("크롤러에 구독자 수 정보를 넣지 않는 웹 RSS 리더의 경우 정상적인 구독자수를 판별할 수 없습니다."); ?> <br /> <?php echo _t("강조 표시된 구독기는 검색 엔진 및 메타 프로그램을 의미합니다."); ?> </p> </div> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th class="rank"><span class="text"><?php echo _t("순위"); ?> </span></th> <th class="aggregator"><span class="text"><?php echo _t("구독기"); ?> </span></th> <th class="count"><span class="text"><?php echo _t("구독자 수"); ?> </span></th> <th class="subscribed"><span class="text"><?php echo _t("구독 시작일"); ?> </span></th> <th class="referred"><span class="text"><?php echo _t("최근 구독일"); ?> </span></th> </tr> </thead> <tbody> <?php $i = 0; foreach ($aggregatorInfo as $agent => $info) { $className = $i % 2 == 1 ? 'even-line' : 'odd-line'; $className .= $i == sizeof($aggregatorInfo) - 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="aggregator"><?php if ($info['isRobot']) { echo '<span class="robot">' . $agent . '</span>'; } else { echo $agent; } ?> </td> <td class="count"><?php echo $info["subscribers"]; ?> 명</td> <td class="subscribed"><?php echo Timestamp::formatDate($info["subscribed"]); ?> </td> <td class="referred"><?php echo Timestamp::formatDate($info["referred"]); ?> </td> </tr> <?php $i++; } ?> </tbody> </table> </div> <div class="clear"></div> <?php }
function getRefererKeywordStatistics() { $more = false; $refereres = getRefererLogsDB(); $keywordlist = array(); $record = array(); for ($i = 0; $i < sizeof($refereres); $i++) { $record = $refereres[$i]; if ($i == 0) { $referredend = $record['referred']; } $keyword = ""; if (preg_match('/\\W(q|query|k|keyword|search|stext|nlia|aqa|wd)(?:=|%3D)([^&]+)/i', $record['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[2])); } else { if (strpos($record['url'], 'yahoo.') !== false && preg_match('/\\Wp=([^&]+)/i', $record['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[1])); } else { if (preg_match('@/search/(?:\\w+/)*([^/?]+)@i', $record['url'], $matches)) { $keyword = urldecode(rawurldecode($matches[1])); } } } if (!UTF8::validate($keyword)) { $keyword = UTF8::correct(UTF8::bring($keyword)); } if (array_key_exists($keyword, $keywordlist)) { $keywordlist[$keyword]++; } elseif ($keyword) { $keywordlist[$keyword] = 1; } } $referredstart = array_key_exists('referred', $record) ? $record['referred'] : ''; $keywordlist = RefererKeywordArraySort($keywordlist, 'desc'); $keywordkeys = array_keys($keywordlist); $beforekeywordvalue = ''; $rank = 0; $keywordArray = array(); for ($i = 0; $i < sizeof($keywordlist); $i++) { $keywordkey = $keywordkeys[$i]; $keywordvalue = $keywordlist[$keywordkey]; $keywordkey = str_replace("\"", """, $keywordkeys[$i]); if ($keywordvalue != $beforekeywordvalue) { $rank++; $beforekeywordvalue = $keywordvalue; } array_push($keywordArray, array('keyword' => $keywordkey, 'count' => $keywordvalue, 'total' => count($keywordlist), 'rank' => $rank, 'dateStart' => Timestamp::formatDate($referredstart), 'dateEnd' => Timestamp::formatDate($referredend))); } return $keywordArray; }