Extension:ZWIMaker

ZWIMaker extension exports MediaWiki articles to the ZWI file format (version 1.3) used by the Encyclosphere project of the Knowledge Standards Foundation (KSF). It allows downloading ZWI files with MediawWiki articles, as well as it can be used for automatic submissions of such files to the Encyclosphere network.

After installation, the button "ZWI export" should appear. It is located at the top-right side of the edit area (in the Timeless skin). If you click this button, you will see the menu that allows you to download the ZWI file with the Mediawiki article. One can also use this menu to submit this ZWI file to the Encyclosphere network.

This plugin requires a password for submission to Encyclosphere, i.e. the network should authorize the MediaWiki installation. This password can be obtained from the KSF. For testing purposes, one can use the password "0123456789" for submission of articles to "sandbox" (in this case $wgMzwiName="sandbox"; should be set).

Download
Go to the MediaWiki install directory, and then go to the directory "extensions".

You will see the directory "ZWIMaker". You should make sure that the web server can write into the directory "ZWIMaker/tmp". If you run Apache under Linux, make sure the owner and group is "www-data".

To use this extension, make sure the php-zip module is installed (here is Ubuntu example for PHP 7.0):

Configuration
The extension requires several parameters. Add these lines at the bottom of LocalSettings.php of your MediaWiki configuration file:

You will see an additional button "ZWI export" above the edit area (this depends on the MediaWiki skin).

Generally,  can be set to any name that represents a "publisher". But you will need to obtain the correct password from the KSF in order to associate this name with a password. You should set the license of the articles to the variable. This information will be included inside the metadata of the ZWI files.

In the case if you use the default password "0123456789", you should always set. This means that your article will appear in the directory "sandbox" of the Encyclosphere network. Note it can be overwritten by other installations with the same "sandbox" name.

Here are other parameters:


 * - ZWI file will be  downloaded (it will not be submitted to the Encyclosphere network).
 * - the ZWI file will be submitted to the Encyclosphere network. Note only the authors who contributed to the text of this article can submit it to the Encyclosphere. Also you need to be properly registered and login on this MediaWiki. In addition, you will need to specify the password that will allow to submit the article to the network. The password can be obtained from the KSF.
 * - the article will be created in the directory "extensions/ZWIMaker/tmp/" without any further actions. It will be removed after new request.

The option 2 should never be used for public MediaWiki installations. This option is only useful for publishers who want to create ZWI files locally. One can trigger ZWI file creation using "wget". For example, this command:

If  is set to false, any user (after login) can submit an article to Encyclosphere. If this parameter is set to true, only authors (contributors) can do the submission.

Image configuration
This ZWI builder works only if you configure MediaWiki such that all images are cached inside the "/thumb/". If you do not do this, only images that have been uploaded to MediaWiki will be included. Any external images from Wikimedia Commons will be ignored. In order to include external images, please add these lines to "LocalSettings.php ":

Protecting from non-registered users
You can remove the "ZWI export" button from non-registered users. For the Timeless skin, just add these lines in LocalSetting.php: