Mediawiki extensions. MediaWiki extension - MediaWiki extension

Developer: Wikimedia Foundation
A type: wiki engine
Date of issue: January 25, 2002
Programming language: PHP and JavaScript
Operating system: cross-platform software
Latest version: 1.31.0 Download
Rating:
Website: www.mediawiki.org

Mediawiki - the ideal solution for creating your own online encyclopedia, online magazine or blog. The software is quick, easy to install and completely free of charge.

Mediawiki quite popular and easy-to-use platform for creating article, informational sites, since many special extensions have been developed for it, which provide convenient work and systematization of information. The platform has been translated into numerous languages, so today in different countries there are many Internet sites made on Mediawiki.

Briefly about MediaWiki

MediaWiki is free and open source software written in PHP that implements the wiki hypertext environment and was originally created as the "engine" of Wikipedia. MediaWiki is now used by various projects of the non-profit Wikimedia Foundation, as well as many other sites.

This engine is very convenient for writing various kinds of articles. The only difficulty today is that you need to know the so-called "wiki markup" in order to fully control the editing and creation of articles, but the "Visual Editor" has already been developed, which simplifies the process of writing articles and does not require knowledge of any markup. Installation of this editor is a separate installation, and involves some technical difficulties and requires a deeper knowledge of the MediaWiki software.

Installing MediaWiki

And so that the site starts working on this engine it is necessary:

  1. Download the MediaWiki software from the official website. You should download the version that is marked with the word "stable" - means stable version or "LTS" - from English. lang. Long Term Support - has long-term support.
  2. Upload files to your hosting server. Or, as a test, you can upload files to a local server so that, without the Internet, your own hosting, you can understand the installation process of this engine
  3. Complete the engine installation process online. Read about it below:

Installing the MediaWiki Platform

  • After all the files are uploaded to the hosting provider's server, you need to go to the main page of the site (at the address of the domain name), where the MediaWiki installation wizard will welcome. Click "set up the wiki" to start the installation. Then select the language for the installation and your Wiki site. Then it will check the compatibility of the MediaWiki engine with the PHP and MySQL versions. If everything went well, you will see the message "The external environment check was successful. Now everything is ready to install MediaWiki", then you need to click the "Next" button. If the compatibility check fails, then you need to contact the hosting technical support, they will be able to resolve the problem in this case.
  • The next step is to configure MySQL databases, where you must first create a MySQL database, and during the installation of the MediaWiki engine, select the type, database name, username, and password from the database. Next, you need to configure the database by filling in all the appropriate fields. If something is not clear, then in each field you can click "help" and read detailed information about this or that field.
  • Next, you have to configure the site: give it a name and enter the administrator's data. In the same section, you can choose to fine-tune (user rights profile, copyrights and licenses, e-mail settings, configuring various additional extensions, the ability to upload files to the server), or select "Enough, install the wiki", after which the site will be installed. Better to use fine tuning and select the options you need. Every setup has help to help you install the MediaWiki engine.
  • After the installation is complete (it does not take long), the message "Congratulations! You have successfully installed MediaWiki" will appear. After that, you should save the LocalSettings.php file and upload it to the root folder on the hosting server. This file contains all the basic settings of the Wiki site.
  • Then you can follow the link to the main page of the wiki site, where there should be a notification "" MediaWiki has been successfully installed ". On the same page, you can follow the links where you can read more about the reference guide, how to work with this engine, customize it for your own needs.

It is worth noting that newer versions of the MediaWiki platform are installed in a similar manner, but have some additional installation options.

How to create new pages

The wiki editor has various tools for editing pages.

New pages are created in a special editor using wiki markup. Wiki markup is a markup language that is used to format text on websites (usually belonging to the class of wiki projects) and makes it easier to access the capabilities of the HTML language. Pages designed using wiki text are pre-converted to HTML for viewing in a web browser, the conversion is carried out by special software - a wiki engine.

In the search field, you can enter the name of the page, if a page with this name does not exist in the database, the system will offer to create a new page with this name. Going to the page for creating a new page in the editor, you can enter text, styling it with wiki markup. Alternatively, you can install a special InputBox extension that inserts a standard form to start the article creation process.

