Example #1
0
} else {
    include_once dirname(__FILE__) . "/widgets/google.map.php";
}
include_once dirname(__FILE__) . "/widgets/countries.php";
include_once dirname(__FILE__) . "/widgets/hits.php";
include_once dirname(__FILE__) . "/widgets/pages.php";
include_once dirname(__FILE__) . "/widgets/recent.php";
include_once dirname(__FILE__) . "/widgets/referring.php";
include_once dirname(__FILE__) . "/widgets/search.php";
include_once dirname(__FILE__) . "/widgets/summary.php";
include_once dirname(__FILE__) . "/widgets/top.visitors.php";
include_once dirname(__FILE__) . "/widgets/words.php";
$search_engines = wp_statistics_searchengine_list();
$search_result['All'] = wp_statistics_searchengine('all', 'total');
foreach ($search_engines as $key => $se) {
    $search_result[$key] = wp_statistics_searchengine($key, 'total');
}
$nag_html = '';
if (!$WP_Statistics->get_option('disable_donation_nag', false)) {
    $nag_html = '<div id="wps_nag" class="update-nag" style="width: 90%;"><div id="donate-text"><p>' . __('Have you thought about donating to WP Statistics?', 'wp_statistics') . ' <a href="http://wp-statistics.com/donate/" target="_blank">' . __('Donate Now!', 'wp_statistics') . '</a></p></div><div id="donate-button"><a class="button-primary" id="wps_close_nag">' . __('Close', 'wp_statistics') . '</a></div></div>';
}
?>

<div class="wrap">
	<?php 
echo $nag_html;
?>

	<?php 
screen_icon('options-general');
?>
Example #2
0
function wp_statistics_generate_search_postbox_content($search_engines, $size = "300px", $days = 20)
{
    global $wpdb, $WP_Statistics;
    ?>
						<script type="text/javascript">
						var referral_chart;
						jQuery(document).ready(function() {
<?php 
    $total_stats = $WP_Statistics->get_option('chart_totals');
    $total_daily = array();
    foreach ($search_engines as $se) {
        echo "var searches_data_line_" . $se['tag'] . " = [";
        for ($i = $days; $i >= 0; $i--) {
            if (!array_key_exists($i, $total_daily)) {
                $total_daily[$i] = 0;
            }
            $stat = wp_statistics_searchengine($se['tag'], '-' . $i);
            $total_daily[$i] += $stat;
            echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $stat . "], ";
        }
        echo "];\n";
    }
    if ($total_stats == 1) {
        echo "var searches_data_line_total = [";
        for ($i = $days; $i >= 0; $i--) {
            echo "['" . $WP_Statistics->Current_Date('Y-m-d', '-' . $i) . "'," . $total_daily[$i] . "], ";
        }
        echo "];\n";
    }
    ?>
							referral_chart = jQuery.jqplot('search-stats', [<?php 
    foreach ($search_engines as $se) {
        echo "searches_data_line_" . $se['tag'] . ", ";
    }
    if ($total_stats == 1) {
        echo 'searches_data_line_total';
    }
    ?>
], {
								title: {
									text: '<b>' + <?php 
    echo json_encode(__('Search engine referrals 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 referrals', 'wp_statistics'));
    ?>
,
											labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
											labelOptions: {
												angle: -90,
												fontSize: '12px',
												fontFamily: 'Tahoma',
												fontWeight: 'bold',
											},
										}
									},
								legend: {
									show: true,
									location: 's',
									placement: 'outsideGrid',
									labels: [<?php 
    foreach ($search_engines as $se) {
        echo json_encode($se['translated']) . ", ";
    }
    if ($total_stats == 1) {
        echo "'" . json_encode(__('Total', 'wp_statistics')) . "'";
    }
    ?>
],
									renderer: jQuery.jqplot.EnhancedLegendRenderer,
									rendererOptions:
										{
											numberColumns: <?php 
    echo count($search_engines) + 1;
    ?>
, 
											disableIEFading: false,
											border: 'none',
										},
									},
								highlighter: {
									show: true,
									bringSeriesToFront: true,
									tooltipAxes: 'xy',
									formatString: '%s:&nbsp;<b>%i</b>&nbsp;',
									tooltipContentEditor: tooltipContentEditor,
								},
								grid: {
								 drawGridlines: true,
								 borderColor: 'transparent',
								 shadow: false,
								 drawBorder: false,
								 shadowColor: 'transparent'
								},
							} );
						
							function tooltipContentEditor(str, seriesIndex, pointIndex, plot) {
								// display series_label, x-axis_tick, y-axis value
								return plot.legend.labels[seriesIndex] + ", " + str;;
							}
							
							jQuery(window).resize(function() {
								JQPlotReferralChartLengendClickRedraw()
							});

							function JQPlotReferralChartLengendClickRedraw() {
								referral_chart.replot( {resetAxes: ['yaxis'] } );
								jQuery('div[id="search-stats"] .jqplot-table-legend').click(function() {
									JQPlotReferralChartLengendClickRedraw();
								});
							}
							
							jQuery('div[id="search-stats"] .jqplot-table-legend').click(function() {
								JQPlotReferralChartLengendClickRedraw()
							});

						});

						</script>
						
						<div id="search-stats" style="height:<?php 
    echo $size;
    ?>
