get_row("SELECT `title`, `tracker`, `type` FROM `{$wpdb->prefix}adrotate` WHERE `id` = '{$id}';"); $stats = adrotate_stats($id, false); $stats_today = adrotate_stats($id, false, adrotate_date_start('day')); $stats_last_month = adrotate_stats($id, false, get_date_from_gmt(gmmktime(0, 0, 0, gmdate("m")-1, 1, gmdate("Y")), 'U'), get_date_from_gmt(gmmktime(0, 0, 0, gmdate("m"), 0, gmdate("Y")), 'U')); $stats_this_month = adrotate_stats($id, false, get_date_from_gmt(gmmktime(0, 0, 0, gmdate("m"), 1, gmdate("Y")), 'U'), get_date_from_gmt(gmmktime(0, 0, 0, gmdate("m"), gmdate("t"), gmdate("Y")), 'U')); $stats_graph_month = adrotate_stats($id, false, $monthstart, $monthend); // Prevent gaps in display if(empty($stats['impressions'])) $stats['impressions'] = 0; if(empty($stats['clicks'])) $stats['clicks'] = 0; if(empty($stats_today['impressions'])) $stats_today['impressions'] = 0; if(empty($stats_today['clicks'])) $stats_today['clicks'] = 0; if(empty($stats_last_month['impressions'])) $stats_last_month['impressions'] = 0; if(empty($stats_last_month['clicks'])) $stats_last_month['clicks'] = 0; if(empty($stats_this_month['impressions'])) $stats_this_month['impressions'] = 0; if(empty($stats_this_month['clicks'])) $stats_this_month['clicks'] = 0; if(empty($stats_graph_month['impressions'])) $stats_graph_month['impressions'] = 0; if(empty($stats_graph_month['clicks'])) $stats_graph_month['clicks'] = 0; // Get Click Through Rate $ctr = adrotate_ctr($stats['clicks'], $stats['impressions']); $ctr_today = adrotate_ctr($stats_today['clicks'], $stats_today['impressions']); $ctr_last_month = adrotate_ctr($stats_last_month['clicks'], $stats_last_month['impressions']); $ctr_this_month = adrotate_ctr($stats_this_month['clicks'], $stats_this_month['impressions']); $ctr_graph_month = adrotate_ctr($stats_graph_month['clicks'], $stats_graph_month['impressions']); ?>