diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 23:17:54 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 23:17:54 +0200 |
commit | 9f38be46358e62f33ae2c556269a0223963edc26 (patch) | |
tree | 85900d9fcbef998787419486db3c7c27fb5f3851 | |
parent | 28e0141d1be2df023bd0544886189aaf07508188 (diff) |
implement ads for archlinux.org as plugin
-rw-r--r-- | extensions/ArchLinuxAds.php | 37 | ||||
-rw-r--r-- | skins/ArchLinux.php | 3 |
2 files changed, 38 insertions, 2 deletions
diff --git a/extensions/ArchLinuxAds.php b/extensions/ArchLinuxAds.php new file mode 100644 index 00000000..f95288da --- /dev/null +++ b/extensions/ArchLinuxAds.php @@ -0,0 +1,37 @@ +<?php + +$wgExtensionCredits['other'][] = array( + 'name' => 'ArchLinuxAds', + 'version' => '1.0', + 'description' => 'Display ads on wiki.archlinux.org', + 'author' => 'Pierre Schmitz', + 'url' => 'http://www.archlinux.org' +); + +$wgHooks['SkinAfterBottomScripts'][] = 'ArchLinuxAds::addAds'; + + +class ArchLinuxAds { + +public static function addAds($skin, $text) { + $text .= '<div style="z-index:0; position:absolute; top:40px; right:10px;"> + <script type="text/javascript"><!-- + google_ad_client = "pub-3170555743375154"; + google_ad_width = 468; + google_ad_height = 60; + google_ad_format = "468x60_as"; + google_color_border = "ffffff"; + google_color_bg = "ffffff"; + google_color_link = "0771A6"; + google_color_url = "99AACC"; + google_color_text = "000000"; + //--></script> + <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> + </div>'; + + return true; +} + +} + +?> diff --git a/skins/ArchLinux.php b/skins/ArchLinux.php index 260f8039..cd0fecfe 100644 --- a/skins/ArchLinux.php +++ b/skins/ArchLinux.php @@ -60,7 +60,7 @@ class ArchLinuxTemplate extends QuickTemplate { * @access private */ function execute() { - global $wgRequest, $wgArchNavBar, $wgArchNavBarSelected, $wgAds; + global $wgRequest, $wgArchNavBar, $wgArchNavBarSelected; $this->skin = $skin = $this->data['skin']; $action = $wgRequest->getText( 'action' ); @@ -129,7 +129,6 @@ class ArchLinuxTemplate extends QuickTemplate { ?> </ul> </div> - <?php if (isset($wgAds)) {echo $wgAds;} ?> <div id="subnav_bar"></div> <?php } ?> |