;"></div>
						
<?php 
}
Example #3
0
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>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=7"><span>' . number_format_i18n(wp_statistics_visitor('week', 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=7"><span>' . number_format_i18n(wp_statistics_visit('week')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Last 30 Days (Month)', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=30"><span>' . number_format_i18n(wp_statistics_visitor('month', 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=30"><span>' . number_format_i18n(wp_statistics_visit('month')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Last 365 Days (Year)', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=365"><span>' . number_format_i18n(wp_statistics_visitor('year', 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=365"><span>' . number_format_i18n(wp_statistics_visit('year')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Total', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=365"><span>' . number_format_i18n(wp_statistics_visitor('total', 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=365"><span>' . number_format_i18n(wp_statistics_visit('total')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
<?php 
    }
    if ($search == true && $WP_Statistics->get_option('visitors')) {
        if ($WP_Statistics->get_option('visitors') || $WP_Statistics->get_option('visits') || $WP_Statistics->get_option('useronline')) {
            ?>
								<tr>
									<th colspan="3"><br><hr></th>
								</tr>
<?php 
        }
        ?>
								<tr>
									<th colspan="3" style="text-align: center;"><?php 
        _e('Search Engine Referrals', 'wp_statistics');
        ?>
</th>
								</tr>
								
								<tr>
									<th width="60%"></th>
									<th class="th-center"><?php 
        _e('Today', 'wp_statistics');
        ?>
</th>
									<th class="th-center"><?php 
        _e('Yesterday', 'wp_statistics');
        ?>
</th>
								</tr>
								
								<?php 
        $se_today_total = 0;
        $se_yesterday_total = 0;
        foreach ($search_engines as $se) {
            ?>
								<tr>
									<th><img src='<?php 
            echo plugins_url('wp-statistics/assets/images/' . $se['image']);
            ?>
'> <?php 
            _e($se['name'], 'wp_statistics');
            ?>
:</th>
									<th class="th-center"><span><?php 
            $se_temp = wp_statistics_searchengine($se['tag'], 'today');
            $se_today_total += $se_temp;
            echo number_format_i18n($se_temp);
            ?>
</span></th>
									<th class="th-center"><span><?php 
            $se_temp = wp_statistics_searchengine($se['tag'], 'yesterday');
            $se_yesterday_total += $se_temp;
            echo number_format_i18n($se_temp);
            ?>
</span></th>
								</tr>
								
								<?php 
        }
        ?>
								<tr>
									<th><?php 
        _e('Daily Total', 'wp_statistics');
        ?>
:</th>
									<td id="th-colspan" class="th-center"><span><?php 
        echo number_format_i18n($se_today_total);
        ?>
</span></td>
									<td id="th-colspan" class="th-center"><span><?php 
        echo number_format_i18n($se_yesterday_total);
        ?>
</span></td>
								</tr>

								<tr>
									<th><?php 
        _e('Total', 'wp_statistics');
        ?>
:</th>
									<th colspan="2" id="th-colspan"><span><?php 
        echo number_format_i18n(wp_statistics_searchengine('all'));
        ?>
</span></th>
								</tr>
<?php 
    }
    if ($time == true) {
        ?>
								<tr>
									<th colspan="3"><br><hr></th>
								</tr>

								<tr>
									<th colspan="3" style="text-align: center;"><?php 
        _e('Current Time and Date', 'wp_statistics');
        ?>
 <span id="time_zone"><a href="<?php 
        echo admin_url('options-general.php');
        ?>
"><?php 
        _e('(Adjustment)', 'wp_statistics');
        ?>
</a></span></th>
								</tr>

								<tr>
									<th colspan="3"><?php 
        echo sprintf(__('Date: %s', 'wp_statistics'), '<code dir="ltr">' . $WP_Statistics->Current_Date_i18n(get_option('date_format')) . '</code>');
        ?>
</th>
								</tr>

								<tr>
									<th colspan="3"><?php 
        echo sprintf(__('Time: %s', 'wp_statistics'), '<code dir="ltr">' . $WP_Statistics->Current_Date_i18n(get_option('time_format')) . '</code>');
        ?>
</th>
								</tr>
<?php 
    }
    ?>
							</tbody>
						</table>
