Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
add footer and sidebar ads
Browse files Browse the repository at this point in the history
  • Loading branch information
Fish Thirteen committed Jun 10, 2014
1 parent 7daf88e commit 9dc4b1e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
21 changes: 19 additions & 2 deletions MoegirlAD.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
final class MoegirlADHooks {

public static function onSkinAfterContent(&$data, Skin $skin) {
public static function onSkinAfterContent(&$data, $skin) {
global $wgMoegirlADBottomADCode;

if (MoegirlADHooks::shouldShowADs()) {
$data .= $wgMoegirlADTopADCode;
$data .= $wgMoegirlADBottomADCode;
}
}

Expand All @@ -26,6 +26,23 @@ public static function onSiteNoticeAfter(&$siteNotice, $skin) {
}
}

public static function onSkinAfterBottomScripts( $skin, &$text ) {
global $wgMoegirlADFooterADCode;

if (MoegirlADHooks::shouldShowADs()) {
$text .= $wgMoegirlADFooterADCode;
}
}


public static function onSkinBuildSidebar( Skin $skin, &$bar ) {
global $wgMoegirlADSideBarADName, $wgMoegirlADSideBarADCode;

if (MoegirlADHooks::shouldShowADs()) {
$bar[$wgMoegirlADSideBarADName] = $wgMoegirlADSideBarADCode;
}
}


/**
* Check if the advertice should be display
Expand Down
18 changes: 16 additions & 2 deletions MoegirlAD.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* - determine if show advertisement in moegirl.
*
* $wgMoegirlADTopADCode
* - The adverticement code form the advertising company in top bar
* - the adverticement code form the advertising company in top bar
* E.g.
* $wgMoegirlADADCode = <<<EOD
* <!-- 728*90 -->
Expand All @@ -30,12 +30,24 @@
* EOD;
*
* $wgMoegirlADBottomADCode
- The adverticement code in bottom bar
* - the adverticement code in bottom bar
*
* $wgMoegirADFooterADCode
* - the adverticement code used to show in below of the footer
*
* $wgMoegirlADSideBarADName
* - the side bar group name
*
* $wgMoegirlADSideBarADCode
* - the adverticement code used to show in the bottom of the side bar
*
*/
$wgMoegirlADEnabled = true;
$wgMoegirlADTopADCode = "";
$wgMoegirlADBottomADCode = "";
$wgMoegirlADFooterADCode = "";
$wgMoegirlADSideBarADName = "";
$wgMoegirlADSideBarADCode = "";



Expand All @@ -44,5 +56,7 @@

$wgHooks['SkinAfterContent'][] = 'MoegirlADHooks::onSkinAfterContent';
$wgHooks['SiteNoticeAfter'][] = 'MoegirlADHooks::onSiteNoticeAfter';
$wgHooks['SkinAfterBottomScripts'][] = 'MoegirlADHooks::onSkinAfterBottomScripts';
$wgHooks['SkinBuildSidebar'][] = 'MoegirlADHooks::onSkinBuildSidebar';

?>

0 comments on commit 9dc4b1e

Please sign in to comment.