Today's Page Loads
Total Page Loads
Avg Daily Loads
Today's Prediction
|
get_results("SELECT FORMAT(SUM(hit_count), 0) AS hit_count, hit_date FROM $this->hits_table WHERE hit_date < CURDATE() GROUP BY hit_date ORDER BY hit_date DESC LIMIT $best_num"); ?> | Previous Days
|
get_results("SELECT FORMAT(SUM(hit_count), 0) AS hit_count, SUM(hit_count) AS sort_order, hit_date FROM $this->hits_table WHERE hit_date < CURDATE() GROUP BY hit_date ORDER BY sort_order DESC LIMIT $best_num"); ?> | Best Days
|
Most Reads
|
get_results("SELECT post_id, AVG(hit_count) AS hit_avg
FROM $this->hits_table
WHERE hit_date >= DATE_SUB(CURDATE(),INTERVAL 30 DAY)
AND post_id <> 0
GROUP BY post_id
ORDER BY post_id ASC", ARRAY_A);
$avg = array();
foreach($posts as $post)
$avg[$post['post_id']] = $post['hit_avg'];
$posts = $wpdb->get_results("SELECT post_id, hit_count * (86400/TIME_TO_SEC(TIME(NOW()))) AS hit_now
FROM $this->hits_table
WHERE hit_date = CURDATE()
AND post_id <> 0
ORDER BY post_ID ASC;", ARRAY_A);
$now = array();
foreach($posts as $post)
$now[$post['post_id']] = $post['hit_now'];
$diff = array();
foreach($posts as $post)
$diff[$post['post_id']] = intval(($now[$post['post_id']] - $avg[$post['post_id']]) * 1000 );
$win = count(array_filter($diff, create_function('$a', 'if($a > 0) return(TRUE);')));
$lose = count($diff) - $win;
$sort = array_flip($diff);
ksort($sort);
?>
Top Climbers
Up: '. number_format($diff[$post_id] / 1000, 0) .' Avg: '. number_format($avg[$post_id], 0) .' Today: '. number_format($now[$post_id], 0) ."\n"; } }else{ echo ' |
Biggest Losers
Down: '. number_format($diff[$post_id] / 1000, 0) .' Avg: '. number_format($avg[$post_id], 0) .' Today: '. number_format($now[$post_id], 0) ."\n"; } }else{ echo ' |
Note on climbers and losers: values for "today" are predicted totals for the day based on current data. They should not be mistaken to represent the actual number of page loads in a day, as they will fluctuate throughout the day.
Incoming Search Terms
|