This post shows how to insert code that displays ads in MediaWiki. The proposed methods use hooks instead of modifying the skin. This has two advantages:
- No need to modify each skin separately. This allows users to change skins and ads will be presented to them in the same logical place.
- It makes upgrades simpler. Hooks reside in
LocalSettings.php
which isn’t modified by MediaWiki version upgrades, unlike skins.
The examples below show how to insert ads into the header, footer and sidebar of each page. I’ve used the Google Adsense ad-serving code, but it could be easily replaced by the ad-serving code of any other ad network.
Continue reading Displaying Google Adsense in MediaWiki