Using a MediaWiki installation to document internal systems where i’m currently at, and although we all have users it’s easy to forget to login before making edits. This results in a history full of IP addresses rather than names, which is a bit less useful. So, to prevent us from forgetting to login we decided to force ourselves to log in by disabling anonymous edits. You do that by adding the following to your LocalSettings.php.
In MediaWiki you can already make email hyperlinks (
[mailto:firstname.lastname@example.org Mail someone]), but telephone number hyperlinks aren’t allowed for some reason by default (
[tel:0123456789 Call someone]). Turns out to be an easy fix though.
Simply add the following to LocalSettings.php.
Make it prettier
The links will get same icon as external links, which is a bit annoying, but that can be fixed as well. Find the main CSS file for your theme, in our case
/skins/monobook/main.css, and look for a section which looks like the following.
background: url("mail_icon.gif") no-repeat scroll right center transparent;
padding: 0 18px;
Simply make a copy of that section and replace all instances of ‘mailto’ with ‘tel’ and set the URL to the icon you want. The icon should of course be uploaded to the same location as the CSS for that to work 🙂
Working for a client who has documentation on a MediaWiki installation which was set up before we got there. Was able to create users for ourselves through the regular site, but certain things like deleting pages can only be done by sysops. None of our newly registered users are of course sysops and the only existing sysop user is from whoever installed the wiki to begin with.
Here’s how to promote a user to sysop the hackish way, directly in the database.
Find database details
- SSH into the system where MediaWiki is installed and find its location.
/var/www/html/foowikiin our case.
LocalSettings.phpand everything should be under the heading
## Database settings
- Connect with a mysql client.
mysql -h localhost -u wikiuser -p wikidb
- Find the user id.
SELECT user_id, CONVERT(user_name USING utf8) FROM `user`;
- Add user id to sysop (and bureaucrat) group.
INSERT INTO `user_groups` VALUES (uid, 'sysop'),(uid, 'bureaucrat');
The user should now be sysop, which can be double checked on the Special:ListUsers wiki page.