The AetGoogleAdSense extension lets you display Google AdSense in wiki pages and you can set up some settings.
- PHP 7.4.3 or later (tested up to 7.4.30)
- MediaWiki 1.35 or later (tested up to 1.35)
git clone git@github.com:exizt/mediawiki-extension-AetGoogleAdSense.git AetGoogleAdSense
- Download and place the files in a directory called
AetGoogleAdSense
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:
wfLoadExtension( 'AetGoogleAdSense' );
주요 설정
$wgAetGoogleAdsense['client_id']
- Google AdSense Client Id. (eg:
'ca-pub-xxx...'
)required
- type :
string
- default :
''
- Google AdSense Client Id. (eg:
$wgAetGoogleAdsense['unit_id_content_top']
- 콘텐츠 상단에 표시할 애드센스 광고 단위 아이디 (eg:
xxx...
)- type :
string
- default :
''
- type :
- 콘텐츠 상단에 표시할 애드센스 광고 단위 아이디 (eg:
$wgAetGoogleAdsense['unit_id_content_bottom']
- 콘텐츠 히단에 표시할 애드센스 광고 단위 아이디 (eg:
xxx...
)- type :
string
- default :
''
- type :
- 콘텐츠 히단에 표시할 애드센스 광고 단위 아이디 (eg:
$wgAetGoogleAdsense['anon_only']
- '비회원'만 애드센스 노출하기.
- type :
bool
- default :
false
- type :
- '비회원'만 애드센스 노출하기.
$wgAetGoogleAdsense['exclude_ip_list']
- 애드센스를 보여주지 않을 IP 목록.
- type :
array
- default :
[]
- type :
- 애드센스를 보여주지 않을 IP 목록.
$wgAetGoogleAdsense['min_length']
- 애드센스가 보여질 최소 문서의 본문 길이.
- type :
int
- default :
500
- type :
- 애드센스가 보여질 최소 문서의 본문 길이.
사용할 훅 설정
$wgAetGoogleAdsenseHooks['ArticleViewHeader']
- type :
bool
- default :
true
- type :
$wgAetGoogleAdsenseHooks['SiteNoticeAfter']
- type :
bool
- default :
false
- type :
$wgAetGoogleAdsenseHooks['ArticleViewFooter']
- type :
bool
- default :
true
- type :
$wgAetGoogleAdsenseHooks['SkinAfterContent']
- type :
bool
- default :
false
- type :
참고
client_id
가 입력되고,unit_id_content_top
과unit_id_content_bottom
이 입력 안 된 경우는 => 자동 광고만 허가.client_id
가 빈 값이거나 없는 경우에는 동작하지 않음.