When creating pages, a special editor is built in, which helps to edit the page in the way the user wants. It is also worth noting that it is very convenient to create internal links for keywords or phrases within the site on the wiki engine. To do this, you need to frame the word or phrase with square brackets -. After creating the page, the words framed with such brackets will have a link. If a page for a keyword or phrase is not on the site, then the link will be colored red, by clicking on it, you can create a new page for this phrase or word. If there is already a page for such a phrase or word, then the link will be blue, and after clicking on it, the article opens.

In order to connect WikiEditor, do not forget to register the following basic editor settings in Localsettings.php:

wfLoadExtension ("WikiEditor"); # Enables use of WikiEditor by default but still allow users to disable it in preferences $ wgDefaultUserOptions ["usebetatoolbar"] \u003d 1; $ wgDefaultUserOptions ["usebetatoolbar-cgd"] \u003d 1; # Displays the Preview and Changes tabs $ wgDefaultUserOptions ["wikieditor-preview"] \u003d 0; # Displays the Publish and Cancel buttons on the top right side $ wgDefaultUserOptions ["wikieditor-publish"] \u003d 0;

When using Mediawiki version 1.25 and below, to connect the extension, you need to enter the following code in LocalSettings.php:

require_once ("$ IP /extensions/WikiEditor/WikiEditor.php ");

It should be noted that the developers have created a special plugin Extension: InputBox for inserting a field on any page of the site, through which you can set the title of the article and then the system will automatically transfer it to the creation page. Moreover, the system provides the ability to create templates for specific topics, which also facilitates the process of creating articles on MediaWiki.

Using templates in articles

Template - this is a specially prepared informational, thematic block that can be used in different articles on one specific topic. The convenience of templates lies in the fact that they can be inserted into many pages, filling in the necessary data, which are subsequently displayed on the page.

Each template is created as a separate article with a title, for example Template: Game - accordingly, this template is used in articles about games, you can follow the link to see how this template is composed. Let's walk through creating a very simple template. Having created a template page with its name (Template: Test), then you need to enter what data will be displayed in this template itself, for example, the template header, this is done in triple curly braces like this:

(((title)))

After that, such a template can be inserted into articles like this:

((Test | title \u003d))

Official documentation on using templates can be found on the official website.

How to create categories on a wiki

How to install other skins in MediaWiki

Mediawiki has developed a number of standard skins for the engine:

  • Vector is a standard theme, and it is now installed on Wikipedia
  • MonoBook - used to be the default skin for the Mediawiki engine
  • Modern
  • Cologne Blue

In order for the extension to work on the wiki site, you must first download it and then upload it to the "extensions" folder. Then enter a special link to the extension in the LocalSettings.php file. On the page of each extension, you can find a guide for installing them. You should also be aware that some extensions require updating the database, and this can be done via the so-called SSH access to the server.

MediaWiki update

Mediawiki software is updated from time to time, various components are being finalized and certain errors and shortcomings are eliminated. Therefore, it is necessary to update the "engine", although this is not always necessary. There are several ways to make an update, but here we will describe the simplest one - updating directly through a browser and FTP client. And so this is what needs to be done:

  • In the root folder, rename LocalSettings.php to any other name, for example, LocalSettings_2.php.
  • Check if the new version meets the requirements of the server (php and MySQL) on which the site from Mediawiki is installed
  • After that, the site will become unavailable, the system will ask you to install the LocalSettings.php file in the root folder, but this is not necessary.
  • Save all the most necessary folders and files, namely:
1) Save the "images" folder, where all images of the site are saved; 2) Save the "extensions" folder, where all additional modules for additional Mediawiki functions are located (in the future, you will also need to download the latest versions of these modules for the updated Mediawiki); 3) Save the MySQL database - this can be done in phpMyAdmin;
  • Download the latest, stable version from Mediawiki from the official site and unpack the files on your computer.
  • Connect to the server where all Mediawiki files are stored and upload new ones via FTP over the old ones, thereby overwriting all old files.
  • Go to the website at mymediawikisite.ru/mw-config/
  • Next, the system will offer to go through the Mediawiki update process. Some information needs to be specified again, as during the first installation, in particular, the MySQL database name and password should be specified.
  • Rename the LocalSettings.php file again.
  • After that, the site should work.

