/** * Get the html code for a random banner of the given zone */ function get_wpads($the_zone) { global $doing_rss; if ($the_zone == "") { return; } // No ads in RSS feeds if ($doing_rss) { return; } // are we in wp-admin editing the post? if (strstr($_SERVER['PHP_SELF'], 'post.php')) { // **TODO**: show placeholders return; } $banners = new Banners(); $donate = get_option('wpads_donate'); $theBanner = $banners->getZoneBanner($the_zone, $donate); $banners->addView($theBanner->banner_id); return $theBanner->banner_html; }