All pastes #743958 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-10-20 22:59 UTC
rendered paste body
<?php

if(!APP) exit;

class GoogleAdsenseTag extends TemplateTag
{
	public function parse()
	{
		$this->pub = str_replace('pub-', null, $this->pub);
		
		$properties = array(
			'google_ad_client' => "pub-{$this->pub}",
			'google_alternate_color' => $this->alt-color,
			'google_ad_width' => $this->width,
			'google_ad_height' => $this->height,
			'google_ad_format' => $this->format,
			'google_ad_type' => $this->type,
			'google_ad_channel' => $this->channel,
			'google_color_border' => $this->border-color,
			'google_color_bg' => $this->backgorund-color,
			'google_color_link' => $this->link-color,
			'google_color_text' => $this->text-color,
			'google_color_url' => $this->url-color
		);
		
		$eol = "\n";
		
		$html .= '<script type="text/javascript">' . $eol;
		$html .= '<!--' . $eol;
			foreach($properties as $key => $value) {
				$html .= "{$key} = \"{$value}\";" . $eol;
			}
		$html .= '//-->' . $eol;
		$html .= '</script>' . $eol;
		$html .= '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
				
		return $html;
	}
}

?>