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('error' => $error)); ?>