• File: top-visitors.php
  • Full Path: /home/chassiw/www/wp-statistics/includes/log/top-visitors.php
  • File size: 2.59 KB
  • MIME-type: text/html
  • Charset: utf-8
<script type="text/javascript">
    jQuery(document).ready(function () {
        postboxes.add_postbox_toggles(pagenow);
    });
</script>
<?php
$ISOCountryCode = $WP_Statistics->get_country_codes();
include( WP_Statistics::$reg['plugin-dir'] . 'includes/log/widgets/top.visitors.php' );
?>
<div class="wrap">
    <h2><?php _e( 'Top 100 Visitors Today', 'wp-statistics' ); ?></h2>
    <?php do_action( 'wp_statistics_after_title' ); ?>

	<?php
	wp_enqueue_script( 'jquery-ui-datepicker' );
	wp_register_style(
		'jquery-ui-smoothness-css',
		WP_Statistics::$reg['plugin-url'] . 'assets/css/jquery-ui-smoothness.min.css'
	);
	wp_enqueue_style( 'jquery-ui-smoothness-css' );

	$current = 0;

	$statsdate = $WP_Statistics->Current_Date( get_option("date_format"), '-' . $current );

	if ( array_key_exists( 'statsdate', $_GET ) ) {
		$statsdate = $_GET['statsdate'];
	}

	echo '<br><form method="get">' . "\r\n";

	echo ' ' . __( 'Date', 'wp-statistics' ) . ': ';

	echo '<input type="hidden" name="page" value="' . WP_Statistics::$page['top-visitors'] . '">' . "\r\n";
	echo '<input type="text" size="10" name="statsdate" id="statsdate" value="' . htmlentities( $statsdate, ENT_QUOTES ) . '" placeholder="' . __( wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")), 'wp-statistics' ) . '"> <input type="submit" value="' . __( 'Go', 'wp-statistics' ) . '" class="button-primary">' . "\r\n";

	echo '</form>' . "\r\n";

	echo '<script>jQuery(function() { jQuery( "#statsdate" ).datepicker({dateFormat: \''.wp_statistics_dateformat_php_to_jqueryui(get_option("date_format")).'\'}); } );</script>' . "\r\n";

	?>
    <div class="postbox-container" id="last-log" style="width: 100%;">
        <div class="metabox-holder">
            <div class="meta-box-sortables">
                <div class="postbox">
					<?php $paneltitle = __( 'Top Visitors', 'wp-statistics' ); ?>
                    <button class="handlediv" type="button" aria-expanded="true">
						<span class="screen-reader-text"><?php printf(
								__( 'Toggle panel: %s', 'wp-statistics' ),
								$paneltitle
							); ?></span>
                        <span class="toggle-indicator" aria-hidden="true"></span>
                    </button>
                    <h2 class="hndle"><span><?php echo $paneltitle; ?></h2>

                    <div class="inside">

						<?php wp_statistics_generate_top_visitors_postbox_content(
							$ISOCountryCode,
							$statsdate,
							100,
							false
						); ?>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>