function adrotate_preview($banner_id) { global $wpdb, $adrotate_debug; if ($banner_id) { $now = adrotate_now(); $banner = $wpdb->get_row($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}adrotate` WHERE `id` = %d;", $banner_id)); if ($adrotate_debug['general'] == true) { echo "<p><strong>[DEBUG][adrotate_preview()] Ad information</strong><pre>"; print_r($banner); echo "</pre></p>"; } if ($banner) { $image = str_replace('%folder%', '/wp-content/banners/', $banner->image); $output = adrotate_ad_output($banner->id, 0, $banner->title, $banner->bannercode, $banner->tracker, $image, 'N'); } else { $output = adrotate_error('ad_expired'); } } else { $output = adrotate_error('ad_no_id'); } return $output; }
} ?> </tbody> </table> <h3><?php _e('Preview', 'adrotate-pro'); ?> </h3> <table class="widefat" style="margin-top: .5em"> <tbody> <tr> <td colspan="5"> <div><?php $image = str_replace('%folder%', $adrotate_config['banner_folder'], $banner->image); echo adrotate_ad_output($banner->id, 0, $banner->title, $banner->bannercode, $banner->tracker, $image, 'N'); ?> </div> <br /><em><?php _e('Note: While this preview is an accurate one, it might look different then it does on the website.', 'adrotate-pro'); ?> <br /><?php _e('This is because of CSS differences. The themes CSS file is not active here!', 'adrotate-pro'); ?> </em> </td> </tr> </tbody> </table>