Example #1
0
 public function GetChunk()
 {
     if ($this->IsActive()) {
         $title = str_replace(' ', '_', $this->title);
         $return = '<div class="adblock-' . strtolower($title) . '">' . "\n";
         if ($this->ad_mode == 2) {
             $return .= stripcslashes($this->ad_code);
         } elseif ($this->ad_mode == 3) {
             $the_block =& OnePanelConfig::GetAdBlock($this->title);
             $the_palette =& $the_block->GetPalette(OnePanelTheme::GetActiveSkin()->GetName());
             $return .= '<script type="text/javascript"><!--' . "\n";
             $return .= 'google_ad_client = "' . $this->adsense_id . '";' . "\n";
             $return .= 'google_ad_width = "' . $the_block->GetWidth() . '";' . "\n";
             $return .= 'google_ad_height = "' . $the_block->GetHeight() . '";' . "\n";
             $return .= 'google_ad_format = "' . $the_block->GetWidth() . 'x' . $the_block->GetHeight() . '_as";' . "\n";
             $return .= 'google_ad_type = "text_image";' . "\n";
             $return .= 'google_color_border = "' . $the_palette->GetBorderColor() . '";' . "\n";
             $return .= 'google_color_bg = "' . $the_palette->GetBackgroundColor() . '";' . "\n";
             $return .= 'google_color_link = "' . $the_palette->GetLinkColor() . '";' . "\n";
             $return .= 'google_color_text = "' . $the_palette->GetTextColor() . '";' . "\n";
             $return .= 'google_color_url = "' . $the_palette->GetUrlColor() . '";' . "\n";
             $return .= is_null($this->adsense_channel) ? '' : 'google_ad_channel = "' . $this->adsense_channel . '";' . "\n";
             $return .= '//--></script>' . "\n";
             $return .= '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">' . "\n";
             $return .= '</script>' . "\n";
         }
         $return .= '</div>' . "\n";
         return $return;
     }
 }