User:Austin J. Che/Extensions/Recentchangesfilter: Difference between revisions

From OpenWetWare
Jump to navigationJump to search
No edit summary
Line 1: Line 1:
The standard [[Special:Recentchanges]] list can be overwhelming with the number of changes. An extension to MediaWiki to allow limiting the changes list to certain pages has been written at [[Special:Recentchangeslimit]].  
The standard [[Special:Recentchanges|recent changes]] list can be overwhelming with the number of changes. An extension to MediaWiki to allow limiting the changes list to certain pages has been written at [[Special:Recentchangeslimit]].  


For a quick start and demo, see [[Reshma Shetty/Recent changes]] for an example of using this page.
For a quick start and demo, see [[Reshma Shetty/Recent changes]] for an example of using this page.
Line 5: Line 5:
==Usage==
==Usage==


Currently, there is no interface to this special page other than creating a valid URL by hand. The select criteria is passed in one of two ways. The short/easy way is to pass parameters at the end of the URL as extra path info as in <nowiki>http://openwetware.org/wiki/Special:Recentchangeslimit/parameters</nowiki>. The second method is: <nowiki>http://openwetware.org/index.php?title=Special:Recentchangeslimit&select=parameters</nowiki>. Without any selection parameters, the page should appear almost identical to the normal changes list.
Currently, the only interface to using this special page is to create a URL by hand. The select criteria is passed in one of two ways. The short/easy way is to pass parameters at the end of the URL as extra path info as in <nowiki>http://openwetware.org/wiki/Special:Recentchangeslimit/parameters</nowiki>. The second method is: <nowiki>http://openwetware.org/index.php?title=Special:Recentchangeslimit&select=parameters</nowiki>. Without any selection parameters, the page should appear almost identical to the normal changes list.


Once a URL is created, the appropriate page can be either bookmarked or included within another wiki page.
Once a URL is created, the appropriate page can be either bookmarked in your browser, linked from a wiki page, or directly included within another wiki page.


===Selection Specification===
===Selection Specification===
Line 14: Line 14:


====Expression====
====Expression====
The general form for one expression is '''type=match'''.


Types are either 1 or 2 letter codes. Known types and their meaning:
The general form for an expression is <nowiki><match type>=<match pattern></nowiki>.


* b: titles that begin with match
Match types are 1 or 2 letter codes and specify how the match pattern should be used in selecting items to display in the recent changes list. The basic types and their meaning:
* e: titles that end with match
* c: titles that contain match
* m: titles that match where the match expression can contain '%' character to represent a wildcard character. This is a more general version of the b, e, and c types.
* n: pages that are in the given namespace. Note that namespaces are given by numbers. Go to the normal recent changes limit, select the desired namespace, and look at the URL to determine the namespace to number mapping.


All of the above types have another type with an extra n in front, i.e. nb, ne, nc, nm, nn. These types represent the negation of the version without the n.
* b: titles that begin with the pattern
* e: titles that end with the pattern
* c: titles that contain the pattern
* m: titles that match where the match expression can contain any number of the '%' character to represent a wildcard character that matches any number of charaters. This is a more general version of the b, e, and c types.
* n: The match pattern in this case must be a number and this matches all pages that are in the given namespace. To find the number of a namespace, go to the normal recent changes limit, select the desired namespace, and look at the URL to determine the namespace to number mapping.


The default if no type is specified (that is only '''match''') is type 'b'.
All of the above types have a negated version with an extra n in front, i.e. nb, ne, nc, nm, nn. For example, nb=foo will match all pages that ''don't'' begin with foo.


Note that for the purpose of page title matching, it is necessary to be clear whether a page is in a different namespace. For example, User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but b=Austin would and ns=2 would also. Pages prefixed like Knight:Contact are not really in a different namespace but in the main namespace so this page title would actually be Knight:Contact.
If no match type is specified (there is no equals sign), then the matching will be done with the default type of 'b'.
 
Note that for the purpose of selecting pages by titles, it is necessary to be clear which namespace a page is in. For example, the page User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but b=Austin would and ns=2 would also as the User namespace is number 2. However, pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.


====Joining Expressions====
====Joining Expressions====


'^' is used to represent AND and ',' (comma) is used to represent OR. Remember that expressions are assumed to be in disjunctive normal form so there's an intrinsic parenthesis order.
'^' is used to represent AND and ',' (comma) is used to represent OR. Expressions are assumed to be in disjunctive normal form so there's an intrinsic parenthesis order (and no way to change this order). This means that all the ANDs have higher precedence than the ORs.


