Extension:Multi-Category Search

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
Multi-Category Search

Release status: stable

MultiCatSearch.png
Implementation Search, Special page, Data extraction
Description Extension represents a special page Special:MultiCategorySearch, that allows to find pages, included in several specified categories at once.
Author(s) Iaroslav Vassiliev (CodeMonkTalk)
Last version 1.62 (2012-01-17)
MediaWiki MediaWiki 1.8 or higher
License GPL
Download 1.62

1.5
1.4

Example 1 (English Version)
2 (German Version)
3 (Russian version)

Check usage (experimental)

This extension lists pages included in several specified categories at once. By default, user can specify up to 5 such categories, and optionally up to 3 categories to exclude from search. The maximum number of categories is set in two corresponding variables in source code, so you can easily change it at any time. On many requests, drop-down lists support was added in version 1.3, and since version 1.5 it's now possible to fill drop-down list automatically with subcategories of some category.

[edit] Purpose and usage

The extension is indispensable if you need, for example, to find all articles about american comedy movies released in 1990 on your cinema-related wiki. Then you go to page [[Special:MultiCategorySearch]], specify three categories: "USA films", "Comedy films" and "1990 films", and click on search button. That's it - you get the list of movies.

[edit] Installation

  1. Download the extension code.
  2. Unzip and save the code files in your wiki's extensions directory in a MultiCategorySearch subdirectory.
  3. Change your wiki's LocalSettings.php file to include the line:

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

[edit] Configuration

General configuration settings are set in variables in the beginning of MultiCategorySearch_body.php file. Here are sample settings and their description.

Maximum number of categories, that user can search for:

var $inCategoriesNumber = 5;

Maximum number of categories, that user can exclude from search:

var $exCategoriesNumber = 3;

Default method of HTTP parameters passing. Change it to 'get' if necessary.

var $paramsPassMethod = 'post';

When set to true, inserts MediaWiki:Edittools at the bottom of search form. But remember, that EditTools require Extension:CharInsert to be installed and AJAX to be enabled (global $wgUseAjax variable must be set to true in LocalSettings.php file).

var $insertEditTools = false;

When set to true, allows to use custom drop-down lists for categories selection. Options for drop-down lists must be manually set in the body of showDropdownLists() function in the end of MultiCategorySearch_body.php script.

var $useDropdownLists = false;

[edit] Transclusion

By transclusion the multi-category search results could be dynamically shown on some other page. Transclusion format is: {{Special:MultiCategorySearch/include=Category 1/include=Category 2/exclude=Category 3}}

[edit] Database compatibility note

Extension won't work on some very old database engines, that don't support SQL subqueries. In that case, please, upgrade your database engine.

[edit] Version history

  • 1.62 — Update to suit MediaWiki 1.18.
  • 1.61 — Minor bugfix. Italian messages were added.
  • 1.6 — Localized messages caching system was updated.
  • 1.5 — Spanish messages were added.
  • 1.5 — An option to fill drop-down list automatically with subcategories of some category was added. Minor bugfix.
  • 1.4 — A patch by William Moore was applied, allowing Special:MultiCategorySearch page to be transcluded.
  • 1.38 — Minor bugfix.
  • 1.37 — Minor changes. French messages were added.
  • 1.36 — Minor bugfixes.
  • 1.35 — Minor internal improvements.
  • 1.34 — Minor internal improvements.
  • 1.33 — Listing of articles, that are not included in specified categories, is now available even if no category was selected to search in.
  • 1.31 — Minor bugfix.
  • 1.3 — Optional drop-down list selection was added.
  • 1.21 — Edittools support was added; German and Dutch translations were added; table prefixes recognition was enabled.
  • 1.01 — Minor bugfix.

[edit] Localization

  • Spanish messages by José Zarco
  • German messages by Astrid Kuhr
  • French messages by Thierry Giroux Veilleux
  • Dutch messages by Nanda Jansen
  • Russian messages by Iaroslav Vassiliev
  • Turkish messages by Helmut Oberdiek
  • Hebrew messages by Avner Pinchover
  • Polish messages by Dawid Kamola
  • Italian messages by Cristian Filagrossi

[edit] Contacts

If you would like to report a bug, request a feature, or could help with localization (extension messages translation), please, send me a letter to codedriller@gmail.com. By the way, if you need advanced bot functionality for your wiki, take a look at free DotNetWikiBot Framework, that I maintain.

[edit] See also

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox