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

From OpenWetWare
Jump to: navigation, search
m (OpenWetWare:Recentchangesfilter moved to User:Austin/Extensions/Recentchangesfilter)
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|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. When a filter is provided, an extra link is provided at the top that allows toggling between filtering and not filtering the changes list.
+
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 46: Line 44:
  
 
===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}}
==Source Download==
 
The extension was written by [[Austin Che]] and is available for download:
 
[http://austinche.name/mediawiki/SpecialRecentchangesfilter.php.txt SpecialRecentchangesfilter.php]
 
  
 +
----
 +
Send bugs and comments to [[Austin Che]]. Other extensions including  sources can be found at [[../]].
  
Feel free to send comments or improvements.
+
__NOTOC__

Revision as of 13:33, 11 March 2006

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.
  • 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 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 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):

25 September 2017

     09:18 

(Upload log). .

[Trevor S. Heaton‎; Anshul Krishnan‎ (2×)]

     

09:18

. . Trevor S. Heaton (talk | contribs) uploaded a new version of File:Graph 1.PNG

     

06:18

. . Anshul Krishnan (talk | contribs) uploaded File:BME100TempVTrials.png

     

06:10

. . Anshul Krishnan (talk | contribs) uploaded File:BME100L3Temp.png

24 September 2017

N    22:33  MediaWiki:Tagline‎ (diff | hist) . . (+16). . Yardena Cohen (talk | contribs) (less parsing)
N    22:32  MediaWiki:Pagetitle-view-mainpage‎ (diff | hist) . . (+11). . Yardena Cohen (talk | contribs) (less parsing)
N    22:32  MediaWiki:Opensearch-desc‎ (diff | hist) . . (+16). . Yardena Cohen (talk | contribs) (english-only?)
N    21:21  MediaWiki:Pagetitle‎ (diff | hist) . . (+16). . Yardena Cohen (talk | contribs) (idk if this will help or hurt)
N    21:18  MediaWiki:Aboutsite‎ (diff | hist) . . (+17). . Yardena Cohen (talk | contribs) (one less thing to parse)

     20:08 

(Upload log). .

[Anna Hoge‎ (2×)]

     

20:08

. . Anna Hoge (talk | contribs) uploaded File:AHgraph4.png

     

18:52

. . Anna Hoge (talk | contribs) uploaded File:AHgraph3.png

