get_ad($ad); } } /* INITIALISATION All functions in here called at startup (after other plugins have loaded, in case we need to wait for the widget-plugin). */ class adsensem { var $benice=true; function get_ad_inline($ad=false) { $options = get_option('plugin_adsensem'); if($ad===false){$ad=$options['ads'][$options['defaults']['ad']];} $ad=$this->merge_defaults($ad); //Apply defaults $code=''; /* This test block determines whether to display the Ad in the current location. The home,single,archive,search tests only apply to Ads displayed inline, so we test for that here */ if( ($ad['show-home'] && is_home()) || ($ad['show-post'] && (is_single() || is_page())) || ($ad['show-archive'] && is_archive()) || ($ad['show-search'] && is_search()) ) { /* We passed the test, display the Ad */ $code.=$this->get_ad($ad); } return $code; } function get_ad($ad=false) { $options = get_option('plugin_adsensem'); if($ad===false){$ad=$options['ads'][$options['defaults']['ad']];} $ad=$this->merge_defaults($ad); //Apply defaults $code=''; /* Valid entry */ if(is_array($ad)){ //Default to Ad if($ad['product']=='link'){ $format = $ad['linkformat'] . $ad['linktype']; list($width,$height,$null)=split('[x]',$ad['linkformat']); } else { $format = $ad['adformat'] . '_as'; list($width,$height,$null)=split('[x]',$ad['adformat']); } $code .= $ad['html-before']; if($_GET['preview']){ /* We are in the editor, output fake */ $code .= '
'Use Default');
$formats['ads']['horizontal']=array('728x90' => '728 x 90 Leaderboard', '468x60' => '468 x 60 Banner', '234x60' => '234 x 60 Half Banner');
$formats['ads']['vertical']=array('120x600' => '120 x 600 Skyscraper', '160x600' => '160 x 600 Wide Skyscraper', '120x240' => '120 x 240 Vertical Banner');
$formats['ads']['square']=array('336x280' => '336 x 280 Large Rectangle', '300x250' => '300 x 250 Medium Rectangle', '250x250' => '250 x 250 Square', '200x200' => '200 x 200 Small Square', '180x150' => '180 x 150 Small Rectangle', '125x125' => '125 x 125 Button');
$formats['links']['horizontal']=array('728x15' => '728 x 15', '468x15' => '468 x 15');
$formats['links']['square']=array('200x90' => '200 x 90', '180x90' => '180 x 90', '160x90' => '160 x 90', '120x90' => '120 x 90');
$adtypes=array('text_image' => 'Text & Image', 'image' => 'Image Only', 'text' => 'Text Only');
$linktypes=array('_0ads_al' => '4 Ads Per Unit', '_0ads_al_s' => '5 Ads Per Unit');
$yesno=array(true => 'Yes', false => 'No');
$default=array('' => 'Use Default');
$products=array('ad' => 'Ad Unit','link' => 'Link Unit');
?>
BasicLayout |
Ad Colours
|
Inline AdsHTML Markup (Optional) | ||||||||||||||||||||||||||||||||||||||
Below are your currently created Ads. Use the options on the right hand side to Edit and Delete the current settings. Select the default Ad to indicate which Ad will be displayed when no specific ID is used.