Extension:PageInfo

What can this extension do?
This extension displays an information box near to the table of contents about creation and editing.

Overall features:
 * Displaying creator, creation date, other authors, last edit date, edit rights needed to edit this page (currently only the info "all" or "admin" supported), page views and edit state: you define the number of min/mid/max days since last edit and this extension remind you to update the article.
 * Displays also other authors and the number of watchers and edits. (so, the extension replaces/includes the siteinfo query).
 * When the table of content is present, it will be placed right of it (JS needed); otherwise before article content.
 * You can save the state (hide or show) with cookies enabled on.

Usage
This extension just displays some information on every wiki content page. No interactive elements.

Download instructions
Download the files PageInfo.php and PageInfo.i18n.php from https://github.com/pglatza/mw-ext-pageinfo and save both files at $IP/extensions/PageInfo.

Note: $IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.

Installation
Add the following line to LocalSettings.php:

When Using MediaWiki 1.1.18
I could not update the source for this extension. There is a bug when using with MediaWiki 1.1.18. The following sections need to be changed:

Becomes:

Becomes:

Becomes:

Becomes:

Fix for Mediawiki 1.23.x
As of 1.23.0 $wgArticle is deprecated and has been replaced, so all uses of it have to be removed. Also you have to do all of the above 1.1.18 changes before.

In the function pi_Show add this at the beginning: $context = RequestContext::getMain; $article_obj = $context->getWikiPage; In the same function replace $pi_CreatedBy = $wgArticle->getUserText; with $pi_CreatedBy = $context->getUser; Replace $pi_LastEditTimestamp = strtotime( $wgArticle->mTouched); with $pi_LastEditTimestamp = strtotime( $article_obj->getTimestamp ); Replace $pi_Container .= $this->pi_CreateEntry( wfMsgHTML( 'paramViews' ), $wgArticle->getCount ); with $pi_Container .= $this->pi_CreateEntry( wfMsgHTML( 'paramViews' ), $article_obj->getCount ); The next function to edit is "pi_DontDisplay".

Add the start of the function add this: $context = RequestContext::getMain; Replace the if-statement: if( $wgArticle === null ||     $this->pi_MagicWordMatchedInArticle ||      !$wgArticle->exists ||      !in_array( $ns, $wgPI_Namespaces ) ||      $action == 'edit' ) With if( !$context->canUseWikiPage ||    $this->pi_MagicWordMatchedInArticle ||     !in_array( $ns, $wgPI_Namespaces ) ||     $action == 'edit' )

Configuration parameters
Adjust these variables before the page-info line (see Installation above) in LocalSettings.php.

Magic Word, hiding on a single page
On every page you can use the magic word "__NO_PI__" to disable the extension.

Authors
PageInfo has been written by Philipp Glatza and was requested by Alexander Goerlt (Vandenhoeck & Ruprecht).

Version
Maybe in a future version all rows are adjustable - adding functionality to reorder and removing rows from output.

1.0
Initial release. Name of the extension during development, until public release: CurrentSiteInfo.

Internationalization
Currently (v1.0), english and german are supported.