mediawiki

MediaWiki extensions

I’ve written several MediaWiki extensions, mainly for the CLUG Wiki. I don’t think any of them are particularly beautiful or maintained, but they are an essential part of our wiki, and might be useful to somebody out there…

Category Gallery:

Written for ClugPark, this extension displays all the images in a category together, as a gallery.

Usage:

<category-gallery category="PicturesOfPenguins" resizewidth="50" width="60" height="60"><category-gallery>

Mailman subscribe links:

Written for the Mailing Lists page, this extension displays mailman subscribe forms.

Usage:

<mailman>http://lists.example.com/mailman/subscribe/foobar</mailman>

Obfuscate e-mail addresses:

Written for the Contact a Committee Member page. I use my own simple Javascript that replaces innerHTML and href when you mouse over an e-mail link. I think it’s spambot-proof.

Usage:

<email domain="example.com">foobar</email>

Some Wiki Updates

I’ve just spent an afternoon and evening on the local wikis I look after: CLUG, Freedom Toaster, and GeekDinner.

They’ve all been upgraded to MediaWiki 1.11.0, with reCAPTCHA on sign-ups, and OpenID support.

If you are a user of one of these wikis, you can go to Special:OpenIDConvert (CLUG, FT, GeekDinner) to add OpenID to your account.

In the past, the CLUG wiki has had minimal wikispam, because we thought up some clever regexes, that blocked spammers from editing. However spammers would still sign up, before they tried to edit. This has left the wiki with over a thousand bogous users. Not that that is a problem in itself, but it becomes a bore when you want to guess somebody’s wikiname to give them “Bureaucrat” status for example.

So jerith talked himself into coding up a quick SQL query to find all these bogus users, and a python script to remove them. Any history they’ve had has been assigned to the “Spammer” user, and they have been wiped from the wiki. If, in our zealousness, we’ve deleted any legitimate users who’ve simply never edited the wiki, we apologise. Maybe if you contribute something, it won’t happen again… :-)

More ClugPark work

Well, we’ve now got a custom theme for http://park.clug.org.za/ (by superfly, thanks!) I still want to hack planetplanet to death, but that can wait until they decide on their direction…

In the meantime, I’ve been brushing up my mediawiki hacking for the ClugPark gallery. Mediawiki is a monster! The select query looks like this:

$select = "SELECT page_namespace, page_title, old_text, img_description "
          . "FROM " . $dbr->tableName(‘page’) . " "
          . "LEFT JOIN " . $dbr->tableName(‘revision’) . " ON page_latest = rev_id "
          . "LEFT JOIN " . $dbr->tableName(‘text’) . " ON old_id = rev_text_id "
          . "LEFT JOIN " . $dbr->tableName(‘image’) . " ON page_title = img_name "
          . "INNER JOIN " . $dbr->tableName(‘categorylinks’) . " "
          . "ON page_id = cl_from AND cl_to = " . $dbr->addQuotes($catKey) . " ";
$where = " WHERE page_namespace = " . $wgContLang->getNsIndex(‘Image’) . " "
         . "ORDER BY page_title ";

Yup. Lovely stuff. Anyway, when I’m happy with the extension, I’ll post it somewhere… (Same goes for my other mediawiki extenisons)

Syndicate content