get_var("SELECT `id` FROM `{$wpdb->prefix}adrotate` WHERE `type` = 'empty' ORDER BY `id` DESC LIMIT 1;"); if($edit_id == 0) { $wpdb->insert($wpdb->prefix."adrotate", array('title' => '', 'bannercode' => '', 'thetime' => $now, 'updated' => $now, 'author' => $userdata->user_login, 'imagetype' => 'dropdown', 'image' => '', 'paid' => 'U', 'tracker' => 'N', 'desktop' => 'Y', 'mobile' => 'Y', 'tablet' => 'Y', 'os_ios' => 'Y', 'os_android' => 'Y', 'os_other' => 'Y', 'responsive' => 'N', 'type' => 'empty', 'weight' => 6, 'autodelete' => 'N', 'budget' => 0, 'crate' => 0, 'irate' => 0, 'cities' => serialize(array()), 'countries' => serialize(array()))); $edit_id = $wpdb->insert_id; $wpdb->insert($wpdb->prefix.'adrotate_schedule', array('name' => 'Schedule for ad '.$edit_id, 'starttime' => $now, 'stoptime' => $in84days, 'maxclicks' => 0, 'maximpressions' => 0, 'spread' => 'N', 'daystarttime' => '0000', 'daystoptime' => '0000', 'day_mon' => 'Y', 'day_tue' => 'Y', 'day_wed' => 'Y', 'day_thu' => 'Y', 'day_fri' => 'Y', 'day_sat' => 'Y', 'day_sun' => 'Y', 'autodelete' => 'N')); $schedule_id = $wpdb->insert_id; $wpdb->insert($wpdb->prefix.'adrotate_linkmeta', array('ad' => $edit_id, 'group' => 0, 'user' => 0, 'schedule' => $schedule_id)); } $ad_edit_id = $edit_id; } $edit_banner = $wpdb->get_row("SELECT * FROM `{$wpdb->prefix}adrotate` WHERE `id` = {$ad_edit_id};"); $groups = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}adrotate_groups` WHERE `name` != '' ORDER BY `id` ASC;"); $schedules = $wpdb->get_row("SELECT `{$wpdb->prefix}adrotate_schedule`.`id`, `starttime`, `stoptime`, `maxclicks`, `maximpressions` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `group` = 0 AND `user` = 0 AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `{$wpdb->prefix}adrotate_schedule`.`id` ASC LIMIT 1;"); $linkmeta = $wpdb->get_results("SELECT `group` FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = {$edit_banner->id} AND `user` = 0 AND `schedule` = 0;"); wp_enqueue_media(); wp_enqueue_script('uploader-hook', plugins_url().'/adrotate/library/uploader-hook.js', array('jquery')); list($sday, $smonth, $syear, $shour, $sminute) = explode(" ", date("d m Y H i", $schedules->starttime)); list($eday, $emonth, $eyear, $ehour, $eminute) = explode(" ", date("d m Y H i", $schedules->stoptime)); $meta_array = array(); foreach($linkmeta as $meta) { $meta_array[] = $meta->group; } // Affiliate Partners $partners = array( "medianet" => array( "url" => "http://ajdg.link/medianet", "alt" => "Media.net", "image" => "medianet.jpg" ), "clicksor" => array( "url" => "http://ajdg.link/clicksor", "alt" => "Clicksor", "image" => "clicksor.png" ), "viglink" => array( "url" => "http://ajdg.link/viglink", "alt" => "VigLink", "image" => "viglink.png" ), ); shuffle($partners); $partners = array_slice($partners, 0, 2); if($ad_edit_id) { if($edit_banner->type != 'empty') { // Errors if(strlen($edit_banner->bannercode) < 1 AND $edit_banner->type != 'empty') echo '

'. __('The AdCode cannot be empty!', 'adrotate').'

'; if(!preg_match("/(%image%|%asset%)/i", $edit_banner->bannercode, $things) AND $edit_banner->image != '') echo '

'. __('You did not use %asset% (or %image%) in your AdCode but did select a file to use!', 'adrotate-pro').'

'; if(preg_match("/(%image%|%asset%)/i", $edit_banner->bannercode, $things) AND $edit_banner->image == '') echo '

'. __('You did use %asset% (or %image%) in your AdCode but did not select a file to use!', 'adrotate-pro').'

'; if((($edit_banner->imagetype != '' AND $edit_banner->image == '') OR ($edit_banner->imagetype == '' AND $edit_banner->image != ''))) echo '

'. __('There is a problem saving the image. Please reset your image and re-save the ad!', 'adrotate').'

'; if(!preg_match_all('/<(a|script|embed|iframe)[^>](.*?)>/i', stripslashes(htmlspecialchars_decode($edit_banner->bannercode, ENT_QUOTES)), $things) AND $edit_banner->tracker == 'Y') echo '

'. __("Tracking is enabled but no valid link/tag was found in the adcode!", 'adrotate').'

'; // Ad Notices $adstate = adrotate_evaluate_ad($edit_banner->id); if($edit_banner->type == 'error' AND $adstate == 'active') echo '

'. __('AdRotate cannot find an error but the ad is marked erroneous, try re-saving the ad!', 'adrotate').'

'; if($adstate == 'expired') echo '

'. __('This ad is expired and currently not shown on your website!', 'adrotate').'

'; if($adstate == '2days') echo '

'. __('The ad will expire in less than 2 days!', 'adrotate').'

'; if($adstate == '7days') echo '

'. __('This ad will expire in less than 7 days!', 'adrotate').'

'; if($edit_banner->type == 'disabled') echo '

'. __('This ad has been disabled and does not rotate on your site!', 'adrotate').'

'; // Depreciated stuff if($edit_banner->responsive == 'Y') echo '

'. __('This advert uses the obsolete Responsive feature. Please use the more reliable Mobile feature! Saving the advert will disable the responsive option silently.', 'adrotate').'

'; } } // Determine image field if($edit_banner->imagetype == "field") { $image_field = $edit_banner->image; $image_dropdown = ''; } else if($edit_banner->imagetype == "dropdown") { $image_field = ''; $image_dropdown = $edit_banner->image; } else { $image_field = ''; $image_dropdown = ''; } ?>
type == 'empty') { ?>

type != 'empty') { ?> 0) { ?>

<a href="https://ajdg.solutions/"><img src="%asset%" /></a>

<iframe src="%asset%" height="250" frameborder="0" style="border:none;"></iframe>

\"".$partner['alt']."\" "; } ?>

%id%, %asset%, %title%, %random%, target="_blank", rel="nofollow"

id); ?>




.

[adrotate banner="id; ?>"] <?php echo adrotate_ad(id; ?>); ?>

.


!

Select Countries and or Regions

United States
Australia
Germany
Brazil
Japan
Netherlands
Mexico
Canada
South Africa

Enter cities, metro IDs, States or State ISO codes


(Alkmaar, New York, Manila, Tokyo)

, .

[adrotate banner="id; ?>"] <?php echo adrotate_ad(id; ?>); ?>

adspeed > 0) $adspeed = $group->adspeed / 1000; if($group->modus == 0) $modus[] = __('Default', 'adrotate'); if($group->modus == 1) $modus[] = __('Dynamic', 'adrotate').' ('.$adspeed.' '. __('second rotation', 'adrotate').')'; if($group->modus == 2) $modus[] = __('Block', 'adrotate').' ('.$group->gridrows.' x '.$group->gridcolumns.' '. __('grid', 'adrotate').')'; if($group->cat_loc > 0 OR $group->page_loc > 0) $modus[] = __('Post Injection', 'adrotate'); if($group->geo == 1 AND $adrotate_config['enable_geo'] > 0) $modus[] = __('Geolocation', 'adrotate'); $ads_in_group = $wpdb->get_var("SELECT COUNT(*) FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `group` = ".$group->id." AND `user` = 0 AND `schedule` = 0;"); $class = ('alternate' != $class) ? 'alternate' : ''; ?>
id, $meta_array)) echo "checked"; ?> /> id; ?> - name; ?>'.__('Mode', 'adrotate').': '.implode(', ', $modus); ?>