Mediawiki for personal webs

From assela Pathirana
Jump to navigationJump to search

About Wikis, the site mediawiki says the following:

"A wiki is a type of website that allows users to add and edit content easily and is especially suited for collaborative writing."

So these packages are meant to be used for sites that are intended for collaboration, probably with contributions from thousands of individuals, like the case of wikipedia. The success of metawikipedia:wikipedia shows that this indeed is a workable model. What about using wikimedia for a personal web site. Well, I wanted to do this, mainly because I was lazy, but still needed to boast that I have a personal web site. In late nineties I had a web site. But the main reason why it was not a sustainable project was that it was written using a wikipedia:WYSIWYG software, that makes life extremely easy, the first few times that you work on a new site, but makes it impossibly hard when you want to make a small changes and add a few lines here and there! During my experiments with Wikis (that's another story for another day.) I realized that these Wikis are extremely flexible to grow, although they may have a bit steep learning curve initially. Particularly I liked mediawiki, the software behind the legendary wikipedia.

What is a Wiki

Note
First read the entry on mediawiki on wikipedia, which is by far, better than my own explaination.

HTML, the language used to write web pages, is not an easy one to work with, it is easy to make mistakes, and even easy to do the correct thing in a wrong way! A wiki uses a markup language that is far simpler than HTML, so that the 'rest of us' can also contribute to editing web pages. Usually following are the important features of a wiki:

  1. Readers are also contributers. Anybody can create and edit articles -- even can edit the ones created by others.
  2. Things can be undone (e.g. if someone does a mistake/unappropriate thing, the next visiter can 'revert' the article back to an older version. So, a wiki should keep track of all the edits.
  3. Like the web itself, things are extensively linked, so that a user can navigate from an article to another.

When a large number of readers actively participate in a wiki, articles normally 'converge' to a good form, as proven by projects like wikipedia.

How Mediawiki Works

Mediawiki is an open-source wiki implementation with all the important features. Articles and all the details of them (like links between articles, dates of editing, etc.) are stored in a relational database called MySQL. The information in the database are used by programs written in PHP language to create HTML web pages that the user can read. Users can edit articles on the web browser and all the editing information is written back to the database by PHP programs.

When mediawiki is installed in a web site, it can be customized by changing the content of a file called

 LocalSettings.php

.

What I needed

I needed a website:

  1. That I can improve incrementally, whenever I have a minute to spare for that. Probably, I may not have hours of time at one stretch.
  2. That does not allow readers to add/edit articles (like the case of a normal wiki), but makes it possible for them to contribute by discussing the articles.

I did NOT want to hide that fact that this is a site based on (a hacked version of) mediawiki.

With these requirements, it was rather easy to customize mediawiki to match my needs.

The Changes

Most of the changes could be done by editing LocalSettings.php. (That is the standard way.)

$wgGroupPermissions['*']['edit'] = false;                # Don't allow all persons to edit. 
$wgGroupPermissions['*'    ]['read']            = true;  # But let them read articles
$wgGroupPermissions['*'    ]['talk']            = false; # Don't let users to participate in discussions if not logged-in. 
$wgGroupPermissions['user' ]['edit']            = false; # Even logged-in users can not edit articles.
$wgGroupPermissions['user' ]['move']            = false; # They can not rename articles
$wgGroupPermissions['user'    ]['talk']            = true; # But they can participate in discussions. 

$wgGroupPermissions['sysop']['edit']          = true;    # System operator(s) can edit pages.