Despite the fact that the "engine" update system is debugged in the best way by the developers themselves, during the update, or after it, certain errors may still appear. Or the site may not work properly. Therefore, updating Mediawiki is at your own peril and risk. However, on the official website, in the support section, you can address certain difficulties that arose after the update. Other update methods and full documentation for updating Mediawiki can be found on the official update page.

It should be borne in mind that after the update, you must also update the extensions that are connected to MediaWiki, as they may be considered obsolete, incorrect or not working at all. You should know that there is also a more professional way to update MediaWiki if you have direct access to the server via SSH - it is more reliable, faster and, in principle, more convenient, but you need to have average knowledge of how to interact with the server.

Conclusion

MediaWiki is one of the most convenient platforms for creating a website of one kind or another. The software is quickly installed and does not require deep programming knowledge to keep the site in working order. If you have any difficulties installing, updating or directly using the MediaWiki engine or have other questions, you can ask them at

When using my collection of extensions, a link to the source is required.

Extensionare assemblies of PHP code that add new features and extend the functionality of the MediaWiki core. Extensions are one of the main benefits of MediaWiki. They give wiki administrators and users the ability to tailor MediaWiki to suit their own needs.

Depending on your goals, you can use extensions to:

  • wiki markup language extensions for writing articles - see Category: Parser function extensions and Category: Parser extensions for examples.
  • adding new reporting and administration capabilities - see Category: Special page extensions for examples.
  • changes to the appearance of MediaWiki - see m: Gallery of user styles and Category: User interface extensions for examples.
  • enhancing security through the use of different authentication methods - see Category: Authentication and Authorization Extensions for examples.

For proper functioning, install the extensions corresponding to your version of MediaWiki !!!

So the list of extensions by group:

Users:

25. ParserFunctions - improved parser with boolean functions.

RSS:

26. Extension: RSS - adds RSS subscription.

27. Extension: RSS into Wiki - adds RSS subscriptions to Wiki pages.

Statistics:

28. Extension: Site Meter for MediaWiki - an extension that allows you to add Site Meter - traffic statistics collection for MediaWiki, showing a small image in the sidebar.

29.Extension: Google Analytics Integration / ru - this extension puts the code Google Analytics to every MediaWiki page. The settings allow you to enable code insertion when viewing pages by users with ‘page protection’ rights (sysops) and ‘bot’ users (bots). By default, no code is inserted to avoid getting information about these service visits in statistics.

Video /Youtube / Flash / FLV / SWF /Music:

30. EmbedVideo - extension for embedding videos on wikipedia.

31. Extension: FlvHandler - this extension adds the ability for users to download Flash videos and add them to pages.

32. Extension: MediawikiPlayer - adds JW FLV Media Player in wiki pages.

33. Extension: Player - adds a built-in player for multimedia playback using regular browser plugins or built-in players.

34. Extension: FlashMP3FlashMP3 adds a simple Flash player to play MP3 files.

Navigation:

35. Extension: Admin Links - the MediaWiki extension adds a special page, "Special: AdminLinks", which contains links intended for wiki administrators; the extension is intended to serve as a kind of "control panel" for administrator functions.

36. Extension: DinamicWikiSitemap / ru Is a separate page of the sitemap. The sitemap will update automatically, which is useful if you update your site regularly.

37. Extension: CategoryTree / ru - expansion CategoryTree provides a dynamic tree view of the category structure on a wiki.

A little background: I needed to somehow place an employee telephone directory in corporate MediaWiki. The directory is large, 300 contacts with internal, city, cell numbers, etc. This reference book is kept by a specially trained person and it is stored (what a coincidence!) In the MySql-base next to the wiki base, i.e. on the same server. Making a static page with phones would not be the best solution, so the wiki should generate the directory dynamically, right from the base. I did not find any suitable tools and extensions to implement my idea, so I decided to write an extension with my own modest efforts, since I'm familiar with web development. I began to search and study the documentation - it turned out that there is almost no Russian documentation, the official one is extremely stingy and too laconic. I had to bite into the granite, taking notes along the way, which became the basis of this series of articles.

Let's get started

Let's start with a problem statement: create a PhoneBook extension. The main idea is to make a page, upon entering which my extension will display the phone book taken from the database and formatted. A service page is ideal for such purposes. Thus, I want my extension to show the phone book on the page .

Any wiki has many special pages called Service pages. These are the pages that are generated by the software at the request of the user. They are located in their own namespace Special: (Service:) and, unlike other pages, are not available for direct editing.