<?php 
}
Example #4
0
?>
</span></h3>
					<div class="inside">
						<script type="text/javascript">
						var visit_chart;
						jQuery(document).ready(function() {
<?php 
$total_stats = $WP_Statistics->get_option('chart_totals');
$total_daily = array();
foreach ($search_engines as $se) {
    echo "var searches_data_line_" . $se['tag'] . " = [";
    for ($i = $daysToDisplay; $i >= 0; $i--) {
        if (!array_key_exists($i, $total_daily)) {
            $total_daily[$i] = 0;
        }
        $stat = wp_statistics_searchengine($se['tag'], '-' . $i);
        $total_daily[$i] += $stat;
        echo "['" . $WP_Statistics->Real_Current_Date('Y-m-d', '-' . $i, $rangeend_utime) . "'," . $stat . "], ";
    }
    echo "];\n";
}
if ($total_stats == 1) {
    echo "var searches_data_line_total = [";
    for ($i = $daysToDisplay; $i >= 0; $i--) {
        echo "['" . $WP_Statistics->Real_Current_Date('Y-m-d', '-' . $i, $rangeend_utime) . "'," . $total_daily[$i] . "], ";
    }
    echo "];\n";
}
$tickInterval = $daysToDisplay / 20;
if ($tickInterval < 1) {
    $tickInterval = 1;
Example #5
0
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;
}
Example #6
0
 /**
  * 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>";
         echo __('Total Comments', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_countcomment());
         echo "</li>";
     }
     if ($widget_options['ts_widget']) {
         echo "<li>";
         echo __('Total Spams', 'wp_statistics') . ": ";
         echo wp_statistics_countspam();
         echo "</li>";
     }
     if ($widget_options['tu_widget']) {
         echo "<li>";
         echo __('Total Users', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_countusers());
         echo "</li>";
     }
     if ($widget_options['ap_widget']) {
         echo "<li>";
         echo __('Average Posts', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_average_post());
         echo "</li>";
     }
     if ($widget_options['ac_widget']) {
         echo "<li>";
         echo __('Average Comments', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_average_comment());
         echo "</li>";
     }
     if ($widget_options['au_widget']) {
         echo "<li>";
         echo __('Average Users', 'wp_statistics') . ": ";
         echo number_format_i18n(wp_statistics_average_registeruser());
         echo "</li>";
     }
     if ($widget_options['lpd_widget']) {
         echo "<li>";
         echo __('Last Post Date', 'wp_statistics') . ": ";
         echo wp_statistics_lastpostdate();
         echo "</li>";
     }
     echo "</ul>";
     echo $after_widget;
 }
Example #7
0
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 
        _e('Last 7 Days (Week)', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=7"><span>' . number_format_i18n(wp_statistics_visitor('week', 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=7"><span>' . number_format_i18n(wp_statistics_visit('week')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Last 30 Days (Month)', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=30"><span>' . number_format_i18n(wp_statistics_visitor('month', 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=30"><span>' . number_format_i18n(wp_statistics_visit('month')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Last 365 Days (Year)', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=365"><span>' . number_format_i18n(wp_statistics_visitor('year', 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=365"><span>' . number_format_i18n(wp_statistics_visit('year')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
								<tr>
									<th><?php 
        _e('Total', 'wp_statistics');
        ?>
:</th>
									<th class="th-center"><?php 
        if ($WP_Statistics->get_option('visitors')) {
            echo '<a href="admin.php?page=wps_visitors_menu&hitdays=365"><span>' . number_format_i18n(wp_statistics_visitor('total', 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=365"><span>' . number_format_i18n(wp_statistics_visit('total')) . '</span></a>';
        } else {
            echo '';
        }
        ?>
</th>
								</tr>
								
<?php 
    }
    if ($search == true && $WP_Statistics->get_option('visitors')) {
        if ($WP_Statistics->get_option('visitors') || $WP_Statistics->get_option('visits') || $WP_Statistics->get_option('useronline')) {
            ?>
								<tr>
									<th colspan="3"><br><hr></th>
								</tr>
<?php 
        }
        ?>
								<tr>
									<th colspan="3" style="text-align: center;"><?php 
        _e('Search Engine Referrals', 'wp_statistics');
        ?>
</th>
								</tr>
								
								<tr>
									<th width="60%"></th>
									<th class="th-center"><?php 
        _e('Today', 'wp_statistics');
        ?>
</th>
									<th class="th-center"><?php 
        _e('Yesterday', 'wp_statistics');
        ?>
</th>
								</tr>
								
								<?php 
        $se_today_total = 0;
        $se_yesterday_total = 0;
        foreach ($search_engines as $se) {
            ?>
								<tr>
									<th><img src='<?php 
            echo plugins_url('wp-statistics/assets/images/' . $se['image']);
            ?>
'> <?php 
            _e($se['name'], 'wp_statistics');
            ?>
:</th>
									<th class="th-center"><span><?php 
            $se_temp = wp_statistics_searchengine($se['tag'], 'today');
            $se_today_total += $se_temp;
            echo number_format_i18n($se_temp);
            ?>
</span></th>
									<th class="th-center"><span><?php 
            $se_temp = wp_statistics_searchengine($se['tag'], 'yesterday');
            $se_yesterday_total += $se_temp;
            echo number_format_i18n($se_temp);
            ?>
</span></th>
								</tr>
								
								<?php 
        }
        ?>
								<tr>
									<th><?php 
        _e('Daily Total', 'wp_statistics');
        ?>
:</th>
									<td id="th-colspan" class="th-center"><span><?php 
        echo number_format_i18n($se_today_total);
        ?>
</span></td>
									<td id="th-colspan" class="th-center"><span><?php 
        echo number_format_i18n($se_yesterday_total);
        ?>
</span></td>
								</tr>

								<tr>
									<th><?php 
        _e('Total', 'wp_statistics');
        ?>
:</th>
									<th colspan="2" id="th-colspan"><span><?php 
        echo number_format_i18n(wp_statistics_searchengine('all'));
        ?>
</span></th>
								</tr>
<?php 
    }
    if ($time == true) {
        ?>
								<tr>
									<th colspan="3"><br><hr></th>
								</tr>

								<tr>
									<th colspan="3" style="text-align: center;"><?php 
        _e('Current Time and Date', 'wp_statistics');
        ?>
 <span id="time_zone"><a href="<?php 
        echo admin_url('options-general.php');
        ?>
"><?php 
        _e('(Adjustment)', 'wp_statistics');
        ?>
</a></span></th>
								</tr>

								<tr>
									<th colspan="3"><?php 
        echo sprintf(__('Date: %s', 'wp_statistics'), '<code dir="ltr">' . $WP_Statistics->Current_Date_i18n(get_option('date_format')) . '</code>');
        ?>
</th>
								</tr>

								<tr>
									<th colspan="3"><?php 
        echo sprintf(__('Time: %s', 'wp_statistics'), '<code dir="ltr">' . $WP_Statistics->Current_Date_i18n(get_option('time_format')) . '</code>');
        ?>
</th>
								</tr>
<?php 
    }
    ?>
							</tbody>
						</table>

						<br>
						<hr width="80%"/>
						<br>
<?php 
    // Include the hits chart widget, we're going to display the last 10 days only as the WordPress columns are kind of small to do much else.
    include_once dirname(__FILE__) . "/hits.php";
    wp_statistics_generate_hits_postbox_content("300px", 10);
}