Example #1
0
/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_IPHONE__', true);
require ROOT . '/library/preprocessor.php';
requireView('iphoneView');
$context = Model_Context::getInstance();
printMobileHTMLHeader();
if (empty($suri['id']) && empty($suri['value'])) {
    printMobileHTMLMenu('', 'list');
    $blog['entriesOnList'] = 8;
    if (!($listWithPaging = getEntriesWithPaging($blogid, $suri['page'], $blog['entriesOnList']))) {
        $listWithPaging = array(array(), array('total' => 0));
    }
    $list = array('title' => empty($suri['value']) ? getCategoryLabelById($blogid, 0) : $suri['value'], 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
    $paging = $listWithPaging[1];
    print printMobileEntryListView($list['items'], 'blog_posts_' . $suri['page'], _text('글목록'), $paging, $list['count']);
    print printMobileListNavigation($paging, 'entry');
} else {
    if (!empty($suri['id'])) {
        list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']);
    } else {
        if (!empty($suri['value'])) {
            $entryPrint = true;
            list($entries, $paging) = getEntryWithPagingBySlogan($blogid, $suri['value']);
            //	printMobileHTMLHeader();
        }
    }
    printMobileHTMLMenu('', 'list');
    $entry = $entries ? $entries[0] : null;
Example #2
0
function PN_BlogStatisticsProcess($target)
{
    global $blogid, $pluginURL, $defaultURL, $blog;
    if (doesHaveOwnership()) {
        include_once 'lib/open-flash-chart.php';
        $grpStyle = $_GET['grpStyle'];
        $grpData = explode("|", $_GET['grpData']);
        $grpTotal = $_GET['grpTotal'];
        $grpYear = $_GET['grpYear'];
        $grpTypeName = $_GET['grpTypeName'];
        $grpLinkType = $_GET['grpLinkType'];
        $grpXLabelType = isset($_GET['grpXLabelType']) ? $_GET['grpXLabelType'] : 0;
        $grpLabel = explode("|", $_GET['grpLabel']);
        $grpSubTitle = array();
        $grpLabelTemp = array();
        if (!empty($_GET['grpData'])) {
            if ($grpTypeName == "category") {
                for ($i = 0; $i < count($grpLabel); $i++) {
                    $grpSubTitle[] = rawurlencode($grpLabel[$i] == 0 ? _t('분류없음') : htmlspecialchars(UTF8::lessenAsEm(getCategoryNameById($blogid, $grpLabel[$i]), 15)));
                }
            } else {
                if ($grpTypeName == "hits" || $grpTypeName == "cmmax" || $grpTypeName == "tbmax" || $grpTypeName == "tagmax") {
                    for ($i = 0; $i < count($grpLabel); $i++) {
                        $grpSubTitle[] = rawurlencode(htmlspecialchars(UTF8::lessenAsEm(str_replace(",", "-", getEntryTitleById($blogid, $grpLabel[$i])), 25)));
                    }
                } else {
                    if ($grpTypeName == "commenter" || $grpTypeName == "tag") {
                        for ($i = 0; $i < count($grpLabel); $i++) {
                            $grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15));
                            $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 6, ''));
                        }
                        $grpLabel = $grpLabelTemp;
                    } else {
                        if ($grpTypeName == "time") {
                            for ($i = 0; $i < count($grpLabel); $i++) {
                                $grpSubTitle[] = rawurlencode($grpLabel[$i] . "시");
                            }
                        } else {
                            if ($grpTypeName == "refer") {
                                for ($i = 0; $i < count($grpLabel); $i++) {
                                    $tmpHost = explode('.', $grpLabel[$i]);
                                    $tmpHostCnt = count($tmpHost) - 1;
                                    $tmpDomain = (strlen($tmpHost[$tmpHostCnt]) < 3 ? $tmpHost[$tmpHostCnt - 2] . '.' : '') . $tmpHost[$tmpHostCnt - 1] . '.' . $tmpHost[$tmpHostCnt];
                                    $cutDomain = explode('.', $tmpDomain);
                                    $grpSubTitle[] = htmlspecialchars($grpLabel[$i]);
                                    $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($cutDomain[0], 6, ''));
                                }
                                $grpLabel = $grpLabelTemp;
                            } else {
                                if ($grpTypeName == "referkey") {
                                    for ($i = 0; $i < count($grpLabel); $i++) {
                                        $tmpLabel = explode('(', $grpLabel[$i]);
                                        $grpSubTitle[] = htmlspecialchars(UTF8::lessenAsEm($grpLabel[$i], 15));
                                        $grpLabelTemp[] = htmlspecialchars(UTF8::lessenAsEm($tmpLabel[0], 6, ''));
                                    }
                                    $grpLabel = $grpLabelTemp;
                                }
                            }
                        }
                    }
                }
            }
            $g = new graph();
            $g->bg_colour = '#FFFFFF';
            if ($grpStyle == "pie") {
                $grpClickLink = "";
                $grpPercent = array();
                $grpLink = array();
                for ($i = 0; $i < count($grpData); $i++) {
                    $grpPercent[] = round($grpData[$i] / $grpTotal * 100, 0);
                }
                if ($grpLinkType == "archiveYear") {
                    for ($i = 0; $i < count($grpLabel); $i++) {
                        $permalink = $defaultURL . "/archive/" . substr($grpLabel[$i], 0, 4);
                        $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                    }
                    $grpClickLink = "<br>click on the pie.";
                } else {
                    if ($grpLinkType == "archiveMonth" && $grpYear != "9999") {
                        for ($i = 0; $i < count($grpLabel); $i++) {
                            $cutMonth = str_replace("월", "", $grpLabel[$i]);
                            $tmpMonth = strlen($cutMonth) == 1 ? "0" . $cutMonth : $cutMonth;
                            $permalink = $defaultURL . "/archive/" . $grpYear . $tmpMonth;
                            $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                        }
                        $grpClickLink = "<br>click on the pie.";
                    } else {
                        if ($grpLinkType == "category") {
                            for ($i = 0; $i < count($grpLabel); $i++) {
                                $permalink = $defaultURL . "/category/" . getCategoryLabelById($blogid, $grpLabel[$i]);
                                $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                            }
                            $grpClickLink = "<br>click on the pie.";
                        } else {
                            if ($grpLinkType == "entry") {
                                for ($i = 0; $i < count($grpLabel); $i++) {
                                    $permalink = $defaultURL . ($blog['useSlogan'] ? "/entry/" . getEntrySloganById($blogid, $grpLabel[$i]) : "/" . $grpLabel[$i]);
                                    $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                                }
                                $grpClickLink = "<br>click on the pie.";
                            } else {
                                if ($grpLinkType == "tag") {
                                    for ($i = 0; $i < count($grpLabel); $i++) {
                                        $permalink = $defaultURL . "/tag/" . $grpLabel[$i];
                                        $grpLink[] = "javascript:window.open('{$permalink}');void(0)";
                                    }
                                    $grpClickLink = "<br>click on the pie.";
                                }
                            }
                        }
                    }
                }
                $g->pie(75, '#ffffff', '#000000', false, 1);
                $g->pie_values($grpData, $grpLabel, $grpLink, $grpSubTitle);
                $g->pie_slice_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D'));
                $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#(#percent#%25)' . $grpClickLink);
            } else {
                if ($grpStyle == "bar") {
                    $g->title('&nbsp;', '{font-size:12px; color:#000000;margin-top:0px;padding:3px;}');
                    $g->set_data($grpData);
                    $g->set_bar_titles($grpSubTitle);
                    $g->bar_glass(70, '#68B1D9', '#62A0C1', '', 12);
                    $g->bar_colours(array('#B9D2E6', '#E2B11C', '#A3CF22', '#EC7122', '#4FC0C0', '#D45E5E', '#A275A2', '#52A7D2', '#9F373B', '#B4ADA5', '#5FC97E', '#CFB85D', '#9DC64E', '#FFAB29', '#E23838', '#43CEA9', '#4CA9D9', '#BA4ECA', '#6C79DA', '#CCCCCC', '#AB5C06', '#C06868', '#5FC97E', 'CFB85D'));
                    $g->x_axis_colour('#909090', '#D2D2FB');
                    $g->y_axis_colour('#909090', '#D2D2FB');
                    $g->set_x_labels($grpLabel);
                    $g->set_x_label_style(10, '#000000', $grpXLabelType, -1);
                    $g->set_y_label_style(9, '#888888');
                    $tmp_data_max = floor(Max($grpData) * 1.2);
                    if ($tmp_y_max = $tmp_data_max % 10) {
                        $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max);
                    }
                    $g->set_y_max($tmp_data_max);
                    $g->set_y_legend('', 11, '#736AFF');
                    $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#');
                } else {
                    if ($grpStyle == "line") {
                        $g->title('', '{font-size:1px; color:#000000;}');
                        $g->set_data($grpData);
                        $g->line_dot(2, 4, '#6FBBC6', _t('최근 7일간 방문자 수'), 11);
                        // <-- 3px thick + dots
                        $g->set_x_labels($grpLabel);
                        $g->set_x_label_style(8, '#333333', $grpXLabelType, -1);
                        $g->x_axis_colour('#909090', '#e7e7e7');
                        $g->y_axis_colour('#909090', '#e7e7e7');
                        $tmp_data_max = floor(Max($grpData) * 1.2);
                        if ($tmp_y_max = $tmp_data_max % 10) {
                            $tmp_data_max = $tmp_data_max + (10 - $tmp_y_max);
                        }
                        $g->set_y_max($tmp_data_max);
                        $g->set_y_legend('', 1, '#736AFF');
                        $g->y_label_steps(4);
                        $g->set_y_label_style(8, '#333333', $grpXLabelType, -1);
                        $g->set_tool_tip((count($grpSubTitle) ? '#x_title#<br>' : '#x_label#<br>') . '#val#');
                    }
                }
            }
            echo $g->render();
            flush();
        }
    }
}
Example #3
0
<?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)
require ROOT . '/library/preprocessor.php';
requireModel('blog.entry');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
define('__TEXTCUBE_NO_ENTRY_CACHE__', true);
$entries = array();
if (is_null($entry = getEntry($blogid, $suri['id'], true))) {
    $entry = getEntry($blogid, $suri['id'], false);
}
if (!is_null($entry)) {
    if (isset($entry['appointed'])) {
        $entry['published'] = $entry['appointed'];
    }
    if (isset($entry['category']) && $entry['category'] >= 0) {
        $entry['categoryLabel'] = getCategoryLabelById($blogid, $entry['category']);
    }
    $entries[0] = $entry;
}
unset($entry);
require ROOT . '/interface/common/blog/begin.php';
require ROOT . '/interface/common/blog/entries.php';
$pageTitle = _t('미리보기') . ' - ' . $pageTitle;
require ROOT . '/interface/common/blog/end.php';