public function counterize_plugin_traffic_shortcodes_callback($output, $attr, $content = null)
 {
     extract(shortcode_atts(array('type' => 'copyright', 'items' => 10, 'subitems' => 15, 'version' => 'yes', 'collapsible' => 'no', 'print_header' => 'yes', 'header' => '', 'period' => '24h', 'tn_width' => 50, 'tn_height' => 50), $attr));
     ob_start();
     if ($type == 'hits') {
         $this->counterize_get_hits();
     } elseif ($type == 'hourly') {
         if ($period == 'onlytoday') {
             $this->counterize_render_hourly_stats(TRUE, $print_header === 'yes', $header);
         } else {
             $this->counterize_render_hourly_stats(FALSE, $print_header === 'yes', $header);
         }
     } elseif ($type == 'daily') {
         if ($period == 'onlythismonth') {
             $this->counterize_render_daily_stats(TRUE, $print_header === 'yes', $header);
         } else {
             $this->counterize_render_daily_stats(FALSE, $print_header === 'yes', $header);
         }
     } elseif ($type == 'weekly') {
         if ($period == 'onlythisweek') {
             $this->counterize_render_weekly_stats(TRUE, $print_header === 'yes', $header);
         } else {
             $this->counterize_render_weekly_stats(FALSE, $print_header === 'yes', $header);
         }
     } elseif ($type == 'monthly') {
         if ($period == 'onlythisyear') {
             $this->counterize_render_monthly_stats(TRUE, $print_header === 'yes', $header);
         } else {
             $this->counterize_render_monthly_stats(FALSE, $print_header === 'yes', $header);
         }
     } elseif ($type == 'totalhits') {
         echo counterize_getamount();
     }
     $tmp = ob_get_contents();
     if (!empty($tmp)) {
         $output = $tmp;
     }
     ob_end_clean();
     return $output;
 }
    public function counterize_show_data_browsers($admin = false, $amount2 = 10, $directcall = true)
    {
        if ($directcall) {
            ?>

			<p><?php 
            _e('Need help about this page? Click on <strong>Help</strong> on the top of this page!', COUNTERIZE_PLUGIN_BROWSERS_TD);
            ?>
</p>

			<?php 
            if (!counterize_getamount()) {
                _e("There's no data in the database - You can't see stats until you have data.", COUNTERIZE_PLUGIN_BROWSERS_TD);
                return;
            }
        }
        ?>

		<!-- Browsers -->
		<div class="wrap">

			<?php 
        $this->counterize_render_most_used_browsers_collapsible($amount2, $amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_used_browsers_without_version($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_used_browsers($amount2);
        ?>

		</div>

		<?php 
    }
    public function counterize_show_data_pages($admin = false, $amount2 = 10, $directcall = true)
    {
        if ($directcall) {
            ?>

			<p><?php 
            _e('Need help about this page? Click on <strong>Help</strong> on the top of this page!', COUNTERIZE_PLUGIN_PAGES_TD);
            ?>
</p>

			<?php 
            if (!counterize_getamount()) {
                _e("There's no data in the database - You can't see stats until you have data.", COUNTERIZE_PLUGIN_PAGES_TD);
                return;
            }
        }
        ?>

		<!-- Popular posts -->
		<div class="wrap">

			<?php 
        $this->counterize_render_most_popular_posts($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_popular_posts24hrs($amount2);
        ?>

		</div>

		<!-- Urls -->
		<div class="wrap">

			<?php 
        $this->counterize_render_most_requested_urls($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_requested_urls24hrs($amount2);
        ?>

		</div>

		<?php 
    }
Example #4
0
function counterize_showStats($admin = false)
{
    if (!counterize_getamount()) {
        _e("<strong>There's no data in the database - You can't see stats until you have data.</strong>", COUNTERIZE_TD);
        return;
    }
    global $counterize_plugin_count;
    if ($counterize_plugin_count == 0) {
        printf(__('<h2 style="color: #F00;">Important</h2><strong>No Counterize plugin has been activated</strong>. Please activate the plugins you need in the <a href="%s">Plugins page</a>.', COUNTERIZE_TD), get_admin_url(null, 'plugins.php'));
        return;
    }
    // Amount to pass as option to the graphs...
    $amount2 = counterize_get_option('amount2');
    if ($amount2 == '' || $amount2 == ' ' || !is_numeric($amount2)) {
        $amount2 = 10;
    }
    //allow plugins to show their data into the "Counterize" sub-menu page.
    do_action('counterize_show_data', $admin, $amount2, false);
}
    public function counterize_show_data_ip($admin = false, $amount2 = 10, $directcall = true)
    {
        if ($directcall) {
            ?>

			<p><?php 
            _e('Need help about this page? Click on <strong>Help</strong> on the top of this page!', COUNTERIZE_PLUGIN_IP_TD);
            ?>
</p>

			<?php 
            if (!counterize_getamount()) {
                _e("There's no data in the database - You can't see stats until you have data. ", COUNTERIZE_PLUGIN_IP_TD);
                return;
            }
        }
        $enable_hostname_lookup = counterize_get_option('enable_hostname_lookup');
        ?>

		<!-- IPs -->
		<div class="wrap">

			<?php 
        $this->counterize_render_most_active_ips($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_active_ips24hrs($amount2);
        ?>

		</div>

		<?php 
        if ($enable_hostname_lookup) {
            ?>
<div class="wrap">

			<?php 
            $this->counterize_render_most_active_hosts($amount2);
            ?>

		</div>

		<div class="wrap">

			<?php 
            $this->counterize_render_most_active_hosts24hrs($amount2);
            ?>

		</div><?php 
        }
        ?>

		<?php 
    }
function counterize_dashboard_callback()
{
    //what was the two following lines supposed to do?...
    //$admin = dirname( $_SERVER['SCRIPT_FILENAME'] );
    //$admin = substr( $admin, strrpos( $admin, '/' ) + 1 );
    $count = counterize_getamount();
    $unique = counterize_getuniqueamount();
    $todaycount = counterize_gethitstoday();
    $online = counterize_get_online_users();
    $todayunique = counterize_getuniquehitstoday();
    ?>

		<p>
			<?php 
    _e('Total: ', COUNTERIZE_TD);
    ?>
<strong><?php 
    echo $count;
    ?>
</strong> <?php 
    _e('hits and', COUNTERIZE_TD);
    ?>
 <strong><?php 
    echo $unique;
    ?>
</strong> <?php 
    _e('unique.');
    ?>
		</p>
		<p>
			<?php 
    _e('Today: ', COUNTERIZE_TD);
    ?>
<strong><?php 
    echo $todaycount;
    ?>
</strong> <?php 
    _e('hits and', COUNTERIZE_TD);
    ?>
 <strong><?php 
    echo $todayunique;
    ?>
</strong> <?php 
    _e('unique.');
    ?>
		</p>
		<p>
			<?php 
    _e('Currently: ', COUNTERIZE_TD);
    ?>
<strong><?php 
    echo $online;
    ?>
</strong> <?php 
    _e('users online.', COUNTERIZE_TD);
    ?>
		</p>

		<a href="admin.php?page=counterize_dashboard"><?php 
    _e('Detailed view', COUNTERIZE_TD);
    ?>
 &raquo;</a>
	<?php 
}
    public function counterize_show_data_referers($admin = false, $amount2 = 10, $directcall = true)
    {
        if ($directcall) {
            ?>

			<p><?php 
            _e('Need help about this page? Click on <strong>Help</strong> on the top of this page!', COUNTERIZE_PLUGIN_REFERERS_TD);
            ?>
</p>

			<?php 
            if (!counterize_getamount()) {
                _e("There's no data in the database - You can't see stats until you have data. ", COUNTERIZE_PLUGIN_REFERERS_TD);
                return;
            }
        }
        ?>

		<!-- Referers -->
		<div class="wrap">

			<?php 
        $this->counterize_render_most_seen_referers($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_seen_referers24hrs($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_seen_referers_domains($amount2);
        ?>

		</div>

		<div class="wrap">

			<?php 
        $this->counterize_render_most_seen_referers_domains24hrs($amount2);
        ?>

		</div>

		<?php 
    }