WPMW

From CiaransWiki

Jump to: navigation, search

WPMW is a solution for integrating a MediaWiki within a WordPress installation. It is currently working, but alpha-quality. You can read more about it in this blog post.

Contents

Installation

To install, it is assumed you already have a working WordPress installation. Although WPMW may work with other versions, it only tested and maintained on an ongoing basis against the latest WordPress, which is 2.8.4 at the time of writing.

Installing MediaWiki

The first thing to do is install MediaWiki in a 'wiki' directory below the root of your WordPress installation. You can use a separate database, or the same one as WordPress uses. Once installed, it's a good idea to set it up to use 'clean' URLs, although it won't affect WPMW if you don't. The following in wiki/LocalSettings.php should do it:

$wgUsePathInfo = false;
$wgArticlePath = '/wiki/page/$1';

(when combined with something like this in .htaccess in the wiki directory:

RewriteEngine on
RewriteRule ^/$ /page/Main_Page
RewriteRule ^page/(.*)$ index.php5?title=$1 [L]

Installing the MediaWiki Extension

Next, the AuthWP.php file (latest version here, or see http://projects.ciarang.com/p/WPMW for full project info) needs to be copied into the MediaWiki extensions directory, i.e. wiki/extensions. Then add the following lines to wiki/LocalSettings.php:

require_once('extensions/AuthWP.php');
$wgAuth=new AuthWP();

Installing the WordPress Plugin

There isn't a WordPress plugin yet (although there will be later) so you've already finished the installation.

Usage

Once everything is set up there is not much else you need to do.

What Works

A.k.a. what should work - bug reports welcome:

  • If you have a Wordpress account, you can use the same details to log into MediaWiki. If there is not already a MediaWiki account for the user, it is created there and then.
  • If you register an account via the MediaWiki interface, an account is automatically created in WordPress. The account will have default settings for most things - specifically the role will be Subscriber, the same as if the user registered via WordPress.
  • If you log in on the WordPress site, you will automatically be logged in to MediaWiki when you visit it.
  • If you log in on MediaWiki, you are automatically logged in to WordPress.
  • If you log out of MediaWiki, you will automatically be logged out of WordPress.
  • If you change your email address or real name in MediaWiki, the WordPress account will be updated.
  • If you change your email address or real name in WordPress, the MediaWiki account details will be updated the next time you log in there.

What Doesn't Work Yet

A.k.a todo list:

  • You can register an account in WordPress that has a user name that is invalid in MediaWiki. In that case, you won't be able to log in to MediaWiki.
  • If you log out on WordPress, you stay logged in on MediaWiki.
  • If you create an account in MediaWiki and don't specify an email address, the corresponding WordPress account will not be usable until you do specify one. (Either by updating in MediaWiki, or by an admin doing it for you in WordPress.
  • I thought WordPress should be sending a 'new user' notification email to the site admin when a user registered on MediaWiki, but it doesn't seem to be working currently.
Personal tools