Extension:FooterManager

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

Release status: stable

Implementation Skin
Description Allow footer configuration.
Author(s) SimonLitt
Latest version 0.0.1 (2011-09-07)
MediaWiki 1.17.0+
License GPL
Download Download code
Parameters

$wgFooterManagerLinks,
$wgFooterManagerBanners,
$wgFooterManagerDefBannersBlock,
$wgFooterShowPoweredbyMwIcon

Hooks used
BeforePageDisplay

SkinTemplateOutputPageBeforeExec

Translate the FooterManager extension if possible

Check usage and version matrix; code metrics

What can this extension do?[edit | edit source]

Allow footer configuration.

The extension can be used to:

  • disable unnecessary links in the footer;
  • add banners (usually analytic systems);
  • add scripts for analytic systems, for example Google Analytics, which does not require the addition of any banners.

Installation[edit | edit source]

  • Download the latest version and extract it into the extensions folder of your MediaWiki installation.
  • Enable the extension by adding this line to your LocalSettings.php:
    require_once('extensions/FooterManager/FooterManager.php');
    

Configuration parameters[edit | edit source]

There are various options for extension, you can put them into your LocalSettings.php file line.

Footer links configuration[edit | edit source]

$wgFooterManagerLinks
an array defining the footer links settings.

You can disable standard footer links. List or available links you can find at Manual:Footer page.

$wgFooterManagerLinks['numberofwatchingusers']=false;
$wgFooterManagerLinks['credits']=false;
$wgFooterManagerLinks['copyright']=false;
$wgFooterManagerLinks['tagline']=false;
$wgFooterManagerLinks['privacy']=false;
$wgFooterManagerLinks['about']=false;

Setting footer banners[edit | edit source]

$wgFooterManagerBanners
an array defining the banners.

The following keys are used:

headscript
Add <script> tags (e.g. for Javascript) to the page's head section;
icon
the string it will be output directly as html at the footer;
bottomscript
Add <script> tags (e.g. for Javascript) to the bottom of the page's body;
block
Is key of the $wgFooterIcons array.
#first banner
$wgFooterManagerBanners[] = array(
'headscript' => '<script type="text/javascript" src="http://mysite.com/example1.js?9999999"></script>',
'icon' => '<img src="http://mysite.com/banner.png?9999999" alt="My banner" />',
'bottomscript' =>'<script type="text/javascript" src="http://mysite.com/example2.js?9999999"></script>',
 
#second banner
$wgFooterManagerBanners[] = array(
'icon' => '<a href="http://mysite.com/"><img src="http://mysite.com/partnerBanner.png" alt="My banner" /></a>',
'block' => 'partnerBanners',

To add a typical banner of which you have HTML code use:

#HTML banner
$wgFooterManagerBanners[] = array(
'icon' => '<a href="http://www.mathjax.org/">
  <img title="Powered by MathJax"
       src="http://www.mathjax.org/badge.gif"
       border="0" alt="Powered by MathJax" />
</a>',
);

Google Analytics configuration example:

$wgFooterManagerBanners[] = array(
'bottomscript' => "<script type=\"text/javascript\">  
var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-99999999-9']);  
_gaq.push(['_setDomainName', '.mysite.com']);  _gaq.push(['_setAllowHash', 'false']);  
_gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); 
ga.type = 'text/javascript'; ga.async = true; 
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';  
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
</script>",
);

In simple cases it is convenient to use a standard mechanism:

#add banner 
$wgFooterIcons['analyticsystems']=array(
#rambler Top100
'<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?9999999"></script>
<noscript>
<a href="http://top100.rambler.ru/navi/9999999/">
<img src="http://counter.rambler.ru/top100.cnt?9999999" alt="Rambler\'s Top100" border="0" />
</a>
</noscript>',
);

instead of:

$wgFooterManagerBanners[] = array(
'icon' => '<script id="top100Counter" type="text/javascript" src="http://counter.rambler.ru/top100.jcn?9999999"></script>
<noscript>
<a href="http://top100.rambler.ru/navi/9999999/">
<img src="http://counter.rambler.ru/top100.cnt?9999999" alt="Rambler\'s Top100" border="0" />
</a>
</noscript>',

but the result will be the same.

$wgFooterManagerDefBannersBlock
default banners block (key of the $wgFooterIcons array). Default is analyticsystems.
$wgFooterManagerDefBannersBlock = 'partnerBanners';

Show Powered by MediaWiki image in the footer[edit | edit source]

$wgFooterShowPoweredbyMwIcon
enable Powered by MediaWiki image. Default is true.
$wgFooterShowPoweredbyMwIcon = false;
# Remove the Powered by MediaWiki image in the footer

See also[edit | edit source]

Language: English  • русский