Let's start with the smallest. First, the MediaWiki extension must have its own folder. The wiki extension folders are located in the directory extensionswhich is at the root of the wiki. Let's go there and create a folder PhoneBook - my extension will live in it. Now we will fill this folder with deep meaning.

Further: Here is a pot empty, it is a simple subject. An empty folder is good, but not enough. First, the extension must have a manifest file. This is a json text file that contains a complete description of the extension and its capabilities. The extension manifest file must be named extension.json

Let's create such a file in the extensions / PhoneBook / directory. This will be the simplest file first. Then, as it grows, the file will become more complex:

("name": "PhoneBook", "author": "StarXXX", "url": "http: // site /", "description": "Phonebook of the organization", "version": "1.0", "license -name ":" GPL-2.0 + "," type ":" other "," manifest_version ": 1)

I think everything is clear enough, but I will explain: name - extension name, author - its author, or a group of authors, url - an extension page on the Internet, description - description, version - extension version, license-name - the name of the license under which the extension is distributed, type - type of extension (I indicated other, like “other”, but there are still options), manifest_version refers to the extension.json file schema (Currently the only supported version 1 (MediaWiki 1.26.x and 1.27.x). Many fields are optional, but it will still be good if you fill them in. Detailed description in English is possible.

So, surprisingly, we already have a fully fledged extension. It remains to connect it to MediaWiki. To do this, the file LocalSettings.php, which is in the root of the wiki, add a call to the wfLoadExtension function:

WfLoadExtension ("PhoneBook");

I think it's quite clear that the extension name (\u003d folder name) is passed to the wfLoadExtension function.

At the time of development, you can also disable caching, so as not to interfere. For this in the same LocalSettings.php add the following lines:

$ wgMainCacheType \u003d CACHE_NONE; $ wgCacheDirectory \u003d false; $ wgEnableParserCache \u003d false; $ wgCachePages \u003d false;

So, the first stage is over. The extension is ready. Let's check that it really came to life. To do this, go to the Version service page: http: // myaviki / Service: Version

Scrolling down to the "Installed Extensions" section in the "Other" section, we will see our extension. “Other” because extension.json says “type”: “other”. So, the wiki sees our extension, but it does nothing, because it can’t do anything - we didn’t grow it skillfully. Now you need to grow something skillful - to teach him how to respond to a call to the service page http: // myaviki / Service: Phones , but that's another story, and I'll tell you about this in the next series

MediaWiki extensions allow MediaWiki be made more advanced and useful for various purposes. These extensions vary greatly in complexity. Wikimedia Foundation working Git is a server where many extensions are organized and a catalog of them can be found on the MediaWiki website. Several other sites are also known to develop or maintain-extensions Mediawiki.org, which maintains an extension matrix; and Google code ... MediaWiki code review made it easy through Gerrit instances. Since version 1.16 MediaWiki has also used JQuery library.

using

Man with administrative FTP or file system access to the wiki - directories you can install extensions manually by loading them into the appropriate directories and using text editor , to add demand immediately lines in the LocalSettings.php file to call the extension code for inclusion and evaluation.Some extensions also have configuration settings that are set and changed by editing this file. There is also an extension, customization that allows other extensions to be more easily managed. A better extension management platform is under development.

Extension types

parser functions

Among the most popular extensions is an extension to the parser function, ParserFunctions, which allows different content to be rendered based on the result. conditional operators ... These conditionals can perform functions such as evaluating whether a parameter is empty, comparing strings, evaluating mathematical expressions, and returning one of two values \u200b\u200bdepending on whether the page exists. It was developed as a replacement for a notoriously inefficient pattern called ((QIF)). Schindler tells the story of the ParserFunctions extension as follows:

In 2006, some Wikipedians discovered that by using a complex and complex relationship between templating and CSS features, they could create wiki conditional text, that is, text that is displayed when a template parameter has a specific value. This includes repeated calls to templates within templates that bog down system-wide performance. The developers were faced with a choice: either prohibiting the distribution of a known desired feature, detecting such use and explicitly prohibiting it in software, or suggest an effective alternative. The latter was done by Tim Starling, who announced the introduction of a function parser, a wiki text that calls a function implemented in the underlying software.

Firstly, only conditional text and the calculation of simple math expressions were implemented, but this has already increased the capabilities of the wiki editors enormously. Since temporary functions were introduced further parsing, ultimately leading to a framework that allowed easy writing of an extension function to add arbitrary functions, such as geo-coding services or widgets. This time, the developers are clearly responding to the needs of the community, forced to either struggle with the issue of what the community was (i.e. the conditional text), or to propose an improved technical implementation to replace previous practices and achieve an overall improvement in performance.

Another CA function extension, StringFunctions, was developed to evaluate string length, string position, and so on. Wikimedia communities, while creating awkward workarounds to achieve the same functionality, required it to be included in their projects. Much of its functionality is ultimately integrated into the ParserFunctions extension, although disabled by default and accompanied by a Tim Starling warning that allows string functions to allow users to "implement their own parser in the ugly, most inefficient programming language known to man: MediaWiki with ParserFunctions wiki text" ...

Academic and encyclopedias related data display

Another very popular extension is the Citation Extension, which allow footnotes to be added to pages using embedded links. This extension, however, has been criticized for being difficult to use and requiring the user to memorize complex syntax. A tool called ProveIt has been proposed as a replacement. A gadget called RefToolbar was also created to make it easier to create links using common templates. Discussion MediaWiki has some extensions that are well suited for academia, such as extension mathematics and extension, which allows molecules to be rendered into.

integration

A generic Widgets framework has been created that allows MediaWiki to integrate with just about anything. Other examples of extensions that could improve the wiki are the categories suggestion extensions and extensions to include flash video , Youtube video and RSS feeds ... Expanding integration with Facebook is upcoming. Metavid , a site that archives video footage from US Senate and Chambers floor routines was created using the MediaWiki collaborative video authoring extension code. One extension, Viskimap, makes use of graphical organizers to visualize relationships between content pages so that students can easily gain insight into the content of the elements and their relationships as they navigate through wiki pages.

Anti-spam

There's a lot spambots looking on the Internet for MediaWiki installations and add linkspam to them, even though MediaWiki uses NOFOLLOW an attribute to prevent such attempts search engine optimization ... Part of the problem is that they are being republished by third parties such as mirrors cannot independently implement NoFollow tags on their websites, so marketers can still get PageRank benefit by pasting links to pages when these entries appear on third party websites. Anti-spam the extension was designed to combat the problem by introducing CAPTCHAs , blacklisted specific URLs, and allows bulk deletion of pages recently added by a specific user.

Search queries and data processing and aggregation

mediaWiki's weak query functionality, based mainly on text search, has inspired extensions to add complex new behavior with wiki syntax. Systems that aid in the analysis of the relationship between editors, articles, revisions, topic and words have attracted considerable attention from the scientific community, both in terms of published papers and programming attempts. They were deemed necessary in order for the software to be suitable for applications such as some scientific databases.

Examples of extensions to facilitate such analyzes include Semantic MediaWiki which provides the ability to add structured and searchable relationships and attributes to wiki pages and WikiTrust which implements a system for verifying the author, origin and credibility of a wiki text. SNPedia , NeuroLex and DBpedia projects in these areas. A software development platform designed to support specific software development activities such as management experience , requirements development or project management , was based on Semantic MediaWiki. Another Vika, SynBioSS Wiki whose goal is to provide the scientific community to store and retrieve information related to technology for visualizing and interacting options.

An extension called Woogle was created in an attempt to combine the benefits of wikis to capture new information in an easy and collaborative fashion and corporate search engines searching for existing documents and information in organizations. Since, by default, creating and modifying tables is done manually, inconsistencies can occur from tables that display the same data in different ways, the DynaTable extension was created to provide a wiki user with a convenient way to define data in a separate namespace, as a result bringing in the data stored in the database table, and it will be dynamically retrieved from the database at the time the wiki page is parsed or rendered, into pages that have the appropriate tag (and the required parameters). The extension also allows users to filter tables by selecting a subset of columns and rows to display.

An extension based system known as Annoki was developed to help assign specific parts of articles to specific authors. If more than 50% of a proposal was added by a specific editor, that proposal was deemed to "belong" to that editor. If less than 50% was added by the editor, that editor was deemed to be a proofreader for that sentence. The system also considered a series of edits made by the same author as an ongoing editing effort and identified the release page wiki as the latest of these successive changes.