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


PHP wp_statistics_visit函数代码示例

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


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

示例1: wp_statistics_menubar

function wp_statistics_menubar()
{
    global $wp_admin_bar, $wp_version;
    if (is_super_admin() || is_admin_bar_showing()) {
        $AdminURL = get_admin_url();
        if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) {
            $wp_admin_bar->add_menu(array('id' => 'wp-statistic-menu', 'title' => '<span class="ab-icon"></span>', 'href' => $AdminURL . 'admin.php?page=wp-statistics/wp-statistics.php'));
        } else {
            $wp_admin_bar->add_menu(array('id' => 'wp-statistic-menu', 'title' => '<img src="' . plugin_dir_url(__FILE__) . '/assets/images/icon.png"/>', 'href' => $AdminURL . 'admin.php?page=wp-statistics/wp-statistics.php'));
        }
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-useronline', 'parent' => 'wp-statistic-menu', 'title' => __('User Online', 'wp_statistics') . ": " . wp_statistics_useronline(), 'href' => $AdminURL . 'admin.php?page=wps_online_menu'));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-todayvisitor', 'parent' => 'wp-statistic-menu', 'title' => __('Today visitor', 'wp_statistics') . ": " . wp_statistics_visitor('today')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-todayvisit', 'parent' => 'wp-statistic-menu', 'title' => __('Today visit', 'wp_statistics') . ": " . wp_statistics_visit('today')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-yesterdayvisitor', 'parent' => 'wp-statistic-menu', 'title' => __('Yesterday visitor', 'wp_statistics') . ": " . wp_statistics_visitor('yesterday')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-yesterdayvisit', 'parent' => 'wp-statistic-menu', 'title' => __('Yesterday visit', 'wp_statistics') . ": " . wp_statistics_visit('yesterday')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-viewstats', 'parent' => 'wp-statistic-menu', 'title' => __('View Stats', 'wp_statistics'), 'href' => $AdminURL . 'admin.php?page=wp-statistics/wp-statistics.php'));
    }
}
开发者ID:lykeven,项目名称:graspzhihu,代码行数:18,代码来源:wp-statistics.php

示例2: wp_statistics_menubar

function wp_statistics_menubar()
{
    global $wp_admin_bar, $wp_version, $WP_Statistics;
    // Find out if the user can read or manage statistics.
    $read = current_user_can(wp_statistics_validate_capability($WP_Statistics->get_option('read_capability', 'manage_options')));
    $manage = current_user_can(wp_statistics_validate_capability($WP_Statistics->get_option('manage_capability', 'manage_options')));
    if (is_admin_bar_showing() && ($read || $manage)) {
        $AdminURL = get_admin_url();
        if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) {
            $wp_admin_bar->add_menu(array('id' => 'wp-statistic-menu', 'title' => '<span class="ab-icon"></span>', 'href' => $AdminURL . 'admin.php?page=' . WP_STATISTICS_OVERVIEW_PAGE));
        } else {
            $wp_admin_bar->add_menu(array('id' => 'wp-statistic-menu', 'title' => '<img src="' . plugin_dir_url(__FILE__) . '/assets/images/icon.png"/>', 'href' => $AdminURL . 'admin.php?page=' . WP_STATISTICS_OVERVIEW_PAGE));
        }
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-useronline', 'parent' => 'wp-statistic-menu', 'title' => __('User Online', 'wp_statistics') . ": " . wp_statistics_useronline(), 'href' => $AdminURL . 'admin.php?page=' . WP_STATISTICS_ONLINE_PAGE));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-todayvisitor', 'parent' => 'wp-statistic-menu', 'title' => __('Today visitor', 'wp_statistics') . ": " . wp_statistics_visitor('today')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-todayvisit', 'parent' => 'wp-statistic-menu', 'title' => __('Today visit', 'wp_statistics') . ": " . wp_statistics_visit('today')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-yesterdayvisitor', 'parent' => 'wp-statistic-menu', 'title' => __('Yesterday visitor', 'wp_statistics') . ": " . wp_statistics_visitor('yesterday')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-yesterdayvisit', 'parent' => 'wp-statistic-menu', 'title' => __('Yesterday visit', 'wp_statistics') . ": " . wp_statistics_visit('yesterday')));
        $wp_admin_bar->add_menu(array('id' => 'wp-statistics-menu-viewstats', 'parent' => 'wp-statistic-menu', 'title' => __('View Stats', 'wp_statistics'), 'href' => $AdminURL . 'admin.php?page=' . WP_STATISTICS_OVERVIEW_PAGE));
    }
}
开发者ID:xuwenzhi,项目名称:wordpress,代码行数:21,代码来源:wp-statistics.php

