function adrotate_notifications_dashboard() { global $adrotate_advert_status; if (current_user_can('adrotate_ad_manage')) { if (!is_array($adrotate_advert_status)) { $data = unserialize($adrotate_advert_status); } else { $data = $adrotate_advert_status; } if ($data['total'] > 0) { if ($data['expired'] > 0 and $data['expiressoon'] == 0 and $data['error'] == 0) { echo '<div class="error"><p>' . $data['expired'] . ' ' . __('active ad(s) expired.', 'adrotate') . ' <a href="admin.php?page=adrotate-ads">' . __('Take action now', 'adrotate') . '</a>!</p></div>'; } else { if ($data['expired'] == 0 and $data['expiressoon'] > 0 and $data['error'] == 0) { echo '<div class="error"><p>' . $data['expiressoon'] . ' ' . __('active ad(s) are about to expire.', 'adrotate') . ' <a href="admin.php?page=adrotate-ads">' . __('Check it out', 'adrotate') . '</a>!</p></div>'; } else { if ($data['expired'] == 0 and $data['expiressoon'] == 0 and $data['error'] > 0) { echo '<div class="error"><p>There are ' . $data['error'] . ' ' . __('active ad(s) with configuration errors.', 'adrotate') . ' <a href="admin.php?page=adrotate-ads">' . __('Solve this', 'adrotate') . '</a>!</p></div>'; } else { echo '<div class="error"><p>' . $data['expired'] . ' ' . __('ad(s) expired.', 'adrotate') . ' ' . $data['expiressoon'] . ' ' . __('ad(s) are about to expire.', 'adrotate') . ' There are ' . $data['error'] . ' ' . __('ad(s) with configuration errors.', 'adrotate') . ' <a href="admin.php?page=adrotate-ads">' . __('Fix this as soon as possible', 'adrotate') . '</a>!</p></div>'; } } } } if (isset($_GET['hide']) and $_GET['hide'] == 1) { update_option('adrotate_hide_banner', 1); } if (isset($_GET['hide']) and $_GET['hide'] == 2) { update_option('adrotate_hide_review', 1); } if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = ''; } $pro_banner = get_option('adrotate_hide_banner'); if ($pro_banner != 1 and $pro_banner < adrotate_now() - 604800 and strpos($page, 'adrotate') !== false) { echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">'; echo ' <div class="adrotate_banner">'; echo ' <div class="button_div"><a class="button" target="_blank" href="https://ajdg.solutions/products/adrotate-for-wordpress/?add-to-cart=1126?pk_campaign=adrotatefree-upgradebanner">' . __('Buy now', 'adrotate') . '</a></div>'; echo ' <div class="text">' . __("You've been using <strong>AdRotate</strong> for a while now. Why not upgrade to the <strong>PRO</strong> version", 'adrotate') . '?<br /><span>' . __('Use discount code <b>getadrotatepro</b> for 10% off on any AdRotate license!', 'adrotate') . ' ' . __('Thank you for your purchase!', 'adrotate') . '</span></div>'; echo ' <a class="close_banner" href="admin.php?page=adrotate-pro&hide=1"><img title="Close" src="' . plugins_url('images/icon-close.png', __FILE__) . '" alt=""/></a>'; echo ' <div class="icon"><img title="" src="' . plugins_url('images/logo-60x60.png', __FILE__) . '" alt=""/></div>'; echo ' </div>'; echo '</div>'; } $review_banner = get_option('adrotate_hide_review'); if ($review_banner != 1 and $review_banner < adrotate_now() - 2419200 and strpos($page, 'adrotate') !== false) { echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">'; echo ' <div class="adrotate_banner">'; echo ' <div class="button_div"><a class="button" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/adrotate?rate=5#postform">Rate AdRotate</a></div>'; echo ' <div class="text">If you like <strong>AdRotate</strong> please let the world know that you do. Thanks for your support!<br /><span>If you have questions, suggestions or something else that doesn\'t belong in a review, please <a href="https://ajdg.solutions/forums/forum/adrotate-for-wordpress/?pk_campaign=adrotatefree-reviewbanner" target="_blank">get in touch</a>!</span></div>'; echo ' <a class="close_banner" href="admin.php?page=adrotate&hide=2"><img title="Close" src="' . plugins_url('images/icon-close.png', __FILE__) . '" alt=""/></a>'; echo ' <div class="icon"><img title="" src="' . plugins_url('images/logo-60x60.png', __FILE__) . '" alt=""/></div>'; echo ' </div>'; echo '</div>'; } } if (isset($_GET['upgrade']) and $_GET['upgrade'] == 1) { adrotate_check_upgrade(); } $adrotate_db_version = get_option("adrotate_db_version"); $adrotate_version = get_option("adrotate_version"); if ($adrotate_db_version['current'] < ADROTATE_DB_VERSION or $adrotate_version['current'] < ADROTATE_VERSION) { echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">'; echo ' <div class="adrotate_banner">'; echo ' <div class="button_div"><a class="button" href="admin.php?page=adrotate&upgrade=1">Update Now</a></div>'; echo ' <div class="text">You have almost finished upgrading <strong>AdRotate</strong> to version <strong>' . ADROTATE_DISPLAY . '</strong>!<br /><span>To complete the update click the button on the left. This may take a few seconds to complete!</span></div>'; echo ' <div class="icon"><img title="" src="' . plugins_url('images/logo-60x60.png', __FILE__) . '" alt=""/></div>'; echo ' </div>'; echo '</div>'; } }
function adrotate_notifications_dashboard() { global $adrotate_config, $adrotate_advert_status; if (current_user_can('adrotate_ad_manage')) { $license = get_option('adrotate_activate'); if ($adrotate_config['dashboard_notifications'] == "Y") { if (!is_array($adrotate_advert_status)) { $data = unserialize($adrotate_advert_status); } else { $data = $adrotate_advert_status; } if ($data['total'] > 0) { if ($data['expired'] > 0 and $data['expiressoon'] == 0 and $data['error'] == 0) { echo '<div class="error"><p>' . $data['expired'] . ' ' . __('active ad(s) expired.', 'adrotate-pro') . ' <a href="admin.php?page=adrotate-ads">' . __('Take action now', 'adrotate-pro') . '</a>!</p></div>'; } else { if ($data['expired'] == 0 and $data['expiressoon'] > 0 and $data['error'] == 0) { echo '<div class="error"><p>' . $data['expiressoon'] . ' ' . __('active ad(s) are about to expire.', 'adrotate-pro') . ' <a href="admin.php?page=adrotate-ads">' . __('Check it out', 'adrotate-pro') . '</a>!</p></div>'; } else { if ($data['expired'] == 0 and $data['expiressoon'] == 0 and $data['error'] > 0) { echo '<div class="error"><p>There are ' . $data['error'] . ' ' . __('active ad(s) with configuration errors.', 'adrotate-pro') . ' <a href="admin.php?page=adrotate-ads">' . __('Solve this', 'adrotate-pro') . '</a>!</p></div>'; } else { echo '<div class="error"><p>' . $data['expired'] . ' ' . __('ad(s) expired.', 'adrotate-pro') . ' ' . $data['expiressoon'] . ' ' . __('ad(s) are about to expire.', 'adrotate-pro') . ' There are ' . $data['error'] . ' ' . __('ad(s) with configuration errors.', 'adrotate-pro') . ' <a href="admin.php?page=adrotate-ads">' . __('Fix this as soon as possible', 'adrotate-pro') . '</a>!</p></div>'; } } } } if ($adrotate_config['enable_geo'] > 2) { $lookups = get_option('adrotate_geo_requests'); if ($license['status'] == 0 and $adrotate_config['enable_geo'] == 5) { echo '<div class="updated"><p>' . __('The AdRotate Geo service can only be used after you activate your license for this website.', 'adrotate-pro') . '</p></div>'; } if ($lookups > 0 and $lookups < 1000) { echo '<div class="updated"><p>' . sprintf(__('You are running out of Geo Lookups for AdRotate. You have less than %d remaining lookups. If this reaches 0, Geo Targeting will stop working.', 'adrotate-pro'), $lookups) . '</p></div>'; } if ($lookups < 1) { echo '<div class="updated"><p>' . __('AdRotate Geo Targeting is no longer working because you have no more lookups. If you think this is untrue, try resaving the Geo Targeting settings.', 'adrotate-pro') . '</p></div>'; } } } if (isset($_GET['hide']) and $_GET['hide'] == 2) { update_option('adrotate_hide_review', 1); } if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = ''; } $review_banner = get_option('adrotate_hide_review'); if ($review_banner != 1 and $review_banner < adrotate_now() - 2419200 and strpos($page, 'adrotate') !== false) { echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">'; echo ' <div class="adrotate_banner">'; echo ' <div class="button_div"><a class="button" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/adrotate?rate=5#postform">Rate AdRotate</a></div>'; echo ' <div class="text">If you like <strong>AdRotate</strong> please let the world know that you do. Thanks for your support!<br /><span>If you have questions, suggestions or something else that doesn\'t belong in a review, please <a href="https://ajdg.solutions/forums/forum/adrotate-for-wordpress/?pk_campaign=adrotatepro-reviewbanner&pk_kwd=forum" target="_blank">get in touch</a>!</span></div>'; echo ' <div class="icon"><img title="" src="' . plugins_url('images/adrotate-logo-60x60.png', __FILE__) . '" alt=""/></div>'; echo ' <a class="close_banner" href="admin.php?page=adrotate&hide=2"><img title="Close" src="' . plugins_url('images/icon-close.png', __FILE__) . '" alt=""/></a>'; echo ' </div>'; echo '</div>'; } if ($license['firstrun'] == 1) { echo '<div class="updated"><p>' . __('Register your copy of AdRotate. This will enable email support and update notifications right from your dashboard.', 'adrotate-pro') . ' <a href="admin.php?page=adrotate-settings" class="button">' . __('Register AdRotate', 'adrotate-pro') . '</a></p></div>'; update_option('adrotate_activate', array('status' => 0, 'instance' => '', 'activated' => '', 'deactivated' => '', 'type' => '', 'key' => '', 'email' => '', 'version' => '', 'firstrun' => 0)); } } if (isset($_GET['upgrade']) and $_GET['upgrade'] == 1) { adrotate_check_upgrade(); } $adrotate_db_version = get_option("adrotate_db_version"); $adrotate_version = get_option("adrotate_version"); if ($adrotate_db_version['current'] < ADROTATE_DB_VERSION or $adrotate_version['current'] < ADROTATE_VERSION) { echo '<div class="updated" style="padding: 0; margin: 0; border-left: none;">'; echo ' <div class="adrotate_banner">'; echo ' <div class="button_div"><a class="button" href="admin.php?page=adrotate&upgrade=1">Update Now</a></div>'; echo ' <div class="text">You have almost finished upgrading <strong>AdRotate</strong> to version <strong>' . ADROTATE_DISPLAY . '</strong>!<br /><span>To complete the update click the button on the left. This may take a few seconds to complete!</span></div>'; echo ' <div class="icon"><img title="" src="' . plugins_url('images/adrotate-logo-60x60.png', __FILE__) . '" alt=""/></div>'; echo ' </div>'; echo '</div>'; } }