===Examples===
===Examples===
* Select pages that begin with the Calendar: [[Special:Recentchangeslimit/b=Calendar]] or more simply [[Special:Recentchangeslimit/Calendar]]
* Select pages that begin with Calendar: [[Special:Recentchangeslimit/b=Calendar]] or more simply [[Special:Recentchangeslimit/Calendar]]
* Filter out all pages with a colon in them and pages in non-primary namespaces: [[Special:Recentchangeslimit/n=0^nc=:]]
* Filter out all pages with a colon in them and pages not in the main namespace: [[Special:Recentchangeslimit/n=0^nc=:]]
* Select last 10 pages that begin with either Endy or Knight: [[Special:Recentchangeslimit/Endy,Knight&limit=10]]
* Select pages that begin with either Endy or Knight and limit to the last 10 changes: [[Special:Recentchangeslimit/Endy,Knight&limit=10]]
* Select pages that have changed in User namespace except for people's user names that end with the letter n or pages that contain the letters a, b, c in that order  (demonstrating that you can do useless things to waste time with this extension): [[Special:Recentchangeslimit/n=2^ne=n,m=%a%b%c%]]
* Select pages that have changed in User namespace except for people's user names that end with the letter n or pages that contain the letters a, b, c in that order  (demonstrating that you can do useless things to waste time with this extension): [[Special:Recentchangeslimit/n=2^ne=n,m=%a%b%c%]]


===Including===
===Including within another page===
The special page can be included using the standard <nowiki>{{Special:Recentchangeslimit/parameters)}}</nowiki> syntax. This allows including a select list of changes on a page.
The special page can be included using the standard <nowiki>{{Special:Recentchangeslimit/parameters)}}</nowiki> syntax. This allows including a select list of changes on a page.


==Source Download==
==Source Download==

Revision as of 21:17, 27 February 2006

The standard recent changes list can be overwhelming with the number of changes. An extension to MediaWiki to allow limiting the changes list to certain pages has been written at Special:Recentchangeslimit.

For a quick start and demo, see Reshma Shetty/Recent changes for an example of using this page.

Usage

Currently, the only interface to using this special page is to create a URL by hand. The select criteria is passed in one of two ways. The short/easy way is to pass parameters at the end of the URL as extra path info as in http://openwetware.org/wiki/Special:Recentchangeslimit/parameters. The second method is: http://openwetware.org/index.php?title=Special:Recentchangeslimit&select=parameters. Without any selection parameters, the page should appear almost identical to the normal changes list.

Once a URL is created, the appropriate page can be either bookmarked in your browser, linked from a wiki page, or directly included within another wiki page.

Selection Specification

The selection criteria is specified as a boolean statement in disjunctive normal form (groups of expressions ANDed together that are then all ORed together).

Expression

The general form for an expression is <match type>=<match pattern>.

Match types are 1 or 2 letter codes and specify how the match pattern should be used in selecting items to display in the recent changes list. The basic types and their meaning:

  • b: titles that begin with the pattern
  • e: titles that end with the pattern
  • c: titles that contain the pattern
  • m: titles that match where the match expression can contain any number of the '%' character to represent a wildcard character that matches any number of charaters. This is a more general version of the b, e, and c types.
  • n: The match pattern in this case must be a number and this matches all pages that are in the given namespace. To find the number of a namespace, go to the normal recent changes limit, select the desired namespace, and look at the URL to determine the namespace to number mapping.

All of the above types have a negated version with an extra n in front, i.e. nb, ne, nc, nm, nn. For example, nb=foo will match all pages that don't begin with foo.

If no match type is specified (there is no equals sign), then the matching will be done with the default type of 'b'.

Note that for the purpose of selecting pages by titles, it is necessary to be clear which namespace a page is in. For example, the page User:Austin is not a page titled User:Austin but rather a page titled Austin in the namespace User. Thus, b=User won't match this page but b=Austin would and ns=2 would also as the User namespace is number 2. However, pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.

Joining Expressions

'^' is used to represent AND and ',' (comma) is used to represent OR. Expressions are assumed to be in disjunctive normal form so there's an intrinsic parenthesis order (and no way to change this order). This means that all the ANDs have higher precedence than the ORs.

Examples

Including within another page

The special page can be included using the standard {{Special:Recentchangeslimit/parameters)}} syntax. This allows including a select list of changes on a page.

Source Download

The extension was written by Austin Che and is available for download from:

Feel free to send comments or improvements.