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

From OpenWetWare
Jump to navigationJump to search
No edit summary
No edit summary
 
(13 intermediate revisions by one other user not shown)
Line 1: Line 1:
The standard [[Special:Recentchanges|recent changes]] list can be overwhelming with the number of changes. An extension to MediaWiki to allow filtering the changes list using complex patterns is running on OpenWetWare.
==Special:Recentchanges Filtering==
The standard [[Special:Recentchanges|recent changes]] list can be overwhelming on a large site with the number of changes. This extension allows users to track a subset of changes that they are interested in and allows users to set preferences for the default filters to use when displaying the recent changes list.  


For a quick start and demo, see [[Reshma Shetty/Recent changes]] for an example of using this page.
===General Usage===
The key to using this extension is to create desired filters. A filter is used in several possible ways. The filter can be passed as parameters at the end of the URL as extra path info, e.g. '''/wiki/Special:Recentchanges/parameters'''. They can also be passed with the real script path as in  '''/index.php?title=Special:Recentchanges&filter=parameters'''. A URL created in this manner can be either bookmarked in a browser, linked from a wiki page, or directly included within another wiki page (see below).  


==Usage==
Logged in users also have the ability to set their preferences (with help from the [[../PreferencesExtension/]]). When that extension is also installed, several additional options are added under the recent changs tab of a user's preferences. The enable filtering option turns on or off default filtering. With this option off, when the recent changes page is accessed without a filter in the URL, a normal recent changes page is returned (all results). If this option is enabled, then the other options determine the behavior of the [[Special:Recentchanges]] page when accessed without a filter. The filter list is of the form <tt>[name1]filter1...;[name2]filter2...;[name3]filter3</tt> for as many filters as one would like to define. The [name] part is optional but if not specified, the default name will be the filter number. The last preference allows specifying the default filter (by number, with the first filter numbered 0). When a user access the recent changes page, the default filter will be used if no other filter is given. In addition, the page will contain easy links to switch between all the filters listed on their filter list. An empty filter will always match everything and it is probably a good idea to always include this somewhere in one's list.


Currently, the only interface for using this extension is to create a URL by hand. The filtering 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:Recentchanges/parameters</nowiki>. The second method is: <nowiki>http://openwetware.org/index.php?title=Special:Recentchanges&filter=parameters</nowiki>. Without any filter parameters, the page is identical to the normal changes list.
===Filter Specification===


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.
The filter is specified as a boolean statement in disjunctive normal form (groups of expressions ANDed together that are then all ORed together).  
 
