当前位置: 首页>>代码示例>>PHP>>正文


PHP Statistics::getStatistics方法代码示例

本文整理汇总了PHP中Statistics::getStatistics方法的典型用法代码示例。如果您正苦于以下问题:PHP Statistics::getStatistics方法的具体用法?PHP Statistics::getStatistics怎么用?PHP Statistics::getStatistics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Statistics的用法示例。


在下文中一共展示了Statistics::getStatistics方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 public function show($statType = null)
 {
     $this->view->title = 'Перегляд статистики';
     if ($statType == null) {
         $this->view->countByDay = $this->model->getCountByDay();
         $this->view->getCountMainPageUpdate = $this->model->getCountMainPageUpdate();
         $this->view->data = Statistics::getStatistics();
     } else {
         $this->view->countByDay = $this->model->getCountByDay();
         $this->view->getCountMainPageUpdate = $this->model->getCountMainPageUpdate();
         $this->view->data = Statistics::getStatistics($statType);
     }
     $this->view->render('statistics/show');
 }
开发者ID:olehpitsun,项目名称:duplom.comv2.2.1,代码行数:14,代码来源:statisticsController.php

示例2: viewUncached

 /**
  * Return a freshly built block.
  *
  * By default, stats are computed for the preceding month. See how to swap
  * the default interpretation by changing which block is commented out.
  *
  * @return array
  *   A subject/content hash.
  */
 public function viewUncached()
 {
     $count = $this->getCount();
     $display = variable_get(static::VARDISPLAY, static::DEFDISPLAY);
     $separator = variable_get(static::VARSEP, static::DEFSEP);
     // Return Zeitgeist for the previous month.
     $ar_date = getdate();
     // Mktime() wraps months cleanly, no worry.
     $start = mktime(0, 0, 0, $ar_date['mon'] - 1, 1, $ar_date['year']);
     unset($ar_date);
     // Return Zeitgeist for the current month.
     $start = NULL;
     $statistics = Statistics::getStatistics(Span::MONTH, $start, 'node', $count);
     $ret = array('subject' => t('Top @count searches', array('@count' => $this->count)), 'content' => array('#theme' => 'zeitgeist_block_top', '#count' => $this->count, '#items' => $statistics->scores, '#nofollow' => static::isNoFollowEnabled(), '#display' => $display, '#separator' => $separator));
     return $ret;
 }
开发者ID:agroknow,项目名称:agreri,代码行数:25,代码来源:BlockTop.php

示例3: CT_Statistics_Default

function CT_Statistics_Default($target)
{
    $blogid = getBlogId();
    $stats = Statistics::getStatistics($blogid);
    $target .= '<ul class="CT_Statistics_Default">';
    $target .= '<li class="TotalCount"><h4>Total Counts</h4><div style="text-align:right; width:100%">';
    $target .= '<span style="font-size:200%">';
    $target .= number_format($stats['total']);
    $target .= '</span>';
    $target .= '</div></li>';
    $target .= '<li class="TodayCount"><h4>Today</h4><div style="text-align:right; width:100%">';
    $target .= '<span style="font-size:200%">';
    $target .= number_format($stats['today']);
    $target .= '</span>';
    $target .= '</div></li>';
    $target .= '<li class="YesterdayCount"><h4>Yesterday</h4><div style="text-align:right; width:100%">';
    $target .= '<span style="font-size:200%">';
    $target .= number_format($stats['yesterday']);
    $target .= '</span>';
    $target .= '</div></li>';
    $target .= '</ul>';
    return $target;
}
开发者ID:Avantians,项目名称:Textcube,代码行数:23,代码来源:index.php

示例4: importlib

