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


PHP wp_statistics_date_range_calculator函数代码示例

本文整理汇总了PHP中wp_statistics_date_range_calculator函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_statistics_date_range_calculator函数的具体用法?PHP wp_statistics_date_range_calculator怎么用?PHP wp_statistics_date_range_calculator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: wp_statistics_searchengine_list

$search_engines = wp_statistics_searchengine_list();
$daysToDisplay = 20;
if (array_key_exists('hitdays', $_GET)) {
    $daysToDisplay = intval($_GET['hitdays']);
}
if (array_key_exists('rangestart', $_GET)) {
    $rangestart = $_GET['rangestart'];
} else {
    $rangestart = '';
}
if (array_key_exists('rangeend', $_GET)) {
    $rangeend = $_GET['rangeend'];
} else {
    $rangeend = '';
}
list($daysToDisplay, $rangestart_utime, $rangeend_utime) = wp_statistics_date_range_calculator($daysToDisplay, $rangestart, $rangeend);
?>
<div class="wrap">
	<?php 
screen_icon('options-general');
?>
	<h2><?php 
_e('Search Engine Referral Statistics', 'wp_statistics');
?>
</h2>

	<?php 
wp_statistics_date_range_selector(WP_STATISTICS_SEARCHES_PAGE, $daysToDisplay);
?>

	<div class="postbox-container" style="width: 100%; float: left; margin-right:20px">
开发者ID:wenhao87,项目名称:WPPlugins,代码行数:31,代码来源:search-statistics.php

示例2: wp_statistics_generate_page_postbox_content

function wp_statistics_generate_page_postbox_content($pageuri, $pageid, $days = 20, $chart_title = null, $rangestart = '', $rangeend = '')
{
    global $WP_Statistics;
    if (!$WP_Statistics->get_option('pages')) {
        return;
    }
    if ($chart_title == null) {
        $chart_title = __('Page Trending Stats', 'wp_statistics');
    }
    if ($pageuri && !$pageid) {
        $pageid = wp_statistics_uri_to_id($pageuri);
    }
    $post = get_post($pageid);
    if (is_object($post)) {
        $title = $post->post_title;
    } else {
        $title = "";
    }
    $urlfields = "&page-id={$pageid}";
    if ($pageuri) {
        $urlfields .= "&page-uri={$pageuri}";
    }
    list($daysToDisplay, $rangestart_utime, $rangeend_utime) = wp_statistics_date_range_calculator($days, $rangestart, $rangeend);
    ?>
						<script type="text/javascript">
						var pages_chart;
						jQuery(document).ready(function() {
<?php 
    echo "var page_data_line = [";
    for ($i = $daysToDisplay; $i >= 0; $i--) {
        $stat = wp_statistics_pages('-' . $i, $pageuri, $pageid);
        echo "['" . $WP_Statistics->Real_Current_Date('Y-m-d', '-' . $i, $rangeend_utime) . "'," . $stat . "], ";
    }
    echo "];\n";
    $tickInterval = $daysToDisplay / 20;
    if ($tickInterval < 1) {
        $tickInterval = 1;
    }
    ?>
							pages_jqchart = jQuery.jqplot('page-stats', [page_data_line], {
								title: {
									text: '<b>' + <?php 
    echo json_encode(__($chart_title, 'wp_statistics'));
    ?>
 + '</b>',
									fontSize: '12px',
									fontFamily: 'Tahoma',
									textColor: '#000000',
									},
								axes: {
									xaxis: {
											min: '<?php 
    echo $WP_Statistics->Real_Current_Date('Y-m-d', '-' . $daysToDisplay, $rangeend_utime);
    ?>
',
											max: '<?php 
    echo $WP_Statistics->Real_Current_Date('Y-m-d', '-0', $rangeend_utime);
    ?>
',
											tickInterval:  '<?php 
    echo $tickInterval;
    ?>
 day',
											renderer:jQuery.jqplot.DateAxisRenderer,
											tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
											tickOptions: { 
												angle: -45,
												formatString:'%b %#d',
												showGridline: false, 
												},
										},										
									yaxis: {
											min: 0,
											padMin: 1.0,
											label: <?php 
    echo json_encode(__('Number of Hits', 'wp_statistics'));
    ?>
,
											labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
											labelOptions: {
												angle: -90,
												fontSize: '12px',
												fontFamily: 'Tahoma',
												fontWeight: 'bold',
											},
										}
									},
								legend: {
									show: true,
									location: 's',
									placement: 'outsideGrid',
									labels: [ '<?php 
    echo $pageid . ' - ' . $title;
    ?>
' ],
									renderer: jQuery.jqplot.EnhancedLegendRenderer,
									rendererOptions:
										{
											numberColumns: 5, 
											disableIEFading: false,
//.........这里部分代码省略.........
开发者ID:lykeven,项目名称:graspzhihu,代码行数:101,代码来源:page.php


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