示例3: wp_statistics_generate_summary_postbox_content

function wp_statistics_generate_summary_postbox_content($search_engines, $search = true, $time = true)
{
    global $wpdb, $WP_Statistics;
    $show_visitors = $WP_Statistics->get_option('visitor');
    ?>
		
						<table width="100%" class="widefat table-stats" id="summary-stats">
							<tbody>
<?php 
    if ($WP_Statistics->get_option('useronline')) {
        ?>
							
								<tr>
									<th><?php 
        _e('User(s) Online', 'wp_statistics');
        ?>
:</th>
									<th colspan="2" id="th-colspan">
										<span><a href="admin.php?page=wps_online_menu"><?php 
        echo wp_statistics_useronline();
        ?>
<a></span> 
									</th>
								</tr>
<?php 
    }
    if ($WP_Statistics->get_option('visitors') || $WP_Statistics->get_option('visits')) {
        ?>
								
								<tr>
									<th width="60%"></th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            _e('Visitor', 'wp_statistics');
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            _e('Visit', 'wp_statistics');
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Today', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=1"><span>' . number_format_i18n(wp_statistics_visitor('today', null, true)) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            echo '<a href="admin.php?page=wps_hits_menu&hitdays=1"><span>' . number_format_i18n(wp_statistics_visit('today')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Yesterday', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=1"><span>' . number_format_i18n(wp_statistics_visitor('yesterday', null, true)) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            echo '<a href="admin.php?page=wps_hits_menu&hitdays=1"><span>' . number_format_i18n(wp_statistics_visit('yesterday')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Last 7 Days (Week)', 'wp_statistics');
        ?>
:</th>
//.........这里部分代码省略.........
开发者ID:rehand,项目名称:wp-statistics,代码行数:101,代码来源:summary.php

示例4: wp_statistics_shortcodes

function wp_statistics_shortcodes($atts)
{
    /*
    	WP Statitics shortcode is in the format of:
    	
    		[wpstatistics stat=xxx time=xxxx provider=xxxx format=xxxxxx]
    		
    	Where:
    		stat = the statistic you want.
    		time = is the timeframe, strtotime() (http://php.net/manual/en/datetime.formats.php) will be used to calculate it.
    		provider = the search provider to get stats on.
    		format = i18n, english, none
    */
    if (!is_array($atts)) {
        return;
    }
    $formatnumber = array_key_exists('format', $atts);
    switch ($atts['stat']) {
        case 'usersonline':
            $result = wp_statistics_useronline();
            break;
        case 'visits':
            $result = wp_statistics_visit($atts['time']);
            break;
        case 'visitors':
            $result = wp_statistics_visitor($atts['time'], null, true);
            break;
        case 'pagevisits':
            $result = wp_statistics_pages($atts['time']);
            break;
        case 'searches':
            $result = wp_statistics_searchengine($atts['provider']);
            break;
        case 'postcount':
            $result = wp_statistics_countposts();
            break;
        case 'pagecount':
            $result = wp_statistics_countpages();
            break;
        case 'commentcount':
            $result = wp_statistics_countcomment();
            break;
        case 'spamcount':
            $result = wp_statistics_countspam();
            break;
        case 'usercount':
            $result = wp_statistics_countusers();
            break;
        case 'postaverage':
            $result = wp_statistics_average_post();
            break;
        case 'commentaverage':
            $result = wp_statistics_average_comment();
            break;
        case 'useraverage':
            $result = wp_statistics_average_registeruser();
            break;
        case 'lpd':
            $result = wp_statistics_lastpostdate();
            $formatnumber = false;
            break;
    }
    if ($formatnumber) {
        switch (strtolower($atts['format'])) {
            case 'i18n':
                $result = number_format_i18n($result);
                break;
            case 'english':
                $result = number_format($result);
                break;
        }
    }
    return $result;
}
开发者ID:proj-2014,项目名称:vlan247-test-wp,代码行数:74,代码来源:shortcode.php

示例5: wp_statistics_generate_hits_postbox_content

function wp_statistics_generate_hits_postbox_content($size = "300px", $days = 20)
{
    global $wpdb, $WP_Statistics;
    ?>
						<script type="text/javascript">
						var visit_chart;
						jQuery(document).ready(function() {
<?php 
    if ($WP_Statistics->get_option('visits')) {
        echo "var visit_data_line = [";
        for ($i = $days; $i >= 0; $i--) {
            $stat = wp_statistics_visit('-' . $i, true);
            echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $stat . "], ";
        }
        echo "];\n";
        $data_lines[] = 'visit_data_line';
    }
    if ($WP_Statistics->get_option('visitors')) {
        echo "var visitor_data_line = [";
        for ($i = $days; $i >= 0; $i--) {
            $stat = wp_statistics_visitor('-' . $i, true);
            echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $stat . "], ";
        }
        echo "];\n";
        $data_lines[] = 'visitor_data_line';
    }
    ?>
							visit_chart = jQuery.jqplot('visits-stats', [<?php 
    echo implode(',', $data_lines);
    ?>
], {
								title: {
									text: '<b>' + <?php 
    echo json_encode(__('Hits in the last', 'wp_statistics') . ' ' . $days . ' ' . __('days', 'wp_statistics'));
    ?>
 + '</b>',
									fontSize: '12px',
									fontFamily: 'Tahoma',
									textColor: '#000000',
									},
								axes: {
									xaxis: {
											min: '<?php 
    echo $WP_Statistics->Current_Date('Y-m-d', '-' . $days);
    ?>
',
											max: '<?php 
    echo $WP_Statistics->Current_Date('Y-m-d', '');
    ?>
',
											tickInterval: '1 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 visits and visitors', '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 implode(',', array(json_encode(__('Visit', 'wp_statistics')), json_encode(__('Visitor', 'wp_statistics'))));
    ?>
],
									renderer: jQuery.jqplot.EnhancedLegendRenderer,
									rendererOptions:
										{
											numberColumns: 2, 
											disableIEFading: false,
											border: 'none',
										},
									},
								highlighter: {
									show: true,
									bringSeriesToFront: true,
									tooltipAxes: 'xy',
									formatString: '%s:&nbsp;<b>%i</b>&nbsp;',
									tooltipContentEditor: tooltipContentEditor,
								},
								grid: {
								 drawGridlines: true,
//.........这里部分代码省略.........
开发者ID:bqevin,项目名称:wp-shopeasy,代码行数:101,代码来源:hits.php

示例6: widget

 /**
  * Outputs the content of the widget
  *
  * @param array $args
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     global $WP_Statistics;
     extract($args);
     $widget_options = $WP_Statistics->get_option('widget');
     echo $before_widget;
     echo $before_title . $widget_options['name_widget'] . $after_title;
     echo "<ul>";
     if ($widget_options['useronline_widget']) {
         echo "<li>";
         echo __('User Online', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_useronline());
         echo "</li>";
     }
     if ($widget_options['tvisit_widget']) {
         echo "<li>";
         echo __('Today Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('today'));
         echo "</li>";
     }
     if ($widget_options['tvisitor_widget']) {
         echo "<li>";
         echo __('Today Visitor', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visitor('today', null, true));
         echo "</li>";
     }
     if ($widget_options['yvisit_widget']) {
         echo "<li>";
         echo __('Yesterday Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('yesterday'));
         echo "</li>";
     }
     if ($widget_options['yvisitor_widget']) {
         echo "<li>";
         echo __('Yesterday Visitor', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visitor('yesterday', null, true));
         echo "</li>";
     }
     if ($widget_options['wvisit_widget']) {
         echo "<li>";
         echo __('Week Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('week'));
         echo "</li>";
     }
     if ($widget_options['mvisit_widget']) {
         echo "<li>";
         echo __('Month Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('month'));
         echo "</li>";
     }
     if ($widget_options['ysvisit_widget']) {
         echo "<li>";
         echo __('Years Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('year'));
         echo "</li>";
     }
     if ($widget_options['ttvisit_widget']) {
         echo "<li>";
         echo __('Total Visit', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visit('total'));
         echo "</li>";
     }
     if ($widget_options['ttvisitor_widget']) {
         echo "<li>";
         echo __('Total Visitor', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_visitor('total', null, true));
         echo "</li>";
     }
     if ($widget_options['tpviews_widget']) {
         echo "<li>";
         echo __('Total Page Views', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_pages('total'));
         echo "</li>";
     }
     if ($widget_options['ser_widget']) {
         echo "<li>";
         echo __('Search Engine referred', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_searchengine($widget_options['select_se']));
         echo "</li>";
     }
     if ($widget_options['tp_widget']) {
         echo "<li>";
         echo __('Total Posts', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_countposts());
         echo "</li>";
     }
     if ($widget_options['tpg_widget']) {
         echo "<li>";
         echo __('Total Pages', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_countpages());
         echo "</li>";
     }
     if ($widget_options['tc_widget']) {
         echo "<li>";
//.........这里部分代码省略.........
开发者ID:Ezyva2015,项目名称:money101.com.au,代码行数:101,代码来源:widget.php

示例7: wp_statistics_visit_total_ft

function wp_statistics_visit_total_ft()
{
    return sprintf('%06d', 500000 + wp_statistics_visit('total'));
}
开发者ID:khanhhoang288,项目名称:thepphuongloan,代码行数:4,代码来源:functions.php

示例8: number_format_i18n

echo number_format_i18n($visit_total);
?>
</span></th>
									<th class="th-center"><span><?php 
echo number_format_i18n($visitor_total);
?>
</span></th>
								</tr>
								
								<tr>
									<th><?php 
_e('All Time Total', 'wp_statistics');
?>
:</th>
									<th class="th-center"><span><?php 
echo number_format_i18n(wp_statistics_visit('total'));
?>
</span></th>
									<th class="th-center"><span><?php 
echo number_format_i18n(wp_statistics_visitor('total', null, true));
?>
</span></th>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
	</div>
开发者ID:kding0409,项目名称:kding0409.github.io,代码行数:30,代码来源:hit-statistics.php

示例9: wp_statistics_generate_quickstats_postbox_content

function wp_statistics_generate_quickstats_postbox_content($search_engines, $search = false, $time = false)
{
    global $wpdb, $WP_Statistics;
    $show_visitors = $WP_Statistics->get_option('visitor');
    ?>
		
						<table width="100%" class="widefat table-stats" id="summary-stats">
							<tbody>
<?php 
    if ($WP_Statistics->get_option('useronline')) {
        ?>
							
								<tr>
									<th><?php 
        _e('User(s) Online', 'wp_statistics');
        ?>
:</th>
									<th colspan="2" id="th-colspan">
										<span><a href="admin.php?page=<?php 
        echo WP_STATISTICS_ONLINE_PAGE;
        ?>
"><?php 
        echo wp_statistics_useronline();
        ?>
</a></span> 
									</th>
								</tr>
<?php 
    }
    if ($WP_Statistics->get_option('visitors') || $WP_Statistics->get_option('visits')) {
        ?>
								
								<tr>
									<th width="60%"></th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            _e('Visitor', 'wp_statistics');
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            _e('Visit', 'wp_statistics');
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Today', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=' . WP_STATISTICS_VISITORS_PAGE . '&hitdays=1"><span>' . number_format_i18n(wp_statistics_visitor('today', null, true)) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            echo '<a href="admin.php?page=' . WP_STATISTICS_HITS_PAGE . '&hitdays=1"><span>' . number_format_i18n(wp_statistics_visit('today')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Yesterday', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=1"><span>' . number_format_i18n(wp_statistics_visitor('yesterday', null, true)) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visits')) {
            echo '<a href="admin.php?page=' . WP_STATISTICS_HITS_PAGE . '&hitdays=1"><span>' . number_format_i18n(wp_statistics_visit('yesterday')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
//.........这里部分代码省略.........
开发者ID:ltdat287,项目名称:id.nhomdichvu,代码行数:101,代码来源:quickstats.php

示例10: _e

					<div class="handlediv" title="<?php 
_e('Click to toggle', 'wp_statistics');
?>
"><br /></div>
					<h3 class="hndle"><span><?php 
_e('Hits Statistics Chart', 'wp_statistics');
?>
</span></h3>
					<div class="inside">
						<script type="text/javascript">
						var visit_chart;
						jQuery(document).ready(function() {
<?php 
echo "var visit_data_line = [";
for ($i = $daysToDisplay; $i >= 0; $i--) {
    $stat = wp_statistics_visit('-' . $i, true);
    echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $stat . "], ";
}
echo "];\n";
echo "var visitor_data_line = [";
for ($i = $daysToDisplay; $i >= 0; $i--) {
    $stat = wp_statistics_visitor('-' . $i, true);
    echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $stat . "], ";
}
echo "];\n";
$tickInterval = $daysToDisplay / 20;
if ($tickInterval < 1) {
    $tickInterval = 1;
}
?>
							visit_chart = jQuery.jqplot('visits-stats', [visit_data_line, visitor_data_line], {
开发者ID:dtekcth,项目名称:datateknologer.se,代码行数:31,代码来源:hit-statistics.php


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