require ROOT . '/library/preprocessor.php';
$tabsClass['cover'] = true;
importlib('blogskin');
importlib("model.blog.sidebar");
importlib("model.blog.coverpage");
importlib("model.blog.entry");
importlib("model.blog.archive");
importlib("model.blog.tag");
importlib("model.blog.notice");
importlib("model.blog.comment");
importlib("model.blog.remoteresponse");
importlib("model.blog.link");
require ROOT . '/interface/common/owner/header.php';
$service['pagecache'] = false;
// For plugin setting update.
$stats = Statistics::getStatistics($blogid);
function correctCoverpageImage($subject)
{
    $pattern_with_src = '/(?:\\ssrc\\s*=\\s*["\']?)([^\\s^"^>^\']+)(?:[\\s">\'])/i';
    $pattern_with_background = '/(?:\\sbackground\\s*=\\s*["\']??)([^\\s^"^>^\']+)(?:[\\s">\'])/i';
    $pattern_with_url_func = '/(?:url\\s*\\(\\s*\'?)([^)]+)(?:\'?\\s*\\))/i';
    $return_val = preg_replace_callback($pattern_with_src, 'correctImagePath', $subject);
    $return_val = preg_replace_callback($pattern_with_background, 'correctImagePath', $return_val);
    $return_val = preg_replace_callback($pattern_with_url_func, 'correctImagePath', $return_val);
    return $return_val;
}
function correctImagePath($match)
{
    $context = Model_Context::getInstance();
    $pathArr = explode("/", $match[1]);
    if (false === $pathArr) {
开发者ID:webhacking,项目名称:Textcube,代码行数:31,代码来源:index.php

示例5: PN_Blog_Statistics_Default

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('&nbsp;- 년 도 -') . "</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 
//.........这里部分代码省略.........
开发者ID:hinablue,项目名称:TextCube,代码行数:101,代码来源:index.php

示例6: PN_Visitor_Default

function PN_Visitor_Default()
{
    global $pluginMenuURL, $pluginHandlerURL;
    $blogid = getBlogId();
    $stats = Statistics::getStatistics($blogid);
    $date = isset($_GET['date']) ? $_GET['date'] : date('Ym', strtotime("now"));
    ?>
<!-- This tab space below this line is inserted for the indentation of original admin page -->
						<script type="text/javascript">
							//<![CDATA[
<?php 
    if (Acl::check('group.owners')) {
        ?>
								function setTotalStatistics() {
									if (confirm("방문자의 수를 초기화하면 방문객의 수가 0이 됩니다.\n정말 초기화하시겠습니까?")) {
										var request = new HTTPRequest("GET", "<?php 
        echo $pluginHandlerURL;
        ?>
/PN_Visitor_Default_set&ajaxcall");
										request.onSuccess = function() {
											//document.getElementById("total").innerHTML = 0;
											window.location = '<?php 
        echo $pluginMenuURL;
        ?>
';
											return true;
										}
										request.onError = function() {
											alert("저장하지 못했습니다.");
											return false;
										}
										request.send();
									}
								}
<?php 
    }
    ?>
								
								function addCommas(nStr) {
									nStr += '';
									x = nStr.split('.');
									x1 = x[0];
									x2 = x.length > 1 ? '.' + x[1] : '';
									var rgx = /(\d+)(\d{3})/;
									while (rgx.test(x1)) {
										x1 = x1.replace(rgx, '$1' + ',' + '$2');
									}
									return x1 + x2;
								}
								
								window.addEventListener("load", execLoadFunction, false);
								
								function execLoadFunction() {
									tempDiv = document.createElement("DIV");
									tempDiv.style.clear = "both";
									document.getElementById("part-statistics-visitor").appendChild(tempDiv);
								}
							//]]>
						</script>
					 		
					 	<form method="post" action="<?php 
    echo $pluginHandlerURL;
    ?>
PN_Visitor_Default_set">
					 		<div id="part-statistics-visitor" class="part">
					 			<h2 class="caption"><span class="main-text">방문자 통계정보를 보여줍니다</span></h2>
					 			
						 		<div id="statistics-counter-inbox" class="data-inbox">
									<div class="title">
										<span class="label"><span class="text">현재까지의 방문자 수</span></span>
										<span class="divider"> : </span>
										<span id="total"><?php 
    echo number_format($stats['total']);
    ?>
</span>
									</div>
<?php 
    if (Acl::check('group.owners')) {
        ?>
									<a class="init-button button" href="<?php 
        echo $pluginHandlerURL;
        ?>
/PN_Visitor_Default_set" onclick="setTotalStatistics(); return false;"><span class="text">초기화</span></a>
<?php 
    }
    ?>
								</div>
							
								<hr class="hidden" />
								
								<table id="statistics-month-inbox" class="data-inbox" cellspacing="0" cellpadding="0">
									<thead>
										<tr>
											<th colspan="2"><span class="text">월별 방문자 수</span></th>
										</tr>
									</thead>
									<tbody>
<?php 
    $temp = Statistics::getMonthlyStatistics($blogid);
    for ($i = 0; $i < sizeof($temp); $i++) {
//.........这里部分代码省略.........
开发者ID:ni5am,项目名称:Textcube,代码行数:101,代码来源:index.php

示例7: getDefaultCenterPanel

function getDefaultCenterPanel($mapping)
{
    $ctx = Model_Context::getInstance();
    $blogid = $ctx->getProperty('blog.id');
    ?>
									<div id="<?php 
    echo $mapping['plugin'];
    ?>
" class="section">
									<h3 class="caption<?php 
    echo isset($_REQUEST['edit']) ? ' visible' : ' invisible';
    ?>
">
											<span><?php 
    echo _t('알림판');
    if (isset($_REQUEST['edit'])) {
        ?>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetup" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=-1&edit"><?php 
        echo _t('위로');
        ?>
</a>
											<a id="<?php 
        echo $mapping['plugin'];
        ?>
widgetdown" href="<?php 
        echo $ctx->getProperty('uri.blog');
        ?>
/owner/center/dashboard?edit&pos=<?php 
        echo $positionCounter;
        ?>
&amp;rel=1&edit"><?php 
        echo _t('아래로');
        ?>
</a>
<?php 
    }
    ?>
											</span>
										</h3>
<?php 
    if (isset($_REQUEST['edit'])) {
        ?>
									</div>
<?php 
        return true;
    } else {
        // Get default data
        $stats = Statistics::getStatistics($blogid);
        $latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
        $comments = getRecentComments($blogid, 10);
        $guestbooks = getRecentGuestbook($blogid, 10);
        list($commentNotifies, $paging) = getCommentsNotifiedWithPagingForOwner($blogid, 0, null, null, null, 1, 10);
        $trackbacks = getRecentTrackbacks($blogid, 10);
        $recents = array();
        // title, date, link, category
        foreach ($comments as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $comment['entry'] . "#comment" . $comment['id'], 'category' => 'comment'));
        }
        foreach ($commentNotifies as $comment) {
            array_push($recents, array('title' => $comment['comment'], 'date' => $comment['written'], 'link' => $ctx->getProperty('uri.blog') . "/owner/communication/notify", 'category' => 'commentNotify'));
        }
        foreach ($guestbooks as $guestbook) {
            array_push($recents, array('title' => $guestbook['comment'], 'date' => $guestbook['written'], 'link' => $ctx->getProperty('uri.blog') . "/guestbook/" . $guestbook['id'] . "#guestbook" . $guestbook['id'], 'category' => 'guestbook'));
        }
        foreach ($trackbacks as $trackback) {
            array_push($recents, array('title' => $trackback['subject'], 'date' => $trackback['written'], 'link' => $ctx->getProperty('uri.blog') . "/" . $trackback['entry'] . "#trackback" . $trackback['id'], 'category' => 'trackback'));
        }
        $sort_array = array();
        foreach ($recents as $uniqid => $row) {
            // Sorting.
            foreach ($row as $key => $value) {
                if (!array_key_exists($key, $sort_array)) {
                    $sort_array[$key] = array();
                }
                $sort_array[$key][$uniqid] = $value;
            }
        }
        if (!empty($sort_array)) {
            array_multisort($sort_array['date'], SORT_DESC, $recents);
        }
        $recents = array_slice($recents, 0, 14);
        ?>
										<div id="shortcut-collection">
											<h4 class="caption"><span><?php 
        echo _t('바로가기');
        ?>
</span></h4>

											<ul>
												<li class="newPost"><a class="newPost" href="<?php 
        echo $ctx->getProperty('uri.blog');
//.........这里部分代码省略.........
开发者ID:webhacking,项目名称:Textcube,代码行数:101,代码来源:index.php

示例8: explode

$a = explode('.', $get['a']);
$result = 0;
switch (array_shift($a)) {
    case 'log_error':
        $result = new stdClass();
        $result->success = 'success';
        $txt = file_get_contents('php://input');
        error_log($txt, 3, LOG . 'sdmin_error.txt');
        if (mail($admin, 'Error admin directories', $txt)) {
            $result->result = 'emailed';
        }
        break;
    case 'get_statistics':
        include 'cl/Statistics.php';
        $ctr = new Statistics();
        $result = $ctr->getStatistics();
        break;
    case 'get_usage':
        include 'cl/Statistics.php';
        $ctr = new Statistics();
        $result = $ctr->getUsage($get['devices'], $get['from'], $get['to']);
        break;
    case 'get_devices_data':
        $result = utils()->getDevicesData();
        break;
    case 'restart_kiosks':
        $result = utils()->restartKiosks($get);
        break;
    case 'upload_image':
        $result = utils()->uploadImage($_FILES["file"], $get['folder'], $get['prefix']);
        break;
开发者ID:uplight,项目名称:gallery,代码行数:31,代码来源:admin.php

示例9: getStatistics

function getStatistics($blogid)
{
    return Statistics::getStatistics($blogid);
}
开发者ID:ragi79,项目名称:Textcube,代码行数:4,代码来源:common.legacysupport.php

示例10: strtotime

    case "1 Day":
        $date = strtotime("-23 hours");
        break;
    case "1 Week":
        $date = strtotime("-6 days");
        break;
    case "1 Month":
        $date = strtotime("-29 days");
        break;
    case "3 Months":
        $date = strtotime("-89 days");
        break;
    case "1 Year":
        $date = strtotime("-365 days");
        break;
    case "3 Years":
        $date = strtotime("-795 days");
        break;
    default:
        die("Invalid Timeframe");
}
$rows = $stats->getStatistics($date, $country, $apikey, $browser);
$data = "ID,Map Id,Map Name, API Key,View Time,Viewer IP,Host Name,City,Region,Country,Organization,Postal Code,Phone #,Referer URL,Browser Name, Browser Version, Operating System\n";
$i = 1;
foreach ($rows as $row) {
    $data .= $i++ . "," . $row['maps_id'] . "," . $row['maps_name'] . "," . $row['apikey'] . "," . $row['viewed_at'] . "," . $row['ip'] . "," . $row['hostname'] . "," . $row['city'] . "," . $row['region'] . "," . $row['country'] . "," . $row['org'] . "," . $row['postal'] . "," . $row['phone'] . "," . $row['referer_url'] . "," . $row['browser_name'] . "," . $row['browser_version'] . "," . $row['os'] . "\n";
}
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=" . $timeframe . ".csv");
header("Expires: 0");
echo $data;
开发者ID:MapFig,项目名称:mapfig-studio,代码行数:31,代码来源:index.php


注:本文中的Statistics::getStatistics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。