Extension:S5h adsense filter

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
s5h_adsense_filter

Release status: beta

Implementation Parser extension
Description This extension adds google adsense code into the page text
Author(s) ed neville (enevilleTalk)
Last version 1.805
License GPL 2.1
Download http://www.s5h.net/code/mediawiki/s5h_adsense_filter/s5h_adsense_filter.php
Parameters

$wgs5hadsensefilter["ad_client"] = "ca-pub-8810238214716601", $wgs5hadsensefilter["ad_slot"] = "8325595742"

Hooks used
ParserAfterTidy

Check usage (experimental)

Contents

[edit] What can this extension do?

This extension provides Google Adsense code to page text. This is useful if you do not wish to modify skins in order to insert the adverts to every page.

I didn't find anything that worked for me by means of modifying skins so I decided to insert the adcode before the page text.

[edit] Usage

Download, install and modify the variables.

For example:

$ wget http://www.s5h.net/code/mediawiki/s5h_adsense_filter/s5h_adsense_filter.php

If you like this extension or have any comments/requests for it, please drop me a line.

[edit] Download instructions

Please download the s5h_adsense_filter.php code and install in $IP/extensions/. $IP should hold your LocalSettings.php, you should already have an extensions directory beneath this. In reality, providing PHP can read the directory where you decide to store this, there shouldn't be a problem, but using an extensions directory should keep the installation tidy.

You may verify the PGP signature of this if you wish (http://www.s5h.net/wiki/Gpg).

[edit] Installation

To install this extension, add the code to LocalSettings.php:

require_once("$IP/extensions/s5h_adsense_filter.php");
$wgs5hadsensefilter["ad_client"] = "ca-pub-8810238214716601";
$wgs5hadsensefilter["ad_slot"] = "8325595742";

[edit] Configuration parameters

$wgs5hadsensefilter["ad_client"] = "ca-pub-8810238214716601";

Google will provide you with your own ad_client variables.

$wgs5hadsensefilter["ad_slot"] = "8325595742";

You will be provided with the ad_slot variable by Google.

[edit] Additional features

Version 1.800 allows for additional parameters to be configured, these include:

  • $wgs5hadsensefilter["max_adverts"]

Define this in your LocalSettings.php as the number of adverts which can be displayed.

Example:

$wgs5hadsensefilter["max_adverts"] = 3;
  • $wgs5hadsensefilter["page_start"]

This contains a TRUE/FALSE value as to weather the advert is displayed at the top of the page (before any other article text).

Example:

$wgs5hadsensefilter["page_start"] = TRUE;
  • $wgs5hadsensefilter["h1"]

This contains a TRUE/FALSE value as to weather the advert can be displayed in a

<h1>

paragraph.

Example:

$wgs5hadsensefilter["h1"] = TRUE;
  • $wgs5hadsensefilter["h2"]

See above h1 definition.

  • $wgs5hadsensefilter["h3"]

See above h1 definition.

  • $wgs5hadsensefilter["h4"]

See above h1 definition.

  • $wgs5hadsensefilter["h5"]

See above h1 definition.

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox