function getEntriesByKeyword($blogid, $keyword) { global $database; $keyword = POD::escapeString($keyword); $visibility = doesHaveOwnership() ? '' : 'AND visibility > 1'; return POD::queryAll("SELECT id, userid, title, category, comments, published \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = {$blogid} \n\t\t\t\tAND draft = 0 {$visibility} \n\t\t\t\tAND category >= 0 \n\t\t\t\tAND (title LIKE '%{$keyword}%' OR content LIKE '%{$keyword}%')\n\t\t\tORDER BY published DESC"); }
function getTrackbackTrash($entry) { global $database; $trackbacks = array(); $result = POD::queryAll("SELECT * \n\t\t\tFROM {$database['prefix']}RemoteResponses \n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\t\tAND entry = {$entry} \n\t\t\tORDER BY written", 'assoc'); if (!empty($result)) { return $result; } else { return array(); } }
function suggestLocatives($blogid, $filter) { global $database; $locatives = array(); $result = POD::queryAll('SELECT DISTINCT location, COUNT(*) cnt FROM ' . $database['prefix'] . 'Entries WHERE blogid = ' . $blogid . ' AND location LIKE "' . POD::escapeString($filter) . '%" GROUP BY location ORDER BY cnt DESC LIMIT 10'); if ($result) { foreach ($result as $locative) { $locatives[] = $locative[0]; } } return $locatives; }
function ViewCounterList($target) { global $database, $blogid, $blogURL, $skinSetting; $result = POD::queryAll("SELECT b.id, b.title, a.readcounts FROM {$database['prefix']}EntryReadCount a INNER JOIN {$database['prefix']}Entries b ON a.blogid = b.blogid AND a.id = b.id WHERE a.blogid={$blogid} AND b.visibility >= 2 AND b.draft = 0 AND b.category >=0 ORDER BY a.readcounts DESC LIMIT 0,5"); $target = "<ul>"; foreach ((array) $result as $row) { $articleid = $row['id']; $articletitle = htmlspecialchars(UTF8::lessenAsEm($row['title'], $skinSetting['recentEntryLength'])); $readcounts = $row['readcounts']; $rsurl = "{$blogURL}/{$articleid}"; $target .= "<li><a href=\"{$rsurl}\">{$articletitle}</a> <span class=\"cnt\">({$readcounts})</span></li>\n"; } $target .= "</ul>"; return $target; }
"; //]]> </script> </head> <body> <?php echo str_repeat('<!-- flush buffer -->', 400); ?> <script type="text/javascript"> //<![CDATA[ var progress = parent.document.getElementById("progress"); progress.innerHTML = "(0%)"; //]]> </script> <?php $feeds = POD::queryAll("SELECT f.*\n\t\tFROM {$database['prefix']}Feeds f,\n\t\t\t{$database['prefix']}FeedGroups g,\n\t\t\t{$database['prefix']}FeedGroupRelations gr\n\t\tWHERE g.blogid = {$blogid}\n\t\t\tAND gr.feed = f.id\n\t\t\tAND gr.blogid = g.blogid\n\t\t\tAND gr.groupid = g.id\n\t\tORDER BY f.title"); $count = 0; foreach ($feeds as $feed) { ?> <script type="text/javascript"> //<![CDATA[ var icon = parent.document.getElementById("iconFeedStatus<?php echo $feed['id']; ?> "); if(icon) { try{ parent.Reader.startScroll("feedBox", getOffsetTop(icon) - getOffsetTop(parent.document.getElementById("feedBox")) - 50); } catch(e) {alert(e.message);} icon.src = servicePath + "/resources/style/default/image/reader/iconUpdateIng.gif"; }
function getTagsWithEntryId($blogid, $entry) { global $database; $tags = array(); foreach (POD::queryAll("SELECT DISTINCT name FROM {$database['prefix']}Tags, {$database['prefix']}TagRelations WHERE id = tag AND blogid = {$blogid} AND entry = {$entry['id']} ORDER BY name") as $tag) { array_push($tags, $tag['name']); } return $tags; }
function PN_Blog_Statistics_Default() { global $database, $blogid, $defaultURL, $blogURL, $pluginURL, $pluginMenuURL, $configVal; requireComponent('Textcube.Model.Statistics'); requireComponent('Textcube.Function.misc'); $data = misc::fetchConfigVal($configVal); if (is_null($data)) { $data['privateChk'] = 2; } $getVisibility = $data['privateChk'] == 2 ? " AND visibility > 0 " : ""; $stats = Statistics::getStatistics($blogid); $getDate = isset($_GET['date']) ? $_GET['date'] : date('Y', strtotime("now")); $getMenu = isset($_GET['menu']) ? $_GET['menu'] : "entry"; $getYear = substr($getDate, 0, 4); $getMonth = substr($getDate, 4); $yearRow = POD::queryAll("SELECT EXTRACT(YEAR FROM FROM_UNIXTIME(published)) period, COUNT(*) count FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0 GROUP BY period ORDER BY period DESC"); $yearCell = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0 AND EXTRACT(YEAR FROM FROM_UNIXTIME(published)) = '" . date('Y', strtotime("now")) . "'"); $yearAll = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category >= 0"); $yearSelect = "<select id=\"yearSelect\" onchange=\"execDate(this);\">\n"; $yearSelect .= "<option value=\"\">" . _t(' - 년 도 -') . "</option>\n"; $selected = $getYear == 9999 ? " selected" : ""; $yearSelect .= "<option value=\"9999\" style=\"font-weight:bold;\" {$selected}>" . _t('#전체') . "({$yearAll})</option>\n"; if (!$yearCell) { $selected = $getYear == date('Y', strtotime("now")) ? " selected" : ""; $yearSelect .= "<option value=\"" . date('Y', strtotime("now")) . "\" {$selected}>" . date('Y', strtotime("now")) . _t('년') . "(0)</option>\n"; } foreach ($yearRow as $items) { $selected = $getYear == $items['period'] ? " selected" : ""; $yearSelect .= "<option value=\"{$items['period']}\" {$selected}>{$items['period']}" . _t('년') . "({$items['count']})</option>\n"; } $yearSelect .= "</select>\n"; $monthSelect = "<select id=\"monthSelect\" onchange=\"execDate(this);\">\n"; $monthSelect .= "<option value=\"\">- " . _t('월') . " -</option>\n"; $monthSelect .= "<option value=\"{$getYear}\" " . (strlen($getDate) == 4 ? " selected" : "") . ">" . _t('#전체') . "</option>\n"; for ($i = 1; $i <= 12; $i++) { $gMonth = strlen($i) == 1 ? "0" . $i : $i; $gValue = $getYear . $gMonth; $selected = $getMonth == $gMonth ? " selected" : ""; $monthSelect .= "<option value=\"{$gValue}\" {$selected}>" . $gMonth . _t('월') . "</option>\n"; } $monthSelect .= "</select>\n"; $noticeRow = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category = -2"); //공지 $keywordRow = POD::queryCell("SELECT COUNT(*) FROM {$database['prefix']}Entries WHERE blogid = {$blogid} AND draft = 0 {$getVisibility} AND category = -1"); //키워드 ?> <script type="text/javascript"> //<![CDATA[ function execLoadFunction() { tempDiv = document.createElement("DIV"); tempDiv.style.clear = "both"; document.getElementById("part-statistics-blog").appendChild(tempDiv); } function execDate(selectObject){ if(selectObject.options[selectObject.selectedIndex].value){ location.href="<?php echo $pluginMenuURL; ?> &date="+selectObject.options[selectObject.selectedIndex].value+"&menu=<?php echo $getMenu; ?> "; } } window.addEventListener("load", execLoadFunction, false); //]]> </script> <div id="part-statistics-blog" class="part"> <h2 class="caption"><span class="main-text"><?php echo _t('블로그 통계정보를 보여줍니다'); ?> </span></h2> <div id="statistics-main"> <div id="statistics-counter-inbox"> <div class="title"><h3><?php echo _t('종 합 정 보'); ?> </h3></div> <table width="100%"> <tbody> <tr class="tr"> <td colspan="2"><?php echo _t('년/월별 선택'); ?> <br /> <?php echo $yearSelect; ?> <?php echo $monthSelect; ?> </td> </tr> <tr height="5"><td colspan="2"></td></tr> <tr height="1" bgcolor="#dddddd"><td colspan="2"></td></tr> <tr class="tr"> <td><?php echo _t('오늘 방문자'); ?> </td> <th><?php echo number_format($stats['today']); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('어제 방문자'); ?> </td> <th><?php echo number_format($stats['yesterday']); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('총 방문자'); ?> </td> <th><?php echo number_format($stats['total']); ?> </th> </tr> <tr height="1" bgcolor="#dddddd"><td colspan="2"></td></tr> <tr class="tr"> <td><?php echo _t('글 개수'); ?> </td> <th><?php echo number_format(getEntriesTotalCountDB($blogid)); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('공지 개수'); ?> </td> <th><?php echo number_format($noticeRow); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('키워드 개수'); ?> </td> <th><?php echo number_format($keywordRow); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('댓글 개수'); ?> </td> <th><?php echo number_format(getCommentCountDB($blogid)); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('방명록 개수'); ?> </td> <th><?php echo number_format(getGuestbookCountDB($blogid)); ?> </th> </tr> <tr class="tr"> <td><?php echo _t('트랙백 개수'); ?> </td> <th><?php echo number_format(getTrackbackCountDB($blogid)); ?> </th> </tr> <tr height="10"><td colspan="2"></td></tr> </tbody> </table> <div class="title"><h3><?php echo _t('세 부 메 뉴'); ?> </h3></div> <table width="100%"> <tbody> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=entry"><?php echo _get_t(_t('글(포스트) 통계'), 'entry'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=comment"><?php echo _get_t(_t('댓글 통계'), 'comment'); ?> </a></td> </tr> <tr class="tr"> <td> - <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=commenter"><?php echo _get_t(_t('작성자 목록'), 'commenter'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=trackback"><?php echo _get_t(_t('트랙백 통계'), 'trackback'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=guestbook"><?php echo _get_t(_t('방명록 통계'), 'guestbook'); ?> </a></td> </tr> <tr class="tr"> <td> - <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=guestbookcommenter"><?php echo _get_t(_t('작성자 목록'), 'guestbookcommenter'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=tag"><?php echo _get_t(_t('태그 통계'), 'tag'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=visit"><?php echo _get_t(_t('방문자 통계'), 'visit'); ?> </a></td> </tr> <tr class="tr"> <td> » <a href="<?php echo $pluginMenuURL; ?> &date=<?php echo $getDate; ?> &menu=referer"><?php echo _get_t(_t('리퍼러 통계'), 'referer'); ?> </a></td> </tr> </tbody> </table> </div> <div id="statistics-inbox"> <?php //############################## // 글(포스트) 통계 ######### //############################## if ($getMenu == "entry") { if ($getYear == 9999 && !$getMonth) { $getData = array(); $getTags = array(); $getDateTitle = _t('전체 년도별'); $tempData = getStatisticsDB('years', '', $getMenu); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['period'] . _t('년'))); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 1); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> YearStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> YearPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=archiveYear&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } if (!$getMonth) { $lastCount = 12; $textValue = _t('월'); } else { $lastCount = $getYear == 9999 ? 31 : date('t', mktime(0, 0, 0, $getMonth, 1, $getYear)); $textValue = ""; } for ($i = 1; $i <= $lastCount; $i++) { $tempData = getStatisticsDB($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData['count']); array_push($getTags, rawurlencode($i . $textValue)); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 1); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> Stic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td align="right"> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> Pizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=archiveMonth&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php if (!$getMonth) { $getData = array(); $getTags = array(); for ($i = 1; $i <= 4; $i++) { $tempData = getQuartersStatistics($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData); array_push($getTags, rawurlencode($i . "/4 " . _t('분기'))); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('분기별') . _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> QuartersStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> QuartersPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); $tempData = getCategoryStatistics(); $itemCnt = getCategoryStatisticsTotal(0, $getDate); if ($itemCnt) { array_push($getData, $itemCnt); array_push($getTags, $item['id']); } foreach ($tempData as $item) { $itemCnt = getCategoryStatisticsTotal($item['id'], $getDate); if ($itemCnt) { array_push($getData, $itemCnt); array_push($getTags, $item['id']); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('카테고리별') . _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> CategoryStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=category&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> CategoryPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=category&grpYear=" . $getYear . "&grpTypeName=category&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $query = "SELECT * FROM {$database['prefix']}Entries_hits"; if (POD::queryRow($query)) { $getData = array(); $getTags = array(); $tempData = getEntryHitsStatistics($getDate); foreach ($tempData as $item) { array_push($getData, $item['hits']); array_push($getTags, $item['id']); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('조회수 TOP 10') . _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> HitsStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=hits&grpXLabelType=2&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> HitsPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=entry&grpYear=" . $getYear . "&grpTypeName=hits&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); for ($i = 0; $i <= 23; $i++) { $tempData = getTimeStatistics($getDate, $i, $getMenu); if ($tempData) { if ($tempData['period'] == "00") { $tempData['period'] = str_replace("00", "0", $tempData['period']); } else { if (substr($tempData['period'], 0, 1) == "0") { $tempData['period'] = str_replace("0", "", $tempData['period']); } } array_push($getData, $tempData['count']); array_push($getTags, $tempData['period']); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('시간대별') . _t('글(포스트) 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> TimeStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> TimePizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "comment") { //############################## // 댓글 통계 ################### //############################## if ($getYear == 9999 && !$getMonth) { $getData = array(); $getTags = array(); $getDateTitle = _t('전체 년도별'); $tempData = getStatisticsDB('years', '', $getMenu); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['period'] . _t('년'))); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('댓글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> YearStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> YearPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } if (!$getMonth) { $lastCount = 12; $textValue = _t('월'); } else { $lastCount = $getYear == 9999 ? 31 : date('t', mktime(0, 0, 0, $getMonth, 1, $getYear)); $textValue = ""; } for ($i = 1; $i <= $lastCount; $i++) { $tempData = getStatisticsDB($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData['count']); array_push($getTags, rawurlencode($i . $textValue)); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('댓글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> Stic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> Pizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php if (!$getMonth) { $getData = array(); $getTags = array(); for ($i = 1; $i <= 4; $i++) { $tempData = getQuartersStatistics($getYear, $i, $getMenu); if ($tempData) { array_push($getData, $tempData); array_push($getTags, rawurlencode($i . "/4 " . _t('분기'))); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('분기별') . _t('댓글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> QuartersStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> QuartersPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); $tempData = getCommentEntryMaxCount($getDate); foreach ($tempData as $item) { array_push($getData, $item['comments']); array_push($getTags, $item['id']); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('댓글 TOP 10') . _t('글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> EntryMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=cmmax&grpXLabelType=2&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> EntryMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=entry&grpYear=" . $getYear . "&grpTypeName=cmmax&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); $tempData = getCommenterMaxCount($getDate, $getMenu); foreach ($tempData as $item) { array_push($getData, $item['namecnt']); array_push($getTags, rawurlencode($item['name'])); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('댓글자 TOP 10') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> erMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=commenter&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> erMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); for ($i = 0; $i <= 23; $i++) { $tempData = getTimeStatistics($getDate, $i, $getMenu); if ($tempData) { if ($tempData['period'] == "00") { $tempData['period'] = str_replace("00", "0", $tempData['period']); } else { if (substr($tempData['period'], 0, 1) == "0") { $tempData['period'] = str_replace("0", "", $tempData['period']); } } array_push($getData, $tempData['count']); array_push($getTags, $tempData['period']); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('시간대별') . _t('댓글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> TimeStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> TimePizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "commenter") { //############################## // 댓글 작성자 목록 ############ //############################## if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } $tempData = getCommenterMaxCount($getDate, $getMenu); $tempAllCount = getCommenterMaxCount(9999, $getMenu); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('댓글') . _t('작성자') . _t('목록'); ?> (<?php echo number_format(count($tempData)) . "/" . number_format(count($tempAllCount)); echo _t('명'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div id="commenterList"> <?php $i = 0; foreach ($tempData as $item) { $guestname = htmlspecialchars(UTF8::lessenAsEm($item['name'], 20)); if (!empty($item['home'])) { $homepage = ereg('^[[:alnum:]]+:', $item['home']) ? htmlspecialchars($item['home']) : "http://" . htmlspecialchars($item['home']); $guestname = "<a href=\"{$homepage}\" onclick=\"window.open(this.href); return false;\">{$guestname}</a>"; } $count = "<span class=\"count\">(" . $item['namecnt'] . ")</span>"; ?> <div class="userlist"><?php echo $guestname; ?> <?php echo $count; ?> </div><?php if ($i % 4 == 3) { echo "<div class=\"clear\"></div>\n"; } $i++; } ?> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "trackback") { //############################## // 역인글 통계 ################# //############################## if ($getYear == 9999 && !$getMonth) { $getData = array(); $getTags = array(); $getDateTitle = _t('전체 년도별'); $tempData = getStatisticsDB('years', '', $getMenu); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['period'] . _t('년'))); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> 트랙백 통계(<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> YearStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> YearPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } if (!$getMonth) { $lastCount = 12; $textValue = _t('월'); } else { $lastCount = $getYear == 9999 ? 31 : date('t', mktime(0, 0, 0, $getMonth, 1, $getYear)); $textValue = ""; } for ($i = 1; $i <= $lastCount; $i++) { $tempData = getStatisticsDB($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData['count']); array_push($getTags, rawurlencode($i . $textValue)); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('트랙백') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> Stic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> Pizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php if (!$getMonth) { $getData = array(); $getTags = array(); for ($i = 1; $i <= 4; $i++) { $tempData = getQuartersStatistics($getYear, $i, $getMenu); if ($tempData) { array_push($getData, $tempData); array_push($getTags, rawurlencode($i . "/4 " . _t('분기'))); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('분기별') . _t('트랙백') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> QuartersStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> QuartersPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); $getLink = array(); $tempData = getTrackbackEntryMaxCount($getDate); foreach ($tempData as $item) { array_push($getData, $item['trackbacks']); array_push($getTags, $item['id']); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('트랙백') . _t('받은 TOP 10') . _t('글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> EntryMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=tbmax&grpXLabelType=2&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> EntryMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=entry&grpYear=" . $getYear . "&grpTypeName=tbmax&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); $tempData = getTrackbackCallEntryMaxCount($getDate); foreach ($tempData as $item) { array_push($getData, $item['trackbacklogs']); array_push($getTags, $item['id']); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('트랙백') . _t('보낸 TOP 10') . _t('글 통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> CallEntryMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=cmmax&grpXLabelType=2&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> CallEntryMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=entry&grpYear=" . $getYear . "&grpTypeName=cmmax&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); for ($i = 0; $i <= 23; $i++) { $tempData = getTimeStatistics($getDate, $i, $getMenu); if ($tempData) { if ($tempData['period'] == "00") { $tempData['period'] = str_replace("00", "0", $tempData['period']); } else { if (substr($tempData['period'], 0, 1) == "0") { $tempData['period'] = str_replace("0", "", $tempData['period']); } } array_push($getData, $tempData['count']); array_push($getTags, $tempData['period']); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('시간대별') . _t('트랙백') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> TimeStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> TimePizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "guestbook") { //############################## // 방명록 통계 ################# //############################## if ($getYear == 9999 && !$getMonth) { $getData = array(); $getTags = array(); $getDateTitle = _t('전체 년도별'); $tempData = getStatisticsDB('years', '', $getMenu); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['period'] . _t('년'))); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방명록') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> YearStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> YearPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } if (!$getMonth) { $lastCount = 12; $textValue = _t('월'); } else { $lastCount = $getYear == 9999 ? 31 : date('t', mktime(0, 0, 0, $getMonth, 1, $getYear)); $textValue = ""; } for ($i = 1; $i <= $lastCount; $i++) { $tempData = getStatisticsDB($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData['count']); array_push($getTags, rawurlencode($i . $textValue)); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방명록') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> Stic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> Pizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php if (!$getMonth) { $getData = array(); $getTags = array(); for ($i = 1; $i <= 4; $i++) { $tempData = getQuartersStatistics($getYear, $i, $getMenu); if ($tempData) { array_push($getData, $tempData); array_push($getTags, rawurlencode($i . "/4 " . _t('분기'))); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('분기별') . _t('방명록') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> QuartersStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> QuartersPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); $tempData = getCommenterMaxCount($getDate, $getMenu); foreach ($tempData as $item) { array_push($getData, $item['namecnt']); array_push($getTags, rawurlencode($item['name'])); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방명록') . _t('댓글자 TOP 10') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> CommenterMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=commenter&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> CommenterMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); for ($i = 0; $i <= 23; $i++) { $tempData = getTimeStatistics($getDate, $i, $getMenu); if ($tempData) { if ($tempData['period'] == "00") { $tempData['period'] = str_replace("00", "0", $tempData['period']); } else { if (substr($tempData['period'], 0, 1) == "0") { $tempData['period'] = str_replace("0", "", $tempData['period']); } } array_push($getData, $tempData['count']); array_push($getTags, $tempData['period']); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('시간대별') . _t('방명록') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> TimeStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> TimePizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=time&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "guestbookcommenter") { //############################## // 방명록 작성자 목록 ############ //############################## if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } $tempData = getCommenterMaxCount($getDate, $getMenu); $tempAllCount = getCommenterMaxCount(9999, $getMenu); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방명록') . _t('작성자') . _t('목록'); ?> (<?php echo number_format(count($tempData)) . "/" . number_format(count($tempAllCount)); ?> 명)</h3></th> </tr> </thead> <tbody> <tr> <td> <div id="commenterList"> <?php $i = 0; foreach ($tempData as $item) { $guestname = htmlspecialchars(UTF8::lessenAsEm($item['name'], 20)); if (!empty($item['home'])) { $homepage = ereg('^[[:alnum:]]+:', $item['home']) ? htmlspecialchars($item['home']) : "http://" . htmlspecialchars($item['home']); $guestname = "<a href=\"{$homepage}\" onclick=\"window.open(this.href); return false;\">{$guestname}</a>"; } $count = "<span class=\"count\">(" . $item['namecnt'] . ")</span>"; ?> <div class="userlist"><?php echo $guestname; ?> <?php echo $count; ?> </div><?php if ($i % 4 == 3) { echo "<div class=\"clear\"></div>\n"; } $i++; } ?> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "tag") { //############################## // 태그 통계 ################### //############################## $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); $getData = array(); $getTags = array(); $tempData = getTagMaxCount(); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['name'])); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 1); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo _t('인기') . _t('태그 TOP 10') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> MaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=tag&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> MaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=tag&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } $tempData = getTagEntryMaxCount($getDate, 1); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, $item['id']); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('태그') . _t('걸린 TOP 10') . _t('글 통계'); ?> (<?php echo number_format(getTagEntryMaxCount($getDate, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> EntryMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=tagmax&grpXLabelType=2&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> EntryMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=entry&grpYear=" . $getYear . "&grpTypeName=tagmax&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <?php } else { if ($getMenu == "visit") { //############################## // 방문자 통계 ################# //############################## if ($getYear == 9999 && !$getMonth) { $getData = array(); $getTags = array(); $getDateTitle = _t('전체 년도별'); $tempData = getStatisticsDB('years', '', $getMenu); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['period'] . _t('년'))); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방문자') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> YearStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> YearPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } $getData = array(); $getTags = array(); if ($getYear == 9999) { $getDateTitle = !$getMonth ? _t('전체') : _t('전체') . ' ' . $getMonth . _t('월'); } else { $getDateTitle = !$getMonth ? $getYear . _t('년도') : $getYear . _t('년도') . $getMonth . _t('월'); } if (!$getMonth) { $lastCount = 12; $textValue = _t('월'); } else { $lastCount = $getYear == 9999 ? 31 : date('t', mktime(0, 0, 0, $getMonth, 1, $getYear)); $textValue = ""; } for ($i = 1; $i <= $lastCount; $i++) { $tempData = getStatisticsDB($getDate, $i, $getMenu); if ($tempData) { array_push($getData, $tempData['count']); array_push($getTags, rawurlencode($i . $textValue)); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('방문자') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> Stic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> Pizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php if (!$getMonth) { $getData = array(); $getTags = array(); for ($i = 1; $i <= 4; $i++) { $tempData = getQuartersStatistics($getYear, $i, $getMenu); if ($tempData) { array_push($getData, $tempData); array_push($getTags, rawurlencode($i . "/4 " . _t('분기'))); } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 0); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo $getDateTitle; ?> <?php echo _t('분기별') . _t('방문자') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 0)) . "/" . number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> QuartersStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> QuartersPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <hr class="hidden" /> <hr class="hidden" /> <?php } } else { if ($getMenu == "referer") { //############################## // 리퍼러 통계 ################# //############################## $getData = array(); $getTags = array(); $tempData = getRefererMaxCount(); foreach ($tempData as $item) { array_push($getData, $item['count']); array_push($getTags, rawurlencode($item['host'])); } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = getStatisticsTotalDB($getDate, $getMenu, 1); ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo _t('리퍼러') . _t('TOP 10') . _t('통계'); ?> (<?php echo number_format(getStatisticsTotalDB($getDate, $getMenu, 1)); echo _t('개'); ?> )</h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> MaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=refer&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> MaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php $getData = array(); $getTags = array(); $getDuplicate = array(); $beforCount = ""; $tempData = getRefererKeywordStatistics(); foreach ($tempData as $item) { if ($item['count'] != $beforCount) { $beforCount = $item['count']; } else { array_push($getDuplicate, $item['count']); } } $getDuplicate = array_count_values($getDuplicate); $beforCount = ""; foreach ($tempData as $item) { if ($item['count'] != $beforCount && $item['rank'] < 11) { array_push($getData, $item['count']); $duplicateCount = $getDuplicate[$item['count']] ? _f("(외 %1 개)", $getDuplicate[$item['count']]) : _f("(외 %1 개)", 0); array_push($getTags, rawurlencode(htmlspecialchars(UTF8::lessenAsEm($item['keyword'], 15)) . $duplicateCount)); $beforCount = $item['count']; } } $getData = implode("|", $getData); $getTags = implode("|", $getTags); $getTotal = $tempData[0]['total']; ?> <table class="data-inbox" cellspacing="0" cellpadding="0"> <thead> <tr> <th colspan="2"><h3><?php echo _t('리퍼러') . _t('키워드 TOP 10') . _t('통계'); ?> (<?php echo number_format($tempData[0]['total']); echo _t('개'); ?> ) : <?php echo $tempData[0]['dateStart']; ?> ~ <?php echo $tempData[0]['dateEnd']; ?> </h3></th> </tr> </thead> <tbody> <tr> <td> <div class="flash-stic"> <div id="get<?php echo $getMenu; ?> KeywordMaxStic"> <?php echo open_flash_chart_object(470, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=bar&grpTypeName=referkey&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_bar" : "")); ?> </div> </div> </td> <td> <div class="flash-pizza"> <div id="get<?php echo $getMenu; ?> KeywordMaxPizza"> <?php echo open_flash_chart_object(265, 250, $blogURL . "/plugin/BlogStatisticsProcess/?grpStyle=pie&grpLinkType=&grpYear=" . $getYear . "&grpTypeName=&grpData=" . $getData . "&grpTotal=" . $getTotal . "&grpLabel=" . $getTags . (empty($getData) ? "&grpNoData_pie" : "")); ?> </div> </div> </td> </tr> </tbody> </table> <?php } } } } } } } } } ?> </div> </div> </div> <?php }
list($entries, $paging) = getEntriesWithPagingForOwner(getBlogId(), $categoryIdforPrint, $searchKeyword, $suri['page'], $perPage, $visibility, $starred, null, $tag); // query string 생성. $paging['postfix'] = NULL; if ($categoryId != 0) { $paging['postfix'] .= "&category={$categoryId}"; } if (!empty($searchKeyword)) { $paging['postfix'] .= '&search=' . urlencode($searchKeyword); } $tab['postfix'] = $paging['postfix']; if (isset($_POST['visibility'])) { $paging['postfix'] .= '&visibility=' . urlencode($_POST['visibility']); } $teamblog_users = null; if (Acl::check('group.administrators')) { $teamblog_users = POD::queryAll("SELECT u.*, p.acl FROM {$database['prefix']}Users AS u INNER JOIN {$database['prefix']}Privileges AS p ON u.userid = p.userid AND p.blogid = {$blogid} ORDER BY p.acl DESC, name ASC"); } require ROOT . '/interface/common/owner/header.php'; ?> <script type="text/javascript"> //<![CDATA[ <?php printScriptCheckTextcubeVersion(); ?> function setEntryVisibility(entry, visibility) { if ((visibility < 0) || (visibility > 3)) return false; <?php if (Setting::getBlogSettingGlobal('visibility', 2) < 2) { ?> if(visibility == 3) {
function printIphoneTags($blogid, $flag = 'random', $max = 10) { global $database, $skinSetting; $tags = array(); $aux = "limit {$max}"; if ($flag == 'count') { // order by count $tags = POD::queryAll("SELECT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t,\n\t\t\t\t{$database['prefix']}TagRelations r, \n\t\t\t\t{$database['prefix']}Entries e \n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag, name, cnt, t.id\n\t\t\t\tORDER BY cnt DESC {$aux}"); } else { if ($flag == 'name') { // order by name $tags = POD::queryAll("SELECT DISTINCT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t, \n\t\t\t\t{$database['prefix']}TagRelations r,\n\t\t\t\t{$database['prefix']}Entries e \n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag, name, cnt, t.id \n\t\t\t\tORDER BY t.name {$aux}"); } else { // random $tags = POD::queryAll("SELECT name, count(*) AS cnt, t.id FROM {$database['prefix']}Tags t,\n\t\t\t\t{$database['prefix']}TagRelations r,\n\t\t\t\t{$database['prefix']}Entries e\n\t\t\t\tWHERE r.entry = e.id AND e.visibility > 0 AND t.id = r.tag AND r.blogid = {$blogid} \n\t\t\t\tGROUP BY r.tag \n\t\t\t\tORDER BY RAND() {$aux}"); } } return $tags; }
function getEntriesByTagId($blogid, $tagId) { global $database; return POD::queryAll('SELECT e.blogid, e.userid, e.id, e.title, e.comments, e.slogan, e.published FROM ' . $database['prefix'] . 'Entries e LEFT JOIN ' . $database['prefix'] . 'TagRelations t ON e.id = t.entry AND e.blogid = t.blogid WHERE e.blogid = ' . $blogid . ' AND t.tag = ' . $tagId); }
function removeBlog($blogid) { global $database; if (getServiceSetting("defaultBlogId", 1) == $blogid) { return false; } $tags = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}"); $feeds = POD::queryColumn("SELECT DISTINCT feeds FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}"); //Clear Tables POD::execute("DELETE FROM {$database['prefix']}Attachments WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}BlogSettings WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}BlogStatistics WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Categories WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Comments WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}CommentsNotified WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}CommentsNotifiedQueue WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}DailyStatistics WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Entries WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}EntriesArchive WHERE blogid = {$blogid}"); // POD::execute("DELETE FROM {$database['prefix']}FeedGroupRelations WHERE blogid = $blogid"); POD::execute("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}FeedReads WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}FeedStarred WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}FeedSettings WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Filters WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Links WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}LinkCategories WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}PageCacheLog WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Plugins WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}RefererLogs WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}RefererStatistics WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}RemoteResponses WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}RemoteResponseLogs WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}SkinSettings WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}TagRelations WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}Privileges WHERE blogid = {$blogid}"); POD::execute("DELETE FROM {$database['prefix']}XMLRPCPingSettings WHERE blogid = {$blogid}"); //Delete Tags if (count($tags) > 0) { $tagliststr = implode(', ', $tags); // Tag id used at deleted blog. $nottargets = POD::queryColumn("SELECT DISTINCT tag FROM {$database['prefix']}TagRelations WHERE tag in ( {$tagliststr} )"); // Tag id used at other blogs. if (count($nottargets) > 0) { $nottargetstr = implode(', ', $nottargets); POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )"); } else { POD::execute("DELETE FROM {$database['prefix']}Tags WHERE id IN ( {$tagliststr} ) "); } } //Delete Feeds if (count($feeds) > 0) { foreach ($feeds as $feedId) { deleteFeed($blogid, $feedId); } } //Clear Plugin Database // TODO : encapsulate with 'value' $query = "SELECT name, value FROM {$database['prefix']}ServiceSettings WHERE name like 'Database\\_%'"; $plugintablesraw = POD::queryAll($query); foreach ($plugintablesraw as $table) { $dbname = $database['prefix'] . substr($table['name'], 9); POD::execute("DELETE FROM {$database['prefix']}{$dbname} WHERE blogid = {$blogid}"); } //Clear RSS Cache if (file_exists(ROOT . "/cache/rss/{$blogid}.xml")) { unlink(ROOT . "/cache/rss/{$blogid}.xml"); } //Delete Attachments Path::removeFiles(Path::combine(ROOT, 'attach', $blogid)); return true; }
public function getAll($field = '*', $options = null) { $field = $this->_treatReservedFields($field); $options = $this->_treatOptions($options); if ($options['usedbcache'] == true) { $result = POD::queryAllWithDBCache('SELECT ' . $options['filter'] . $field . ' FROM ' . $this->_getTableName() . $this->_extendClause() . $this->_makeWhereClause(), $options['cacheprefix']); } else { $result = POD::queryAll('SELECT ' . $options['filter'] . $field . ' FROM ' . $this->_getTableName() . $this->_extendClause() . $this->_makeWhereClause()); } $this->_manage_pool_stack(); return $result; }
<?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) $IV = array('GET' => array('id' => array('string'), 'input' => array('string', 'default' => ''), 'cursor' => array('number', 'min' => 1))); require ROOT . '/library/preprocessor.php'; requireStrictRoute(); global $database; header('Content-type: text/javascript'); $result = POD::queryAll("SELECT loginid,name FROM `{$database['prefix']}Users` WHERE name LIKE \"%" . $_GET['input'] . "%\" or loginid LIKE \"%" . $_GET['input'] . "%\" LIMIT 5"); if ($result) { echo 'ctlUserSuggestFunction_showSuggestion("' . $_GET['id'] . '","' . $_GET['cursor'] . '",'; echo '"0"'; //TODO : clear foreach ($result as $row) { echo ',"' . $row['loginid'] . " - " . $row['name'] . '"'; } echo ');'; } else { echo 'ctlUserSuggestFunction_showSuggestion("' . $_GET['id'] . '","' . $_GET['cursor'] . '",'; echo '"-1"'; //TODO : clear echo ');'; }
function getSubscriptionLogs() { global $database; $blogid = getBlogId(); return POD::queryAll("SELECT ip, host, useragent, referred FROM {$database['prefix']}SubscriptionLogs WHERE blogid = {$blogid} ORDER BY referred DESC LIMIT 1000"); }
function getRecentGuestbook($blogid, $count = false) { $ctx = Model_Context::getInstance(); $comments = array(); $sql = "SELECT r.*\n\t\tFROM\n\t\t\t" . $ctx->getProperty('database.prefix') . "Comments r\n\t\tWHERE\n\t\t\tr.blogid = {$blogid} AND r.entry = 0 AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $ctx->getProperty('skin.commentsOnRecent')); if ($result = POD::queryAll($sql)) { foreach ($result as $comment) { if ($comment['secret'] == 1 && !doesHaveOwnership()) { if (!doesHaveOpenIDPriv($comment)) { $comment['name'] = ''; $comment['homepage'] = ''; $comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.'); } } array_push($comments, $comment); } } return $comments; }
function defensio_get_all_comments_id($comment_TYPE, $ts = 0) { global $database; $table = $comment_TYPE == 'C' ? "Comments" : "Trackbacks"; $blogid = getBlogId(); $sql = "SELECT c.id FROM {$database['prefix']}{$table} c LEFT JOIN {$database['prefix']}defensio d\n\t\tON c.blogid = d.blog_ID and c.id = d.comment_ID WHERE d.blog_ID = '{$blogid}' and d.comment_TYPE = '{$comment_TYPE}' and c.isFiltered > 0"; if ($ts) { $sql .= " c.written < {$ts}"; } $r = POD::queryAll($sql); $id = array(); foreach ($r as $i) { $id[] = $i['id']; } return $id; }
function getCategoryFeedByCategoryId($blogid, $categoryIds, $mode = 'rss', $categoryTitle = null) { global $database, $serviceURL, $defaultURL, $blog, $service; $channel = array(); $channel = initializeRSSchannel($blogid); $entries = POD::queryAll("SELECT \n\t\t\te.*, \n\t\t\tc.name AS categoryName, \n\t\t\tu.name AS author,\n\t\t\tu.loginid AS email\n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c\n\t\t\tON e.blogid = c.blogid AND e.category = c.id\n\t\tLEFT JOIN {$database['prefix']}Users u\n\t\t\tON e.userid = u.userid\n\t\tWHERE e.blogid = {$blogid} AND e.draft = 0 AND e.visibility >= " . ($blog['publishEolinSyncOnRSS'] ? '2' : '3') . " AND e.category IN (" . implode(',', $categoryIds) . ")\n\t\tORDER BY e.published \n\t\tDESC LIMIT {$blog['entriesOnRSS']}"); if (!$entries) { $entries = array(); } $channel['items'] = getFeedItemByEntries($entries); if (!is_null($categoryTitle)) { $channel['title'] = RSSMessage($blog['title'] . ': ' . _textf('%1 카테고리 글 목록', htmlspecialchars($categoryTitle))); } $rss = array('channel' => $channel); if ($mode == 'rss') { return publishRSS($blogid, $rss); } else { if ($mode == 'atom') { return publishATOM($blogid, $rss); } } return false; }
private static function DBQuery($mode = 'query', $sql) { switch ($mode) { case 'cell': return POD::queryCell($sql); case 'row': return POD::queryRow($sql); case 'execute': return POD::execute($sql); case 'count': return POD::queryCount($sql); case 'all': return POD::queryAll($sql); case 'query': default: return POD::query($sql); } return null; }
static function fetch($sqlmodel, $page, $count, $url = null, $prefix = '?page=', $countItem = null, $onclick = null) { $context = Model_Context::getInstance(); if ($url === null) { $url = $context->getProperty('uri.folder'); } $paging = array('url' => $url, 'prefix' => $prefix, 'postfix' => '', 'onclick' => $onclick); if (empty($sqlmodel)) { return array(array(), $paging); } if (gettype($sqlmodel) == "object" && get_class($sqlmodel) == "DBModel") { // It's DBModel. $isDBModel = true; } else { // It's SQL $isDBModel = false; } if ($isDBModel) { $order = $sqlmodel->getOrder(); $sqlmodel->unsetOrder(); $paging['total'] = $sqlmodel->getSize(); // get record size $sqlmodel->setOrder($order['attribute'], $order['order']); } else { // It's SQL if (preg_match('/\\s(FROM.*)(ORDER BY.*)$/si', $sqlmodel, $matches)) { $from = $matches[1]; $paging['total'] = POD::queryCell("SELECT COUNT(*) {$from}"); } else { return array(array(), $paging); } } if ($paging['total'] === null) { return array(array(), $paging); } if (empty($count)) { $count = 1; } $paging['pages'] = intval(ceil($paging['total'] / $count)); $paging['page'] = is_numeric($page) ? $page : 1; if ($paging['page'] > $paging['pages']) { $paging['page'] = $paging['pages']; if ($paging['pages'] > 0) { $paging['prev'] = $paging['pages'] - 1; } } if ($paging['page'] > 1) { $paging['prev'] = $paging['page'] - 1; } if ($paging['page'] < $paging['pages']) { $paging['next'] = $paging['page'] + 1; } $offset = ($paging['page'] - 1) * $count; if ($offset < 0) { $offset = 0; } if ($countItem !== null) { $count = $countItem; } if ($isDBModel) { $sqlmodel->setLimit($count, $offset); $result = $sqlmodel->getAll(); // Prevent Object poisoning by lazy evaluation of DBModel recycling. return array($result, $paging); } else { return array(POD::queryAll("{$sqlmodel} LIMIT {$count} OFFSET {$offset}"), $paging); } }
function moveCategory($blogid, $id, $direction) { $ctx = Model_Context::getInstance(); if ($direction == 'up') { $sign = '<'; $arrange = 'DESC'; } else { $sign = '>'; $arrange = 'ASC'; } $myId = $id; $myPriority = ''; $myParent = ''; $parentId = ''; $parentPriority = ''; // $parentParent = ''; $myIsHaveChild = ''; $nextId = ''; // $nextParentId = ''; $nextPriority = ''; $sql = "SELECT\n\t\t\t\t_parent.id AS parentId,\n\t\t\t\t_parent.priority AS parentPriority,\n\t\t\t\t_parent.parent AS parentParent,\n\t\t\t\t_my.priority AS myPriority,\n\t\t\t\t_my.parent AS myParent\n\t\t\tFROM " . $ctx->getProperty('database.prefix') . "Categories AS _my\n\t\t\t\tLEFT JOIN " . $ctx->getProperty('database.prefix') . "Categories AS _parent ON _parent.id = _my.parent\n\t\t\tWHERE _my.id = {$id} AND _my.blogid = {$blogid}"; $row = POD::queryRow($sql); $myParent = is_null($row['myParent']) ? 'NULL' : $row['myParent']; $parentId = is_null($row['parentId']) ? 'NULL' : $row['parentId']; $parentPriority = is_null($row['parentPriority']) ? 'NULL' : $row['parentPriority']; // $parentParent = is_null($row['parentParent']) ? 'NULL' : $row['parentParent']; $myPriority = $row['myPriority']; $sql = "SELECT count(*) FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE parent = {$myId} AND blogid = {$blogid}"; $myIsHaveChild = POD::queryCell($sql) > 0 ? true : false; $aux = $parentId == 'NULL' ? 'parent is null' : "parent = {$parentId}"; $sql = "SELECT id, parent, priority FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE {$aux} AND blogid = {$blogid} AND id != 0 AND priority {$sign} {$myPriority} ORDER BY priority {$arrange} LIMIT 1"; // $canMove = (POD::queryCount($sql) > 0) ? true : false; $row = POD::queryRow($sql); $nextId = is_null($row['id']) ? 'NULL' : $row['id']; // $nextParentId = is_null($row['parent']) ? 'NULL' : $row['parent']; $nextPriority = is_null($row['priority']) ? 'NULL' : $row['priority']; // 이동할 자신이 1 depth 카테고리일 때. if ($myParent == 'NULL') { // 자신이 2 depth를 가지고 있고, 위치를 바꿀 대상 카테고리가 있는 경우. if ($myIsHaveChild && $nextId != 'NULL') { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tpriority = {$myPriority}\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tid = {$nextId} AND blogid = {$blogid}"; POD::query($sql); $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tpriority = {$nextPriority}\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); // 자신이 2 depth를 가지지 않은 1 depth 카테고리이거나, 위치를 바꿀 대상이 없는 경우. } else { // 위치를 바꿀 대상 카테고리에 같은 이름이 존재하는지 판별. $myName = POD::queryCell("SELECT name FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE id = {$myId} AND blogid = {$blogid}"); $overlapCount = POD::queryCell("SELECT count(*) FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE name = '{$myName}' AND parent = {$nextId} AND blogid = {$blogid}"); // 같은 이름이 없으면 이동 시작. if ($overlapCount == 0) { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\tparent = {$nextId}\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); $sql = "SELECT id, priority FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE parent = {$nextId} AND blogid = {$blogid} ORDER BY priority DESC"; $row = POD::queryRow($sql); $nextId = is_null($row['id']) ? 'NULL' : $row['id']; $nextPriority = is_null($row['priority']) ? 'NULL' : $row['priority']; if ($nextId != 'NULL') { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\tpriority = " . max($nextPriority, $myPriority) . "\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tid = {$nextId} AND blogid = {$blogid}"; POD::query($sql); $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\tpriority = " . min($nextPriority, $myPriority) . "\n\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); } // 같은 이름이 있으면. } else { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\tpriority = {$myPriority}\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tid = {$nextId} AND blogid = {$blogid}"; POD::query($sql); $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\tpriority = {$nextPriority}\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); } } // 이동할 자신이 2 depth일 때. } else { // 위치를 바꿀 대상이 1 depth이면. if ($nextId == 'NULL') { $myName = POD::escapeString(POD::queryCell("SELECT name FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE id = {$myId} and blogid = {$blogid}")); $overlapCount = POD::queryCell("SELECT count(*) FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE name = '{$myName}' AND parent IS NULL AND blogid = {$blogid}"); // 1 depth에 같은 이름이 있으면 2 depth로 직접 이동. if ($overlapCount > 0) { $sql = "SELECT id, parent, priority FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE parent IS NULL AND blogid = {$blogid} AND priority {$sign} {$parentPriority} ORDER BY priority {$arrange}"; $result = POD::queryAll($sql); foreach ($result as $row) { $nextId = $row['id']; // $nextParentId = $row['parent']; $nextPriority = $row['priority']; // 위치를 바꿀 대상 카테고리에 같은 이름이 존재하는지 판별. $myName = POD::escapeString(POD::queryCell("SELECT name FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE id = {$myId} AND blogid = {$blogid}")); $overlapCount = POD::queryCell("SELECT count(*) FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE name = '{$myName}' AND parent = {$nextId} AND blogid = {$blogid}"); // 같은 이름이 없으면 이동 시작. if ($overlapCount == 0) { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\t\tparent = {$nextId}\n\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); break; } } // 같은 이름이 없으면 1 depth로 이동. } else { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories SET parent = NULL WHERE id = {$myId} AND blogid = {$blogid}"; POD::query($sql); $sql = "SELECT id, priority FROM " . $ctx->getProperty('database.prefix') . "Categories WHERE parent is null AND blogid = {$blogid} AND priority {$sign} {$parentPriority} ORDER BY priority {$arrange}"; $row = POD::queryRow($sql); $nextId = is_null($row['id']) ? 'NULL' : $row['id']; $nextPriority = is_null($row['priority']) ? 'NULL' : $row['priority']; if ($nextId == 'NULL') { $operator = $direction == 'up' ? '-' : '+'; $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories SET priority = {$parentPriority} {$operator} 1 WHERE id = {$myId} AND blogid = {$blogid}"; POD::query($sql); } else { if ($direction == 'up') { $aux = "SET priority = priority+1 WHERE priority >= {$parentPriority} AND blogid = {$blogid}"; $aux2 = "SET priority = {$parentPriority} WHERE id = {$myId} AND blogid = {$blogid}"; } else { $aux = "SET priority = priority+1 WHERE priority >= {$nextPriority} AND blogid = {$blogid}"; $aux2 = "SET priority = {$nextPriority} WHERE id = {$myId} AND blogid = {$blogid}"; } $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories {$aux}"; POD::query($sql); $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories {$aux2}"; POD::query($sql); } } // 위치를 바꿀 대상이 2 depth이면 위치 교환. } else { $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tpriority = {$myPriority}\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tid = {$nextId} AND blogid = {$blogid}"; POD::query($sql); $sql = "UPDATE " . $ctx->getProperty('database.prefix') . "Categories\n\t\t\t\t\t\tSET\n\t\t\t\t\t\t\tpriority = {$nextPriority}\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tid = {$myId} AND blogid = {$blogid}"; POD::query($sql); } } updateEntriesOfCategory($blogid); CacheControl::flushCategory($id); }
function getRemoteResponseList($blogid, $search, $type = null) { global $database; if (!is_null($type)) { $typeFilter = " AND responsetype = '" . POD::escapeString($type) . "'"; } else { $typeFilter = ''; } $list = array('title' => "{$search}", 'items' => array()); $search = escapeSearchString($search); $authorized = doesHaveOwnership() ? '' : getPrivateCategoryExclusionQuery($blogid); if ($result = POD::queryAll("SELECT t.id, t.entry, t.url, t.site, t.subject, t.excerpt, t.written, e.slogan\n \t\tFROM {$database['prefix']}RemoteResponses t\n\t\tLEFT JOIN {$database['prefix']}Entries e ON t.entry = e.id AND t.blogid = e.blogid AND e.draft = 0\n\t\tWHERE t.blogid = {$blogid}\n\t\t\tAND t.isfiltered = 0\n\t\t\tAND t.entry > 0 {$authorized} {$typeFilter} \n\t\t\tAND (t.excerpt like '%{$search}%' OR t.subject like '%{$search}%')")) { foreach ($result as $response) { array_push($list['items'], $response); } } return $list; }
function suggestLocalTags($blogid, $filter) { global $database; $tags = array(); $result = POD::queryAll("SELECT DISTINCT t.name, count(*) AS cnt \n\t\tFROM {$database['prefix']}Tags t \n\t\tINNER JOIN {$database['prefix']}TagRelations r\n\t\tWHERE t.id = r.tag \n\t\t\tAND r.blogid = {$blogid}\n\t\t\tAND {$filter}\n\t\tGROUP BY tag, t.name\n\t\tORDER BY cnt \n\t\tDESC LIMIT 10"); if ($result) { foreach ($result as $tag) { array_push($tags, $tag[0]); } } return $tags; }
function removeBlog($blogid) { $pool = DBModel::getInstance(); $ctx = Model_Context::getInstance(); if (Setting::getServiceSetting("defaultBlogId", 1, true) == $blogid) { return false; } $targets = array('Attachments', 'BlogSettings', 'BlogStatistics', 'Categories', 'Comments', 'CommentsNotified', 'CommentsNotifiedQueue', 'DailyStatistics', 'Entries', 'EntriesArchive', 'FeedGroups', 'FeedReads', 'FeedStarred', 'FeedSettings', 'Filters', 'Links', 'LinkCategories', 'PageCacheLog', 'Plugins', 'RefererLogs', 'RefererStatistics', 'RemoteResponses', 'RemoteResponseLogs', 'SkinSettings', 'TagRelations', 'Privileges', 'XMLRPCPingSettings'); //Clear Tables foreach ($targets as $t) { $pool->reset($t); $pool->setQualifier('blogid', 'eq', $blogid); $pool->delete(); } //Delete Tags $tags = POD::queryColumn("SELECT DISTINCT tag FROM " . $ctx->getProperty('database.prefix') . "TagRelations WHERE blogid = {$blogid}"); if (count($tags) > 0) { $tagliststr = implode(', ', $tags); // Tag id used at deleted blog. $nottargets = POD::queryColumn("SELECT DISTINCT tag FROM " . $ctx->getProperty('database.prefix') . "TagRelations WHERE tag in ( {$tagliststr} )"); // Tag id used at other blogs. if (count($nottargets) > 0) { $nottargetstr = implode(', ', $nottargets); POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "Tags WHERE id IN ( {$tagliststr} ) AND id NOT IN ( {$nottargetstr} )"); } else { POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "Tags WHERE id IN ( {$tagliststr} ) "); } } //Delete Feeds $feeds = POD::queryColumn("SELECT DISTINCT feeds FROM " . $ctx->getProperty('database.prefix') . "FeedGroupRelations WHERE blogid = {$blogid}"); if (count($feeds) > 0) { foreach ($feeds as $feedId) { deleteFeed($blogid, $feedId); } } //Clear Plugin Database // TODO : encapsulate with 'value' $query = "SELECT name, value FROM " . $ctx->getProperty('database.prefix') . "ServiceSettings WHERE name like 'Database\\_%'"; $plugintablesraw = POD::queryAll($query); foreach ($plugintablesraw as $table) { $dbname = $ctx->getProperty('database.prefix') . substr($table['name'], 9); POD::execute("DELETE FROM " . $ctx->getProperty('database.prefix') . "{$dbname} WHERE blogid = {$blogid}"); } //Clear RSS Cache if (file_exists(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml")) { unlink(__TEXTCUBE_CACHE_DIR__ . "/rss/{$blogid}.xml"); } //Delete Attachments Path::removeFiles(Path::combine(ROOT, 'attach', $blogid)); return true; }
?> </th> <th><?php echo _t('최근 로그인'); ?> </th> <th><?php echo _t('임시 암호'); ?> </th> </tr> </thead> <tbody> <?php $row = 25; $userlist = POD::queryAll("SELECT * FROM `{$database['prefix']}Users` WHERE 1 ORDER BY userid LIMIT " . ($page - 1) * $row . ", " . $row); $usercount = POD::queryCount("SELECT userid FROM `{$database['prefix']}Users` WHERE 1"); $pages = (int) (($usercount - 0.5) / $row) + 1; if ($userlist) { $tempString = ""; foreach ($userlist as $row) { ?> <tr id="table-user-list_<?php echo $row['userid']; ?> "> <td><?php echo $row['userid']; ?> </td> <td><a href="<?php
function deleteUser($blogid = null, $userid, $clean = true) { global $database; if ($blogid == null) { $blogid = getBlogId(); } POD::execute("UPDATE {$database['prefix']}Entries\n\t\t\tSET userid = " . User::getBlogOwner($blogid) . "\n\t\t\tWHERE blogid = " . $blogid . " AND userid = " . $userid); // Delete ACL relation. if (!POD::execute("DELETE FROM {$database['prefix']}Privileges WHERE blogid='{$blogid}' and userid='{$userid}'")) { return false; } // And if there is no blog related to the specific user, delete user. if ($clean && !POD::queryAll("SELECT * FROM {$database['prefix']}Privileges WHERE userid = '{$userid}'")) { User::removePermanent($userid); } return true; }
function getRecentGuestbook($blogid, $count = false) { global $skinSetting, $database; $comments = array(); $sql = "SELECT r.*\n\t\tFROM\n\t\t\t{$database['prefix']}Comments r\n\t\tWHERE\n\t\t\tr.blogid = {$blogid} AND r.entry = 0 AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['commentsOnRecent']); if ($result = POD::queryAll($sql)) { foreach ($result as $comment) { if ($comment['secret'] == 1 && !doesHaveOwnership()) { if (!doesHaveOpenIDPriv($comment)) { $comment['name'] = ''; $comment['homepage'] = ''; $comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.'); } } array_push($comments, $comment); } } return $comments; }
?> </tr> </thead> <tbody> <?php $row = 25; $bloglist = POD::queryColumn("SELECT blogid,name FROM `{$database['prefix']}BlogSettings` WHERE name = 'name' ORDER BY blogid ASC LIMIT " . ($page - 1) * $row . " ,{$row}"); $blogcount = POD::queryCount("SELECT blogid FROM `{$database['prefix']}BlogSettings` WHERE name = 'name'"); $pages = (int) (($blogcount - 0.5) / $row) + 1; if ($pages < $page) { printRespond(array('error' => -2, 'result' => $pages)); } if ($bloglist) { $tempString = ""; foreach ($bloglist as $itemBlogId) { $result = POD::queryAll("SELECT * FROM `{$database['prefix']}BlogSettings` WHERE blogid = {$itemBlogId}"); foreach ($result as $row) { $bsetting[$row['name']] = $row['value']; } $bsetting['owner'] = POD::queryCell("SELECT userid FROM `{$database['prefix']}Privileges` WHERE acl & " . BITWISE_OWNER . " != 0 AND blogid = " . $itemBlogId); ?> <tr id="table-blog-list_<?php echo $itemBlogId; ?> "> <td> <?php echo $itemBlogId; ?> </td> <td>
static function getRefererLogs() { global $database; return POD::queryAll("SELECT host, url, referred FROM {$database['prefix']}RefererLogs WHERE blogid = " . getBlogId() . " ORDER BY referred DESC LIMIT 1500"); }
public function getAll($field = '*') { $field = $this->_treatReservedFields($field); return POD::queryAll('SELECT ' . $field . ' FROM ' . $this->table . $this->_makeWhereClause()); }
function deleteReaderTablesByOwner($blogid) { global $database; POD::query("DELETE FROM {$database['prefix']}FeedGroups WHERE blogid = {$blogid}"); POD::query("DELETE FROM {$database['prefix']}FeedSettings WHERE blogid = {$blogid}"); if ($result = POD::queryAll("SELECT feed FROM {$database['prefix']}FeedGroupRelations WHERE blogid = {$blogid}")) { while (list($feed) = array_shift($result)) { deleteFeed($blogid, $feed); } } return 0; }