23 September 2017

     17:17  MediaWiki:Contactpage-pagetext‎ (diff | hist) . . (+36). . Yardena Cohen (talk | contribs) (don't ask me science questions plz)

     17:05 

(Deletion log). .

[Yardena Cohen‎ (6×)]

     

17:05

. . Yardena Cohen (talk | contribs) deleted page User talk:Deepak P Patil(Automatically deleted when merging users)

     

17:05

. . Yardena Cohen (talk | contribs) deleted page User:Deepak P Patil(Automatically deleted when merging users)

     

16:39

. . Yardena Cohen (talk | contribs) deleted page User talk:Chun H Hsieh(Automatically deleted when merging users)

     

16:39

. . Yardena Cohen (talk | contribs) deleted page User:Chun H Hsieh(Automatically deleted when merging users)

     

15:39

. . Yardena Cohen (talk | contribs) deleted page User talk:Satu Strandman(Automatically deleted when merging users)

     

15:39

. . Yardena Cohen (talk | contribs) deleted page User:Satu Strandman(Automatically deleted when merging users)

     17:05 

(User merge log). .

[Yardena Cohen‎ (6×)]

     

17:05

. . Yardena Cohen (talk | contribs) Deleted user: Deepak P Patil (8544) ‎

     

17:05

. . Yardena Cohen (talk | contribs) User Deepak P Patil (8544) merged to Anonymous (0) ‎

     

16:39

. . Yardena Cohen (talk | contribs) Deleted user: Chun H Hsieh (13046) ‎

     

16:39

. . Yardena Cohen (talk | contribs) User Chun H Hsieh (13046) merged to Anonymous (0) ‎

     

15:39

. . Yardena Cohen (talk | contribs) Deleted user: Satu Strandman (13640) ‎

     

15:39

. . Yardena Cohen (talk | contribs) User Satu Strandman (13640) merged to Anonymous (0) ‎

N    14:04 

MediaWiki:Contactpage-label‎‎ (2 changes | history) . . (+7). . [Yardena Cohen‎ (2×)]

     

14:04

(cur | prev) . . (-4). . Yardena Cohen (talk | contribs) (one word so it doesn't get wrapped)

N    

13:59

(cur | prev) . . (+11). . Yardena Cohen (talk | contribs) (label text for footer?)

     14:02 

New server‎‎ (2 changes | history) . . (-137). . [Yardena Cohen‎ (2×)]

     

14:02

(cur | prev) . . (+10). . Yardena Cohen (talk | contribs) (contact form)

     

11:34

(cur | prev) . . (-147). . Yardena Cohen (talk | contribs) (it happened)

N    14:01 

MediaWiki:Contactpage-url‎‎ (4 changes | history) . . (+21). . [Yardena Cohen‎ (4×)]

     

14:01

(cur | prev) . . (-23). . Yardena Cohen (talk | contribs) (relative again)

     

14:01

(cur | prev) . . (-10). . Yardena Cohen (talk | contribs) (actual url)

     

13:59

(cur | prev) . . (+23). . Yardena Cohen (talk | contribs) (full url?)

N    

13:57

(cur | prev) . . (+31). . Yardena Cohen (talk | contribs) (relative link)

     13:52 

(User rights log). .

[Yardena Cohen‎ (2×)]

     

13:52

. . Yardena Cohen (talk | contribs) changed group membership for Oww Op from bureaucrat and administrator to staff ‎

     

13:52

. . Yardena Cohen (talk | contribs) changed group membership for Oww Op from (none) to administrator and bureaucrat ‎

     13:47 (User creation log) . . User account Oww Op (talk | contribs) was created by Yardena Cohen (talk | contribs) and password was sent by email ‎
     11:34 (Patrol log) . . Yardena Cohen (talk | contribs) automatically marked revision 996201 of page New server patrolled ‎
     11:33  BIOL398-04/S15:Class Assignments by Week‎ (diff | hist) . . (-3). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Tessa A. Morris Class Assignments by Week to Tessa Morris Class Assignments by Week in a maintenance job.)
     11:33  Paris Bettencourt 2012/Notebook/modularity group/day by day/2012/07‎ (diff | hist) . . (+1). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from IGEM:Paris Bettencourt 2012/Notebook/modularity group/day by day//2012/07 to IGEM:Paris Bettencourt 2012/Notebooks/modularity group/day by day//2012/07 in a maintenance job.)
     11:33  Paris Bettencourt 2012/Notebook/modularity group/day by day/2012/07/03‎ (diff | hist) . . (+1). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from IGEM:Paris Bettencourt 2012/Notebook/modularity group/day by day//2012/07/03 to IGEM:Paris Bettencourt 2012/Notebooks/modularity group/day by day//2012/07/03 in a maintenance job.)
     11:33  BIOMOD/2012/TeamSendaiA/Methods‎ (diff | hist) . . (-1). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from BIOMOD/2012/TeamSendaiA/Methodsa to Biomod/2012/TeamSendaiA/Methods in a maintenance job.)
     11:33  Biomod/2012/TU Dresden/Nanosaurs/Project/Sponsor‎ (diff | hist) . . (+1). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Biomod/2012/TU Dresden/Nanosaurs/Sponsor to Biomod/2012/TU Dresden/Nanosaurs/Sponsors in a maintenance job.)
     11:33  User:Etienne Robillard/Notebook/Phenylmethylamine‎ (diff | hist) . . (-6). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from User:Etienne Robillard/Notebook/Phenylmethanamine to User:Etienne Robillard/Notebook/Benzylamine in a maintenance job.)
     11:33  Farre Lab:Teaching & Research Program‎ (diff | hist) . . (-18). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Farre Lab:Teaching&Research Program to Farre Lab:NSF T&R in a maintenance job.)
     11:33  Farre Lab:Teaching&Research Program‎ (diff | hist) . . (-24). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Farre Lab:Farre-Teaching&Research Program to Farre Lab:NSF T&R in a maintenance job.)
     11:33  Farre Lab:Farre-Teaching&Research Program‎ (diff | hist) . . (-21). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Farre Lab:NSFTeaching&Research Program to Farre Lab:NSF T&R in a maintenance job.)
     11:33  User:Etienne Robillard/Notebook/Chemtrails911 notebook/Agent Ecoli:PhotoReceptorComponent‎ (diff | hist) . . (-26). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from User:Etienne Robillard/Notebook/Agent Ecoli:PhotoReceptorComponent to User:Etienne Robillard/Notebook/Agent BZ in a maintenance job.)
     11:33  BIOX‎ (diff | hist) . . (+9). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Liu BioX to Template:Liu BioX in a maintenance job.)
     11:33  User:Kodipad Shafahed‎ (diff | hist) . . (+5). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from King jazz to User:King jazz in a maintenance job.)
     11:33  User talk:Kodipad Shafahed‎ (diff | hist) . . (+5). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Talk:King jazz to User talk:King jazz in a maintenance job.)
     11:33  User talk:Sen Liu‎ (diff | hist) . . (+3). . Redirect fixer (talk | contribs) (Automatically fixing double redirect from Talk:LiuGroup CTGU to Talk:LiuGroup of CTGU in a maintenance job.)

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