MediaWiki notes
From OriWiki
Contents |
Writing a bot in python
Sources:
- Explanation about pywikipediabot, a python lib that aims to facilitate the integration with MediaWiki's api.
retrieving information from the wiki
http://orimosenzon.com/wiki/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics
Managing group permissions
disable anonymus editing
Add the following line at the end of your LocalSettings.php
$wgGroupPermissions['*']['edit'] = false;
(In the Hebrew media wiki (mediawiki 1.6.10) this didn't have any effect. I also tried to change the include/DefaultSettings.php but it had no effect either)
Templates
highlight text of programming languages extension
Managed to install it only on a new version of media wiki [3]
youtube clip embeding extension
I've done the following and it worked..
- Download YouTubeTag, and be sure to rename the downloaded file to YouTubeTag.php.
- Drop this script in $IP/extensions
- Note: $IP is your MediaWiki install dir.
- Enable the extension by adding this line to your LocalSettings.php:
require_once('extensions/YouTubeTag.php');
(I added it before the ending tag of php ('?>' is it?)
installation using cpanel
mysql database creation
cpanel->mysql database->create database
add user (all privileges)
installation
- extract the archive file (I used mediawiki-1.6.10.tar.gz) in the public_html (www) directory
- change the directory name from mediawiki-1.6.10 to a desirable name (say wiki)
- change wiki/config permission to be writable to all
- browse to <url>/wiki
- choose set up the wiki
- fill the form
- note that the language really determine the language of the wiki
- choose the database name and the user name like it appears in the mysql section of the cpanel (reg)
- move wiki/config/LocalSettings.php to wiki/ (note that in cpanel you need to press the name of the destination folder (not its icon))
that should be it, you can start using the new wiki by browsing to <url>/wiki
note that the default username for the super user is:
WikiSysop
See also [5]
enable images upload
edit wiki/LocalSettings.php:
## To enable image uploads, make sure the 'images' directory ## is writable, then set this to true: $wgEnableUploads = true; ...
setting the wiki logo
- upload a file (say ori_logo.png) to a place in the file system (e.g.: <mediawiki_installation_root>/skins/common/images/)
- change the LocalSettings.php file to have the line
$wgLogo = "$wgStylePath/common/images/ori_logo.png";
in version 1.13.2 it was different because $wgStylePath is not defined:
$wgLogo = "$wgScriptPath/skins/common/images/ori.png";
instead of the default corresponding line
See [6]
backup and restore the data base using cpanel
cpanel -> backup -> Download a MySQL Database Backup | upload
- note that the name of the file is what define which data base will be restored
images
copy the wiki/images directory
how can I backup it?.. I can backup the whole file system but that takes a long time ..
LaTex support
didn't manage yet.. though I did follow the instruction on: [7] also .. [8]
maybe the problem is that one of the following is not installed:
- latex (check for packages named 'tetex')
- dvips (dvips or tetex-dvips)
- convert (ImageMagick)
- gs (Ghostscript)

