Monday, August 4, 2014

Create a purge tab in Media Wiki

To purge a page in media wiki, add ?action=purge to the URL of the page you are viewing. For example:

  It is better to create a purge tab . To create a purge tab. frist create a Purge directory under extensions directory, then create file Purge.php under Purge directory.

In LocalSettings.php, my case
require_once "$IP/extensions/Purge/Purge.php";
In Purge.php, my case
 * An extension that adds a purge tab on each page
cense GNU General Public License 2.0 or later

$wgExtensionCredits['other'][] = array(
        'path' => __FILE__,
        'name' => 'Purgepage',
        'descriptionmsg' => 'purge-desc'

$dir = dirname( __FILE__ ) . '/';
$wgHooks['SkinTemplateNavigation::Universal'][] = 'PurgeActionExtension::contentHook';

class PurgeActionExtension{
        public static function contentHook( $skin, array &$content_actions ) {
                global $wgRequest, $wgUser;

                // Use getRelevantTitle if present so that this will work on some special pages
                $title = method_exists( $skin, 'getRelevantTitle' ) ?
                        $skin->getRelevantTitle() : $skin->getTitle();
                if ( $title->getNamespace() !== NS_SPECIAL && $wgUser->isAllowed( 'purge' ) ) {
                        $action = $wgRequest->getText( 'action' );

                        $content_actions['actions']['purge'] = array(
                                'class' => $action === 'purge' ? 'selected' : false,
                                'text' =>  'purge' ,
                                'href' => $title->getLocalUrl( 'action=purge' )

                return true;

A purge tab will be added in submenu of down arrow at the top menu globally.
Video: Create a purge tab in  Media Wiki

Install Media wiki in localhost

Media Wiki is a Wiki software based on PhP and MySSQL, download link

You will get MediaWiki 1.23.2.tar.gz.
Using 7-zip to unzip to get tart file, unzip again to produce   mediawiki-1.23.2/mediawiki-1.23.2
directory, rename it to mediawiki-1.23.2/wiki and copy wiki directory to c::/xampp/htdocs/
assuming you have installed xampp.

1) Using PHpMyAdmin to create database wiki, user name wiki, password for example jiansen
2) run
following instruction step by step. After installation complete, copy LocalSettings.php to wiki home directory
You can change the configuration based on this file
3) After installation complete
to create a new page, search the page then create
4) To edit sidebar
5) To create a template, for example Purgecontent
To use Purgecontent {{ Purgecontent}}
Video:  Install Media wiki in localhost