User:Austin J. Che/Extensions/Recentchangesfilter

From OpenWetWare
Jump to navigationJump to search

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

20 October 2020

     11:00  User:Massih Forootan‎‎ 6 changes history +462 [Massih Forootan‎ (6×)]
     
11:00 (cur | prev) +455 Massih Forootan talk contribs →‎Career Profile
     
10:58 (cur | prev) +3 Massih Forootan talk contribs →‎PROFESSIONAL EXPERIENCE
     
10:57 (cur | prev) +28 Massih Forootan talk contribs →‎Career Profile
     
10:49 (cur | prev) +65 Massih Forootan talk contribs →‎Education
     
10:45 (cur | prev) -23 Massih Forootan talk contribs →‎Contact Information
     
10:44 (cur | prev) -66 Massih Forootan talk contribs →‎Contact Information
     10:38 Upload log Massih Forootan talk contribs uploaded a new version of File:Forootan.jpg
     10:33  Lee:Publications‎‎ 2 changes history +609 [Wooin Lee‎ (2×)]
     
10:33 (cur | prev) +436 Wooin Lee talk contribs →‎2020
     
10:00 (cur | prev) +173 Wooin Lee talk contribs →‎2020

19 October 2020

N    23:46  BIOL368/F20:Class Journal Week 7‎‎ 6 changes history +1,757 [Aiden Burnett‎ (6×)]
     
23:46 (cur | prev) -4 Aiden Burnett talk contribs →‎After the library workshop, but before you do the readings: another typo, my bad yall
     
23:45 (cur | prev) -9 Aiden Burnett talk contribs →‎After the library workshop, but before you do the readings: edited wording
     
23:45 (cur | prev) +11 Aiden Burnett talk contribs →‎After the library workshop, but before you do the readings: fixed typo
     
23:43 (cur | prev) +717 Aiden Burnett talk contribs →‎After the library workshop, but before you do the readings: answered questions 1 & 2
     
23:01 (cur | prev) +998 Aiden Burnett talk contribs →‎Aiden Burnett: wrote questions
N    
23:00 (cur | prev) +44 Aiden Burnett talk contribs created page
     22:56  Aiden Burnett Week 7 diffhist -63 Aiden Burnett talk contribs removed unnecessary sections
     19:12  Yaniv Maddahi Journal Week 7 diffhist +569 Yaniv Maddahi talk contribs →‎References: added references
     17:02  BioMicroCenter:BIG meeting diffhist +15 George W Bell talk contribs
     12:28  Peyton:Internal diffhist +80 Carey Dougan talk contribs
     12:27 Upload log Carey Dougan talk contribs uploaded File:Peyton Lab slide Master.pptx.zip(Master Slides for Peyton Lab Presentations)
     12:01  Lee:Publications‎‎ 4 changes history +866 [Wooin Lee‎ (4×)]
     
12:01 (cur | prev) -154 Wooin Lee talk contribs →‎2020
     
12:00 (cur | prev) +971 Wooin Lee talk contribs →‎2020
     
11:50 (cur | prev) +15 Wooin Lee talk contribs →‎2020
     
11:49 (cur | prev) +34 Wooin Lee talk contribs →‎2020
     11:07  Rich Lab:Lab Meeting Schedule diffhist +139 Yueh-Fen Li talk contribs
     08:51  Silver: 2020 Meeting Schedule‎‎ 3 changes history +17 [PamSilver‎ (3×)]
     
08:51 (cur | prev) +3 PamSilver talk contribs →‎October
     
08:23 (cur | prev) -7 PamSilver talk contribs →‎November
     
08:23 (cur | prev) +21 PamSilver talk contribs →‎October
     08:31  RAVE:Tutorial Importing diffhist +372 Michael S Beauchamp talk contribs
     08:09  Beauchamp:iEEGWorkflow diffhist +53 Michael S Beauchamp talk contribs
     07:20  BioMicroCenter:BioinfoClasses diffhist -11 Duanduan Ma talk contribs

18 October 2020

     18:09  Chenlab:Lab Members‎‎ 3 changes history +69 [Kaifu Chen‎ (3×)]
     
18:09 (cur | prev) +5 Kaifu Chen talk contribs
     
18:09 (cur | prev) +35 Kaifu Chen talk contribs
     
18:08 (cur | prev) +29 Kaifu Chen talk contribs

17 October 2020

16 October 2020

     17:08  BIOL368/F20:Class Journal Week 6 diffhist +1,721 Taylor Makela talk contribs Taylor Makela - added to class journal (I'm sorry this is late Dr. Dahlquist, I am just now starting to feel better! This week (week 7) will most definitely be on time)
N    16:54  Taylor Makela Journal Week 7‎‎ 3 changes history +46 [Taylor Makela‎ (3×)]
     
16:54 (cur | prev) +18 Taylor Makela talk contribs invoked template
     
16:52 (cur | prev) 0 Taylor Makela talk contribs fixed week number
N    
16:52 (cur | prev) +28 Taylor Makela talk contribs creating page
     16:51  Taylor Makela Journal Week 6‎‎ 3 changes history +3,876 [Taylor Makela‎ (3×)]
     
16:51 (cur | prev) +1 Taylor Makela talk contribs →‎Acknowledgments
     
16:51 (cur | prev) +2,685 Taylor Makela talk contribs →‎References: added references for class journal
     
16:23 (cur | prev) +1,190 Taylor Makela talk contribs →‎Scientific Conclusion: added
     12:20  UA Biophysics:Protocols:PBS‎‎ 2 changes history +140 [Elizabeth Suesca‎ (2×)]
     
12:20 (cur | prev) -3 Elizabeth Suesca talk contribs →‎Recipe
     
12:18 (cur | prev) +143 Elizabeth Suesca talk contribs
     08:02  Beauchamp:iEEGWorkflow diffhist +18 Yuezhang talk contribs
     07:34  E. coli genotypes‎‎ 5 changes history +893 [Wouter De Schamphelaire‎ (5×)]
     
07:34 (cur | prev) +123 Wouter De Schamphelaire talk contribs →‎HB101
     
07:32 (cur | prev) +3 Wouter De Schamphelaire talk contribs →‎C600
     
07:31 (cur | prev) +124 Wouter De Schamphelaire talk contribs →‎C600
     
07:22 (cur | prev) +642 Wouter De Schamphelaire talk contribs →‎Commonly used strains
     
07:18 (cur | prev) +1 Wouter De Schamphelaire talk contribs →‎WK6mut(λ)

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.34.2). 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.