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;"); $activebanners = $errorbanners = $disabledbanners = 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'; if($type == 'active' OR $type == '7days') { $activebanners[$singlebanner->id] = array( 'id' => $singlebanner->id, 'title' => $singlebanner->title, 'type' => $type, 'tracker' => $singlebanner->tracker, 'weight' => $singlebanner->weight, 'firstactive' => $starttime, 'lastactive' => $stoptime ); } if($type == 'error' OR $type == 'expired' OR $type == '2days') { $errorbanners[$singlebanner->id] = array( 'id' => $singlebanner->id, 'title' => $singlebanner->title, 'type' => $type, 'tracker' => $singlebanner->tracker, 'weight' => $singlebanner->weight, 'firstactive' => $starttime, 'lastactive' => $stoptime ); } if($type == 'disabled') { $disabledbanners[$singlebanner->id] = array( 'id' => $singlebanner->id, 'title' => $singlebanner->title, 'type' => $type, 'tracker' => $singlebanner->tracker, 'weight' => $singlebanner->weight, 'firstactive' => $starttime, 'lastactive' => $stoptime ); } } ?>
|

0) adrotate_status($status); ?>
| |

0) adrotate_status($status, array('error' => $error)); ?>