Manual:Botclasses.php

From MediaWiki.org
Jump to navigation Jump to search

Botclasses.php is PHP file with several classes to provide access to MediaWiki API. It was originally made by Chris G in 2008 and updated by others up to 2018.


Site statistics[edit]

Updates by 24pm include some functions to get site statistics. You can use function wiki_statistics() to get it and place wherever in the skin. For now you can show the number of:

  • activeusers - active users
  • admins - adminstrators
  • articles - articles
  • category - articles in category
  • edits - edits
  • images - uploaded files
  • pages - pages
  • users - users

Installation[edit]

  1. Download Botclasses.php and wikistat.php from GitHub.
  2. Place them in the root directory of the skin.
  3. Edit wikistat.php and assign correct values to the variables: $wikiAPI, $wikiUser and $wikiPass
  4. Done

Usage[edit]

1. Include wikistat.php in skin code (for Vector skin it is VectorTemplate.php)

<?php require_once( "wikistat.php" ); ?>

2. Add HTML code with PHP function:

<p>Images uploaded to this site: <b><?php echo wiki_statistics('images'); ?> </b></p>

More info[edit]