MediaWiki notes

From OriWiki

Jump to: navigation, search

Mediawiki howtos

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

[1]

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

[2]

highlight text of programming languages extension

Managed to install it only on a new version of media wiki [3]

youtube clip embeding extension

[4]

I've done the following and it worked..

  1. Download YouTubeTag, and be sure to rename the downloaded file to YouTubeTag.php.
  2. Drop this script in $IP/extensions
    Note: $IP is your MediaWiki install dir.
  3. 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

  1. extract the archive file (I used mediawiki-1.6.10.tar.gz) in the public_html (www) directory
  2. change the directory name from mediawiki-1.6.10 to a desirable name (say wiki)
  3. change wiki/config permission to be writable to all
  4. browse to <url>/wiki
  5. choose set up the wiki
  6. 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)
  7. 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

  1. upload a file (say ori_logo.png) to a place in the file system (e.g.: <mediawiki_installation_root>/skins/common/images/)
  2. 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)
Personal tools