0) adrotate_status($status, array('file' => $file));
$allbanners = $wpdb->get_results("SELECT `id`, `title`, `type`, `tracker`, `weight` FROM `{$wpdb->prefix}adrotate` WHERE (`type` != 'empty' OR `type` != 'a_empty' OR `type` != 'queue') ORDER BY `id` ASC;");
$active = $disabled = $error = false;
foreach($allbanners as $singlebanner) {
$starttime = $stoptime = 0;
$starttime = $wpdb->get_var("SELECT `starttime` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = '".$singlebanner->id."' AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `starttime` ASC LIMIT 1;");
$stoptime = $wpdb->get_var("SELECT `stoptime` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = '".$singlebanner->id."' AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `stoptime` DESC LIMIT 1;");
$type = $singlebanner->type;
if($type == 'active' AND $stoptime <= $in7days) $type = '7days';
if($type == 'active' AND $stoptime <= $in2days) $type = '2days';
if($type == 'active' AND $stoptime <= $now) $type = 'expired';
$title = (strlen($singlebanner->title) == 0) ? 'Advert '.$singlebanner->id.' [temp]' : $singlebanner->title;
if($type == 'active' OR $type == '7days') {
$active[$singlebanner->id] = array(
'id' => $singlebanner->id,
'title' => $title,
'type' => $type,
'tracker' => $singlebanner->tracker,
'weight' => $singlebanner->weight,
'firstactive' => $starttime,
'lastactive' => $stoptime
);
}
if($type == 'error' OR $type == 'expired' OR $type == '2days') {
$error[$singlebanner->id] = array(
'id' => $singlebanner->id,
'title' => $title,
'type' => $type,
'tracker' => $singlebanner->tracker,
'weight' => $singlebanner->weight,
'firstactive' => $starttime,
'lastactive' => $stoptime
);
}
if($type == 'disabled') {
$disabled[$singlebanner->id] = array(
'id' => $singlebanner->id,
'title' => $title,
'type' => $type,
'tracker' => $singlebanner->tracker,
'weight' => $singlebanner->weight,
'firstactive' => $starttime,
'lastactive' => $stoptime
);
}
}
?>
0) adrotate_status($status); ?>
0) adrotate_status($status, array('file' => $file)); ?>
get_row("SELECT SUM(`clicks`) as `clicks`, SUM(`impressions`) as `impressions` FROM `{$wpdb->prefix}adrotate_stats` WHERE `thetime` >= {$monthstart} AND `thetime` <= {$monthend};", ARRAY_A);
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_alltime = adrotate_ctr($stats['overall_clicks'], $stats['overall_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']);
include("dashboard/publisher/statistics-main.php");
} else if($view == "advert") {
include("dashboard/publisher/statistics-advert.php");
} else if($view == "group") {
include("dashboard/publisher/statistics-group.php");
}
?>
0 AND wp_verify_nonce($_REQUEST['_wpnonce'], 'adrotate_delete_media_'.$file)) {
if(adrotate_unlink($file)) {
$status = 206;
} else {
$status = 207;
}
}
?>
0) adrotate_status($status); ?>
- !
0) adrotate_status($status, array('error' => $error)); ?>