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

Commit

Permalink
Add ID support.
Browse files Browse the repository at this point in the history
  • Loading branch information
imbushuo committed Jun 15, 2017
1 parent a2e8ad7 commit 6b504b6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
22 changes: 14 additions & 8 deletions MoegirlAD.hooks.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/*
* Static class for hooks handle by MoegirlAD.
*
*
* @file MoegirlAD.hooks.php
*
*
* @license Apache-2.0+
* @author Fish Thirteen < [email protected] >
* @author Baskice
Expand All @@ -16,7 +16,7 @@ public static function onSkinAfterContent(&$data, $skin) {
global $wgMoegirlADBottomADCode;

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

return true;
Expand All @@ -36,8 +36,8 @@ public static function onSiteNoticeAfter(&$siteNotice, $skin) {
} else if ($isMobileView) {
// Fix by case: Since MobileFrontend will display SiteNotice for some users, clear site notice if we are in mobile view.
$siteNotice = '';
}
}

return true;
}

Expand All @@ -54,19 +54,25 @@ public static function onSkinAfterBottomScripts( $skin, &$text ) {

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

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

return true;
}

/**
* @param array $ids
*/
public static function onGetDoubleUnderscoreIDs( array &$ids ) {
$ids[] = 'suppressad';
}

/**
* Check if the advertice should be display
*
* @return boolean
*
* @return boolean
*/
public static function shouldShowADs() {
global $wgMoegirlADEnabled, $wgMoegirlADEditCountQualification;
Expand Down
5 changes: 3 additions & 2 deletions MoegirlAD.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'author' => array( 'Fish Thirteen', 'The Little Moe New LLC' ),
'url' => 'https://github.com/FishThirteen/MoegirlAD',
'description' => 'Show advertisement in the page header and page footer in Moegirlpedia',
'version' => 0.4,
'version' => 0.41,
'license-name' => "Apache-2.0+", // Short name of the license, links LICENSE or COPYING file if existing - string, added in 1.23.0
);
$wgExtensionMessagesFiles['MoegirlADMagic'] = __DIR__ . '/MoegirlAD.i18n.magic.php';
Expand Down Expand Up @@ -72,4 +72,5 @@
$wgHooks['SkinAfterContent'][] = 'MoegirlADHooks::onSkinAfterContent';
$wgHooks['SiteNoticeAfter'][] = 'MoegirlADHooks::onSiteNoticeAfter';
$wgHooks['SkinAfterBottomScripts'][] = 'MoegirlADHooks::onSkinAfterBottomScripts';
$wgHooks['SkinBuildSidebar'][] = 'MoegirlADHooks::onSkinBuildSidebar';
$wgHooks['SkinBuildSidebar'][] = 'MoegirlADHooks::onSkinBuildSidebar';
$wgHooks['GetDoubleUnderscoreIDs'][] = 'MoegirlADHooks::onGetDoubleUnderscoreIDs';

0 comments on commit 6b504b6

Please sign in to comment.