===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====
====Expression====
Line 19: Line 17:
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:
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
* '''b''': titles that begin with the pattern
* e: titles that end with the pattern
* '''e''': titles that end with the pattern
* c: titles that contain 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.
* '''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. Note that for URLs, you may need to encode the percent using '%25' in the URL.
* 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.
* '''p''': matches the page of the given name (will always match at most one page). The page name should be given fully qualified with the namespace prefix as appropriate (e.g. as p=User:Austin). The criteria n=User^p=Austin will never match any pages because p=Austin is interpreted as being in the main namespace and no page can be in both the User and main namespaces.
* u: match changes that were done by the given user
* '''n''': The match pattern should be either a number corresponding to a namespace or the name of a namespace. This matches all pages that are in the given namespace. The main namespace has number 0 and doesn't have a name so you have to use the number. For other namespaces, you can use the name (e.g. 'User talk') or you can find the number by selecting the namespace in the dropdown list of the recent changes page, click go, and look at the URL to determine the namespace to number mapping. There's also a namespace called 'Special' with number -1 that includes pages like the upload log.
* w: match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.
* '''u''': match changes that were done by the given user
* '''w''': match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.


All of the above types have a negated version with an extra n in front, i.e. nb, ne, nc, nm, etc. For example, nb=foo will match all pages that ''don't'' begin with foo.
All of the above types have a negated version with an extra n in front, i.e. '''nb''', '''ne''', '''nc''', etc. 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'.
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.
''Note that for the purpose of selecting pages by title patterns, 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 either b=Austin or n=User would. Pages like Knight:Contact are in the main namespace so b=Contact wouldn't match this whereas b=Knight would.


====Joining Expressions====
====Joining Expressions====
Line 43: Line 42:
* Filter out all pages with a colon in them and pages not in the main namespace: [[Special:Recentchanges/n=0^nc=:]]
* Filter out all pages with a colon in them and pages not in the main namespace: [[Special:Recentchanges/n=0^nc=:]]
* Select pages that begin with either Endy or Knight and limit to the last 10 changes: [[Special:Recentchanges/Endy,Knight&limit=10]]
* Select pages that begin with either Endy or Knight and limit to the last 10 changes: [[Special:Recentchanges/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 or that are on your watchlist  (demonstrating that you can do useless things to waste time with this extension): [[Special:Recentchanges/n=2^ne=n,m=%a%b%c%,w=1]]
* 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 or that are on your watchlist  (demonstrating that you can do useless things to waste time with this extension): [[Special:Recentchanges/n=User^ne=n,m=%a%b%c%,w=1]]


===Including within another page===
===Including within another page===
The special page can be included using the standard <nowiki>{{Special:Recentchanges/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:Recentchanges/parameters)}}</nowiki> syntax. This allows including a select list of changes on a page. For example, here's a live demo showing the last 5 changes of articles in the main namespace that do not have a ':' in their name (uncategorized/general pages):{{Special:Recentchanges/n=0^nc=:&limit=5}}
 
==Installation/MediaWiki compatibility==
 
More than most extensions, this one depends heavily on the internals of MediaWiki. Much of the code from wfSpecialRecentchanges is directly copied into this extension and updates to MediaWiki will require the corresponding update to this code. The current version of the code has been updated to work with the version of  MediaWiki running on this wiki (version {{CURRENTVERSION}}). Older versions are also available in the source directory.


==Source Download==
----
The extension was written by [[Austin Che]] and is available for download:
Send bugs and comments to [[Austin Che]]. Other extensions including  sources can be found at [[../]].
[http://austinche.name/mediawiki/SpecialRecentchangesfilter.php.txt SpecialRecentchangesfilter.php]


__NOTOC__


Feel free to send comments or improvements.
[[category:Extensions]]

Latest revision as of 08:38, 17 November 2007

Special:Recentchanges Filtering

The standard recent changes list can be overwhelming on a large site with the number of changes. This extension allows users to track a subset of changes that they are interested in and allows users to set preferences for the default filters to use when displaying the recent changes list.

General Usage

The key to using this extension is to create desired filters. A filter is used in several possible ways. The filter can be passed as parameters at the end of the URL as extra path info, e.g. /wiki/Special:Recentchanges/parameters. They can also be passed with the real script path as in /index.php?title=Special:Recentchanges&filter=parameters. A URL created in this manner can be either bookmarked in a browser, linked from a wiki page, or directly included within another wiki page (see below).

Logged in users also have the ability to set their preferences (with help from the PreferencesExtension). When that extension is also installed, several additional options are added under the recent changs tab of a user's preferences. The enable filtering option turns on or off default filtering. With this option off, when the recent changes page is accessed without a filter in the URL, a normal recent changes page is returned (all results). If this option is enabled, then the other options determine the behavior of the Special:Recentchanges page when accessed without a filter. The filter list is of the form [name1]filter1...;[name2]filter2...;[name3]filter3 for as many filters as one would like to define. The [name] part is optional but if not specified, the default name will be the filter number. The last preference allows specifying the default filter (by number, with the first filter numbered 0). When a user access the recent changes page, the default filter will be used if no other filter is given. In addition, the page will contain easy links to switch between all the filters listed on their filter list. An empty filter will always match everything and it is probably a good idea to always include this somewhere in one's list.

Filter Specification

The filter 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. Note that for URLs, you may need to encode the percent using '%25' in the URL.
  • p: matches the page of the given name (will always match at most one page). The page name should be given fully qualified with the namespace prefix as appropriate (e.g. as p=User:Austin). The criteria n=User^p=Austin will never match any pages because p=Austin is interpreted as being in the main namespace and no page can be in both the User and main namespaces.
  • n: The match pattern should be either a number corresponding to a namespace or the name of a namespace. This matches all pages that are in the given namespace. The main namespace has number 0 and doesn't have a name so you have to use the number. For other namespaces, you can use the name (e.g. 'User talk') or you can find the number by selecting the namespace in the dropdown list of the recent changes page, click go, and look at the URL to determine the namespace to number mapping. There's also a namespace called 'Special' with number -1 that includes pages like the upload log.
  • u: match changes that were done by the given user
  • w: match changes for pages on your (or whoever's currently logged in) watchlist. The match pattern is ignored so it can just be set to 1 or left off completely.

All of the above types have a negated version with an extra n in front, i.e. nb, ne, nc, etc. 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 title patterns, 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 either b=Austin or n=User would. 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:Recentchanges/parameters)}} syntax. This allows including a select list of changes on a page. For example, here's a live demo showing the last 5 changes of articles in the main namespace that do not have a ':' in their name (uncategorized/general pages):

List of abbreviations:
N
This edit created a new page (also see list of new pages)
m
This is a minor edit
b
This edit was performed by a bot
(±123)
The page size changed by this number of bytes

14 June 2024

N    12:55  UA Biophysics:Peptides and IA‎‎ 3 changes history +1,837 [Elizabeth Suesca‎ (3×)]
     
12:55 (cur | prev) +44 Elizabeth Suesca talk contribs
     
12:54 (cur | prev) −68 Elizabeth Suesca talk contribs
N    
12:45 (cur | prev) +1,861 Elizabeth Suesca talk contribs (Created page with "Debido a la rápida aparición de mecanismos de resistencia a antibióticos en diferentes microorganismos patógenos potencialmente mortales a nivel mundial, existe un gran interés en la identificación de agentes antimicrobianos alternativos que puedan ayudar en el desarrollo de nuevas estrategias de tratamiento. Mediante la aplicación de una rutina de Deep Learning, desarrollada y publicada por el grupo de investigación proponente, se predecirá una lista de candida...")
     12:45  Biophysics‎‎ 3 changes history +204 [Elizabeth Suesca‎ (3×)]
     
12:45 (cur | prev) +4 Elizabeth Suesca talk contribs
     
12:44 (cur | prev) +1 Elizabeth Suesca talk contribs
     
12:29 (cur | prev) +199 Elizabeth Suesca talk contribs

13 June 2024

     14:39 User creation log User account Yannvrb talk contribs was created by Yar talk contribs and password was sent by email ‎
     13:57  Magni:Back Door‎‎ 2 changes history +199 [Lorenzo Pasotti‎ (2×)]
     
13:57 (cur | prev) +151 Lorenzo Pasotti talk contribs
     
13:54 (cur | prev) +48 Lorenzo Pasotti talk contribs (→‎E. coli strains)
     08:28  WAKNA:Basics‎‎ 3 changes history −73 [Berthold Drexler‎ (3×)]
     
08:28 (cur | prev) −204 Berthold Drexler talk contribs (→‎Hier finden Sie Literatur für Einsteiger:innen in das Gebiet der Neuroanästhesie)
     
08:26 (cur | prev) 0 Berthold Drexler talk contribs (→‎Hier finden Sie Literatur für Einsteiger:innen in das Gebiet der Neuroanästhesie)
     
08:26 (cur | prev) +131 Berthold Drexler talk contribs (→‎halbsitzende Lagerung und Luftembolie)

12 June 2024

N    13:10  Karas Lab:YAEL Electrode Localization‎‎ 2 changes history +859 [Aclesage‎ (2×)]
     
13:10 (cur | prev) +585 Aclesage talk contribs
N    
13:08 (cur | prev) +274 Aclesage talk contribs (Created page with "<b>Y</b>our <b>A</b>dvanced <b>E</b>lectrode <b>L</b>ocalizer (YAEL) is free and open-source software for localizing and visualizing electrodes. YAEL is a sister package to the RAVE software toolbox for the analysis of intracranial electroencephalogram (iEEG) data.")
     13:04  Karas Lab:Lab Notebook‎‎ 2 changes history +48 [Aclesage‎ (2×)]
     
13:04 (cur | prev) 0 Aclesage talk contribs
     
13:00 (cur | prev) +48 Aclesage talk contribs
     06:13  Hu:Publications diffhist +33 Hugangqing talk contribs
     06:12  Hu diffhist +44 Hugangqing talk contribs

11 June 2024

N    19:16  BioMicroCenter:PricingFY2025 diffhist +28,119 Stuart S. Levine talk contribs (Created page with "''' PRICING UPDATE 7/1/2024 ''' == SEQUENCING == Please note that samples submitted from '''CORE LAB'''s will be given priority on all equipment. The BioMicro Center reserves the right to reject samples for any reason. <BR><BR> === NOVASEQ SEQUENCING === {| class="wikitable" border=1  ! NOVASEQ SEQUENCING !width=80| CORE LAB !width=80| MIT !width=80| Non-MIT !width=80| uni...")
     18:40  BioMicroCenter:Pricing diffhist +54 Stuart S. Levine talk contribs (→‎COMPUTATIONAL SERVICES)
     08:18  Forster Lab‎‎ 2 changes history +153 [Anthony C. Forster‎ (2×)]
 m   
08:18 (cur | prev) +4 Anthony C. Forster talk contribs (→‎The Boss!?)
     
08:16 (cur | prev) +149 Anthony C. Forster talk contribs (→‎The Boss!?)
     08:03  Pecreaux diffhist −1,628 Cedre-PecreauxLab talk contribs (→‎News!)

Installation/MediaWiki compatibility

More than most extensions, this one depends heavily on the internals of MediaWiki. Much of the code from wfSpecialRecentchanges is directly copied into this extension and updates to MediaWiki will require the corresponding update to this code. The current version of the code has been updated to work with the version of MediaWiki running on this wiki (version 1.40.1). Older versions are also available in the source directory.


Send bugs and comments to Austin Che. Other extensions including sources can be found at User:Austin J. Che/Extensions.