MwDoc
From Kb_JMY(晉明夷)
MediaWiki Documentation
Contents
|
Site Administration
Access Control
Site configuration
SEO
Skin Layout
Editing Help
Frequently Used
Integrating existing MediaWiki with Joomla using Installed MamboWiki
- Note that: this procedure has not been tested!!
- Ref: MamoWiki Demo Site
- -> Search "Can I use the component to integrate my existing MediaWiki?"
- MamboWiki Installed: com_mambowiki-0-9-6-2.zip
- MediaWiki Installed: mediawiki-1.8.2.tar.gz
- Working Environment: Web-Hosted
- Just install the mamboWiki as a normal Joomla Components thru ftp upload and don't do any further steps. The following files and directory can be found:
- d1: <Joomla_Directory>/components/com_mambowiki/skins/MamboWiki
- f1: <Joomla_Directory>/components/com_mambowiki/skins/MamboWiki.php
- copy the above two directory and file to <Mediawiki_Directory>/skins/
- f2: <Joomla_Directory>/components/com_mambowiki/MamboLogin.php
- copy it to <Mediawiki_Directory>/
- f3: <Joomla_Directory>/components/com_mambowiki/mambowiki.html.php
- edit the file and change the "iframe" src reference to point to the index.php of the MediaWiki installation
- f4: <Joomla_Directory>/components/com_mambowiki/mambowiki.php
- f5: <Joomla_Directory>/components/com_mambowiki/mambowikivars.php
- Your existing mediaWiki directory should contain the following files:
- f1: <Mediawiki_Directory>/LocalSettings.php
- Open the file and search:
- require_once("includes/DefaultSettings.php");
- Open the file and search:
- Add the following two lines after it:
- require_once($IP."/MamboLogin.php");
- $wgAuth=new MamboLing();
- Add the following two lines after it:
- f2: <Mediawiki_Directory>/skins/common/wikibits.js
- comment out or remove the line:
- if (window.top !=window ) window.top.location=window.location;
- comment out or remove the line:
MediaWiki Extensions
- Meta.wikimedia.org: MediaWiki Hacks & Extensions
- Meta.wikimedia.org: Category:MediaWiki extensions
- Meta: Mediawiki Hacks
- Meta: MediaWiki extensions FAQ
- wikibooks.org: MediaWiki Developer's Handbook
Auto Contents
Forum Extension
- MediaWiki Forum Extension <-- Seem not so good in operation flow!!
Bold text
Gallery2wiki Extension
- References:
- transarte.net: Gallery2wiki extension
- transarte.net: Download "gallery2wiki_extension.zip"
- Fixes for Gallery2 v2.1
- transarte.net: Paths when using subdomains
- Gallery2wiki: Sandbox
Installation
- Assuming the followings:
- absolute path: /home/tefagrou/public_html ; (The $_SERVER["DOCUMENT_ROOT"] for the http://6MillionDollarPage.org)
- Gallery2: /home/tefagrou/public_html/gallery;
- mediawiki: /home/tefagrou/public_html/hnlife;
- Gallery2 URL: http://gallery.6MillionDollarPage.org
- mediawiki URL: http://hnlife.6MillionDollarPage.org
- Setting up Gallery2
- install Gallery2 ("gallery-2.1.2-full.tar.gz") according to its installation procedures
- login as Admin
- Activate "Album Select" module (probably already activated by default): -> click "Site Admin" -> Admin Options -> Modules -> Blocks -> "Album Select"
- Create an sample album
- Setting Up "Gallery2wiki" extension
- Extract "gallery2wiki_extension.zip" to "public_html/hnlife/extensions/" (you should see the folder "public_html/hnlife/extensions/gallery2wiki_extension/")
- Edit "public_html/hnlife/LocalSettings.php" and add the following line near the bottom
- require_once("extensions/gallery2wiki_extension/gallery2wiki.php");
- Edit gallery2wiki.settings.php, which can be found in "public_html/hnlife/extensions/gallery2wiki_extension/", to reflect the setup of the Gallery2 installation as follows:
/*===================================================== // Here comes the setting for this production site: // "DOCUMENT_ROOT" = /home/tefagrou/public_html ; for the http://6MillionDollarPage.org =======================================================*/ $gallerySettings["herepath"] = "/hnlife/extensions/gallery2wiki_extension/"; // Relative path to the "gallery2wiki_extension" folder; // Usually a dirname(__FILE__) also works, but having symlinks this does not work; $gallerySettings["absherepath"] = $_SERVER["DOCUMENT_ROOT"].$gallerySettings["herepath"]; // i.e $gallerySettings["absherepath"] = "/home/tefagrou/public_html/hnlife/extensions/gallery2wiki_extension/"; //absolute path to this folder $gallerySettings["FullDomain"] = "http://www.6MillionDollarPage.org"; //It makes the "galleryFullUrl" $gallerySettings["galleryRelPath"] = "/gallery/"; // relative path to gallery2. in multisite this lead to the visible part not to the core files $gallerySettings["galleryFullUrl"] = $gallerySettings["FullDomain"].$gallerySettings["galleryRelPath"]."main.php"; // $gallerySettings["galleryFullUrl"] = "http://www.6MillionDollarPage.org/gallery/main.php" $gallerySettings["path"] = $_SERVER["DOCUMENT_ROOT"].$gallerySettings["galleryRelPath"]; // i.e $gallerySettings["path"] = "/home/tefagrou/public_html/gallery/"; // This is the "absolute path" to the visible multisite part $gallerySettings["codepath"] = "/home/tefagrou/public_html/gallery/"; // Normally: $gallerySettings["codepath"] = $gallerySettings["path"]; // In multisite mode the "absolute path" differs from the "document_root" path. // Gallery2 version 2.1 update $gallerySettings["embedUri"] = 'http://hnlife.6MillionDollarPage.org/index.php' ; $gallerySettings["g2Uri"] = 'http://gallery.6MillionDollarPage.org/' ;
- Edit "gallery2wiki.class.php" which can be found in "public_html/hnlife/extensions/gallery2wiki_extension/classes/"
- REPLACE all occurrences of: "if($ret->isError())" by "if($ret)" <------------- cannot find if($ret->isError()) !!
- SEARCH GalleryEmbed::init(...); and REPLACE the whole declaration by
$ret = GalleryEmbed::init(array(
'embedUri' => $gallerySettings["embedUri"],
'g2Uri' => $gallerySettings["g2Uri"],
// 'embedPath' => 'mediawiki',
// 'relativeG2Path' => '../../gallery2/',
'loginRedirect' => '',
'fullInit' =>true,
'activeUserId' => ''
) );
- REPLACE all occurrences of GalleryCoreApi::relativeRequireOnce by GalleryCoreApi::requireOnce <------------- cannot find if($ret->isError()) !!
- Yes! Found the last tweaks needed here : <------------- None of the followings cannot be find!!!
| SEARCH | REPLACE by |
|---|---|
_derivativeOperations | derivativeOperations
|
_width | width
|
_height | height
|
_id | id
|
Security
Access Control
GroupWiki
- Ref:
- mwusers.com: mediawiki with pagelevel acl (groupwikibase-1.2.0_(mediawiki1.8.2).tar.gz)
- sf.net: GroupWiki
- [expected access right control screen DOES NOT be displayed, why???]
- Note that GroupWiki is not just an extension, but includes some hacks to the core codes, main changes will be:
- -one file in extensions/
- -additions to LocalSettings.php
- several files need to be modified directly.
- changes to the gui:
- -protect tag (controls access)
- -Special:userrights (controls groups)
Installation Notes
- The installation codes: groupwikibase-1.2.0_(mediawiki1.8.2)_a1_(w755_permissions).tar.gz
- check that all files and directories have "755" permissions
- after installation: append LocalSettings.php.txt to your LocalSettings.php, otherwise you cannot login and will be locked in the following page:
Login Required You must log in to view other pages.
- if you are using the patch version, you must copy replace your files with the ones provided in the package.
- if you are using the integrated version, all the files are already there. there are only two noticable chances to the UI.
- -Special:Userrights has an extra field at the bottom for adding groups
- -modified protect page
SpamBlacklist extension/update script
Wysiwyg Editor
MediaWiki1.8.2 with FCKeditor?
- InstaView -- extension to generate instantaneous previews of the wiki-text being edited. <-- note! beta version only
- Wikificator -- a JavaScript Mediawiki extension that converts XHTML to wikitext. <-- beta version only
Installation Notes
- --> Not recommended now because:
- Major reason: NOT compatible with wikitext! wikitext: _TOC_, templates,... cannot be used! So have rolled back not to use it! 2006.12.20 (Wed)
- Quick overview
1. Install FCKeditor 2. Put FCKeditor.php in extensions directory 3. Adapt LocalSettings.php
- Installing FCKeditor
- Files need to be modified for MediaWiki Integration
- /FCKeditor/editor/dialog/fck_image.html
- /FCKeditor/editor/dialog/fck_image/fck_image.js
- /FCKeditor/fckconfig.js
- -> FCKConfig.mwScriptPath = "???"; of fckconfig.js must be the same as the path as specified in $wgScriptPath = "???"; of LocalSettings.php
- -> The path "???" still don't know how to set it!!!
- Finally check your FCKeditor installation:
Manuals
Installation
Multi-sites with same Installation & Database
- Ref:
- SteveRumberg.com: Multi-Sites with same installation & Database
- Is it possible to install more than one wiki (MediaWiki) on a server? How? <-- "CommonSettings.php"
- pRevolution.org: mediawikifarm
- MediaWiki.org: Wiki Family
- mwusers.com: How to Create Another Mediawiki using Same Source Code, &Database, but own tables?
- meta.wikimedia.org: How do I create a small wiki farm?
- mwusers.com: Two or more sites using the same mediawiki installation?
- After the first mediawiki being installed in the subdirectory (i.e public_html/en), with its database setup as "tefagrou_6mHnL" and database prefix as "en_", create the second subdirectory "public_html/zh" for second mediawiki setup using the same installation.
- Make symbolic links (just like making shortcuts in Microsoft Windows) of all files of "public_html/en" to "public_html/zh" with the sole exception of "LocalSettings.php", by the following shell command:
- ln -s /home/tefagrou/public_html/en/* /home/tefagrou/public_html/zh
- Then do the rest as follows:
cd /home/tefagrou/public_html/zh; rm LocalSettings.php; rm config; mkdir config; chmod a+w config; //make the directory writeable //Link the configuration script file that will set up the wiki ln -s /home/tefagrou/public_html/en/config/index.php /home/tefagrou/public_html/zh/config;
- Now Type http://hnlifekb.org/zh/index.php in the web browser to start the MediaWiki installation program.
- --> This do displayed the first setup screen, but then "Internal Server Error 500" happened when I really click "set up the wiki" to start the setup!!
- CommonSettings.php: adding the line " include_once("../CommonSettings.php") " in each LocalSettings.php, and placing settings which apply to all wikis in ../CommonSettings.php
- Persistent Login: Making login to be persistent across Wiki's running on the same server
- Simply add the following line to your LocalSettings.php after "$wgSiteName = ..." :
- "ini_set("session.name", "{$wgSitename}Session" );"
Parked domain, $wgActionPaths & $wgScriptPath
- Problems:
|
Changing the Mediawiki Program Directory
- Assumes:
- you access your site by: "http://mysite.org/en"
- original program path: "public_html/en"
- New path: "public_html/en_new"
- simply change the script path in "LocalSettings.php"
- from: $wgScriptPath = "/en";
- to: $wgScriptPath = "/en_new";
- Note that subdomain access,i.e. you access your mediawiki by "http://en.mysite.org", is not recommended as: $wgScriptPath = "";if you install using subdomain!!! <-- This causes many problems when non-standard image directory is used, also problems with Gallery2wiki_extensions ???
- Note that subdomain access,i.e. you access your mediawiki by "http://en.mysite.org", is not recommended as:
Moving from one Hosting Site to another
- Note: procedure not successful as of 2006.12.19(Tue)
- Factsheet
- Installation source code: groupwikibase-1.2.0_(mediawiki1.8.2)_a1_(w755_permissions).tar.gz
- Original directory: public_html/hnlife
- database: tefagrou_6mHnL
- New directory: public_html/gpwiki
- database: tefagrou_gpwk
- Procedure for the Move:
- Moving the database:
- export the tables of the original database tefagrou_6mHnL to tefagrou_gpwk.sql
- create the new database tefagrou_gpwk and import tefagrou_gpwk.sql
- Rename the directory from hnlife to gpwiki
- Modifying "LocalSettings.php"
- Edit "LocalSettings.php" to reflect the database changes
- how to modify to reflect the directory changes is not known!! maybe why...
- --> Note! Don't know why always goes to http://6milliondollarpage.org/6m, even though subdomain http://gpwiki.6milliondollarpage.org has been set for the target installation in the subdirectory "gpwiki"
Do this by re-installation
- Assumes that:
- Original directory: public_html/hnlife
- database: tefagrou_6mHnL
- New directory: public_html/en
- New database: tefagrou_HnL_en
The above problems shows that the program path information is stored somewhere in the program directory or saved in the database, so try to re-install to reflect the changes:
- First backup the program directory and database
- Setting up the program directory
- rename the program directory from "hnlife" to "en"
- rename the configuration file "LocalSettings.php" to "LocalSettings_a1.php" to cheat the installation program of mediawiki
- start the installation by entering "http://mysite.org/en"
- After successful installation, check "LocalSettings.php" if any modification required to reflect the changes of program directory and database name
- rename "LocalSettings_a1.php" back to "LocalSettings.php"
- Recovering back the database
- That's it! <-- not tested!!! this methods only works if path settings is not stored in the database!! ==> recover the database first???
Getting started
Administration
- References:
- LocalSettings.php
- Administration
- WikiBooks:MediaWiki Developer's Handbook
- LocalSettings.php: Which setting file contain the value of "MW_INSTALL_PATH"?
User Management
- Ref:User Rights
some common settings:
- Here are some common settings
$wgEnableUploads = true; //line91: enable image upload $wgLanguageCode = "en"; //line111: set the language of mediawiki $wgDefaultSkin = 'monobook'; //line117: set the skins $wgGroupPermissions['*']['createaccount'] = false; //disable account creation by Anonymous visitors $wgGroupPermissions['*']['edit'] = false; //must login to edit $wgShowIPinHeader = false; //don't show "talk" page for Anonymous visitors //Disable read permission for Anonymous visitors $wgWhitelistRead = array( "Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" ); $wgGroupPermissions['*']['read'] = false; /****** To avoid redirected to "login required" page, you need to change the function "loginToUse()" in "includes/OutputPage.php" *******/
- Check below for default settings
- <MediaWiki_Directory>/includes/DefaultSettings.php <-- starting at line 887
$wgGroupPermissions['*' ]['createaccount'] = true; $wgGroupPermissions['*' ]['read'] = true; $wgGroupPermissions['*' ]['edit'] = true; $wgGroupPermissions['*' ]['createpage'] = true; $wgGroupPermissions['*' ]['createtalk'] = true; $wgGroupPermissions['user' ]['move'] = true; $wgGroupPermissions['user' ]['read'] = true; $wgGroupPermissions['user' ]['edit'] = true; $wgGroupPermissions['user' ]['createpage'] = true; $wgGroupPermissions['user' ]['createtalk'] = true; $wgGroupPermissions['user' ]['upload'] = true; $wgGroupPermissions['user' ]['reupload'] = true; $wgGroupPermissions['user' ]['reupload-shared'] = true; $wgGroupPermissions['user' ]['minoredit'] = true; $wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true; $wgGroupPermissions['bot' ]['bot'] = true; $wgGroupPermissions['bot' ]['autoconfirmed'] = true; $wgGroupPermissions['sysop']['block'] = true; $wgGroupPermissions['sysop']['createaccount'] = true; $wgGroupPermissions['sysop']['delete'] = true; $wgGroupPermissions['sysop']['deletedhistory'] = true; $wgGroupPermissions['sysop']['editinterface'] = true; $wgGroupPermissions['sysop']['import'] = true; $wgGroupPermissions['sysop']['importupload'] = true; $wgGroupPermissions['sysop']['move'] = true; $wgGroupPermissions['sysop']['patrol'] = true; $wgGroupPermissions['sysop']['protect'] = true; $wgGroupPermissions['sysop']['rollback'] = true; $wgGroupPermissions['sysop']['upload'] = true; $wgGroupPermissions['sysop']['reupload'] = true; $wgGroupPermissions['sysop']['reupload-shared'] = true; $wgGroupPermissions['sysop']['unwatchedpages'] = true; $wgGroupPermissions['sysop']['autoconfirmed'] = true; $wgGroupPermissions['bureaucrat']['userrights'] = true;
FAQ (Admin)
Cannot Modify "LocalSettings.php"
- Strange Problem -- Cannot Modify "LocalSettings.php" of kb.mosct.com! 2006.12.20 (Wed)
- As titled! Any changes, even adding a space to it, shall results in the following warning messages and corrupts the display of kb.mosct.com if Firefox is used; whole page displaying this warning message if IE is used:
- Warning: Cannot modify header information - headers already sent by (output started at /home/mosct/public_html/kb/LocalSettings.php:1) in /home/mosct/public_html/kb/includes/WebResponse.php on line 9
- Warning: Cannot modify header information - headers already sent by (output started at /home/mosct/public_html/kb/LocalSettings.php:1) in /home/mosct/public_html/kb/includes/WebResponse.php on line 9
- Warning: Cannot modify header information - headers already sent by (output started at /home/mosct/public_html/kb/LocalSettings.php:1) in /home/mosct/public_html/kb/includes/WebResponse.php on line 9
- Warning: Cannot modify header information - headers already sent by (output started at /home/mosct/public_html/kb/LocalSettings.php:1) in /home/mosct/public_html/kb/includes/WebResponse.php on line 9
- Solution:
|
SEO
Clean URLs
- wikimedia.org -- Eliminating_index.php_from_the_url
- wikimedia.org -- Using_a_very_short_URL
- mediawiki.org -- Manual:Short_URL
- Objectives: to display clean URLs such as:
- Assumes:
- Mediawiki installed in the subdirectory: "public_html/wiki/"
- Procedures:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wiki/index.php?title=$1 [L,QSA]
|
Clean URLs for Addon Domain
- Assumes:
- The addon domain: http://mysite.com which is redirected to the subdirectory "public_html/mysite/wiki"
- The Main domain: http://mysite0.com
- The value of $wgScriptPath in "LocalSettings.php" is: $wgScriptPath = "/wiki";
- The correct rewrite command set in the .htaccess file is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*[^wiki/])/?$ /wiki/index.php?title=$1 [QSA,L]
|
- URL before rewrite -- http://www.mysite.com/wiki/index.php?title=pagename
- URL after rewrite --- http://www.mysite.com/wiki/pagename
- Understanding more about how the rewrite works:
|
Making Short URLs for actions
MetaTags
Editing &Formating
- WikiMedia_Help:Editing
- Variable
- Adding Math Support to Mambowiki with ASCIIMath [1]
Tutorial on Editing & Formatting
Shortcut
- Ref: Wikipedia:Shortcut
Templates
WikiMedia -- A quick guide to templates
WikiMedia -- Advanced templates
Wikipedia -- Category:TOC_templates
clickwiki.info -- Template:Object
clickwiki.info -- Category:Template
Templates Examples
-> How it looks when used? Check it Here!
Managing Images
- Ref:
- Changing Site logo
- Ref: wikimedia.org: How_do_I_change_the_logo?
- In your LocalSettings.php add: "$wgLogo = '/path/to/your/logo.png';"
Moving to a Upper Level Image Directory
- Assumes:
- website accessed by: http://mysite.com/en
- original path: public_html/en/images
- New path: public_html/_FileH
- First Copy all files under "images" to "_FileH"
- Then Edit "LocalSettings.php" and update the followings:
$wgFavicon = "$wgScriptPath/../_FileH/favicon_hnl.png"; //site favicon. $wgLogo = "$wgScriptPath/../_FileH/logo_hnl.png"; //site logo. $wgUploadPath = "$wgScriptPath/../_FileH"; $wgUploadDirectory = "$IP/../_FileH";
| |
|
- That's it!!
Examples of Embedding Images
[[Image:Example.jpg]][[Image:Example.jpg|alternative text]]-- add alternative text[[:Image:Example.jpg]]-- display only the image link[[Media:Example.jpg]]-- To bypass the description page and link directly to a file , use the "Media" pseudo-namespace:
-
[[Image:{name}|{options}]]-- full syntax for displaying an image
- Where options can be zero or more of the following, separated by pipes:
-
thumb,thumbnail, orframe: Controls how the image is formatted -
left,right,center,none: Controls the alignment of the image on the page -
{width}px: Resizes the image to the given width in pixels -
{caption text} - Examples:
[[Image:example.jpg|thumb|center|200px|Example Image]]
- Linking External Images: Just like linking other webpages
- [http://mysite.com/images/image.png Image Name]
- Embedding External Images: simply inserting the image link
- Just must add the below line to "LocalSettings.php":
- $wgAllowExternalImages = true;
- and put, inside your text, the image link without "[[ ]]", e.g. http://mysite.com/images/image.png
Gallery of images
- Ref: Gallery_of_images
It's easy to make a gallery of thumbnails with the <gallery> tag. The syntax is:
<gallery>
Image:{filename}|{caption}
Image:{filename}|{caption}
{...}
</gallery>
Captions are optional, and may contain wiki links or other formatting.
for example:
<gallery> Image:Example.jpg|Item 1 Image:Example.jpg|a link to [[Help:Contents]] Image:Example.jpg Image:Example.jpg Image:Example.jpg|''italic caption'' </gallery>
is formatted as:
Example.jpg
Item 1 |
Example.jpg
a link to Help:Contents |
Example.jpg
|
Example.jpg
|
Example.jpg
italic caption |
- Recommendations per Ref.:
- The only way I have found to cheat is to force the images into the database manually and then change the name of the image from image.jpg to folder1/image.jpg That seemed to work but I didn't do a lot of testing.
- The other option to suggest is to keep the images in a gallery software and use extensions to link between the gallery software and MW. (which is what I eventually did). I cheated and used coppermine gallery since there were already come plugins for MW written for it (random image and last image i think were the two I saw).
- FileStore The image undeletion archive for MediaWiki 1.7 uses the new FileStore class. The general intention is to migrate all image storage in the future to use this, possibly with some changes. It's based on earlier musings, see 1.6 image storage
FAQ(Editing)
How to roll back a certain page?
- Answer: Simply select the old version that you want to roll-back -> then "edit" and "save" -> That's it!
Categories
- MediaWiki Categories List
- Category:MediaWiki Misc This category is meant to store all MediaWiki related pages, that don't fit into another existing category. Pages may be put into a specific category later.
- FileStore The image undeletion archive for MediaWiki 1.7 uses the new FileStore class. The general intention is to migrate all image storage in the future to use this, possibly with some changes. It's based on earlier musings, see 1.6 image storage
Interwiki
NameSpaces
- wikimedia.org -- Help:Namespace
- wikimedia.org -- Help:Custom_namespaces
- wikimedia.org -- Meta:Namespaces
Some Interesting Topics of MediaWiki
Sites using MediaWiki/en
http://www.mediawiki.org/wiki/Sites_using_MediaWiki/en
FAQ
- Ref: lyquidity.com
- Ans: They use multiple servers. en.wikipedia.org for english and es.wikipedia.org for spanish. There was some discussion in the forums a while back on alternative ways of doing it, but as I recall they didn't have much success. I think most people are following wikipedia's example.
How can I prevent anonymous users editing pages?
- Since 0.9.5 it is configurable through Components | MamboWiki | Administration at the Mambo/Joomla backend.
- MamboWiki versions prior 0.9.4 allow an anonymous user to edit any Wiki page. If you want to restrict editing to just those users who are signed in, edit the file
- <Joomla Directory>/components/com_mambowiki/LocalSettings.php
- and add the line: $wgWhitelistEdit = true;
How can I restrict MamboWiki access to registered Mambo users only?
- When you create a menu option that uses the MamboWiki component, one of the parameters allows you to determine whether access will be allowed for any visitor or just registered users that are signed in. Of course you could make the menu visible only to registered users that are signed in. The purpose of adding the parameter to the component is to allow you to advertise to all users the fact that a Wiki is available while at the same ensuring the user is signed in.

