This repository has been archived by the owner on Dec 2, 2023. It is now read-only.
forked from MoeMoeFish/MoegirlAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -16,7 +16,7 @@ public static function onSkinAfterContent(&$data, $skin) { | |
global $wgMoegirlADBottomADCode; | ||
|
||
if (MoegirlADHooks::shouldShowADs()) { | ||
$data .= $wgMoegirlADBottomADCode; | ||
$data .= $wgMoegirlADBottomADCode; | ||
} | ||
|
||
return true; | ||
|
@@ -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; | ||
} | ||
|
||
|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters