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

From OpenWetWare
Jump to: navigation, search
(Expression)
(Expression)
Line 21: Line 21:
 
* '''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. Note that for URLs, you may need to encode the percent using '%25' in the URL.
 
* '''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.
 
* '''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
 
* '''u''': match changes that were done by the given user
Line 29: Line 30:
 
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 all the match types that select by page titles, the behavior of the page title is as follows. If the title can be interepreted as a namespace:title where the namespace is something other than the main namespace, then n=namespace will automatically be added. For example, the pattern b=User:Austin is equivalent to n=User^b=Austin whereas b=Foo:Bar (Foo is not a valid namespace) matches any pages in ANY namespace beginning with Foo:Bar (such as User:Foo:Bar or User talk:Foo:Bar).
+
''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====

Revision as of 10:08, 23 September 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. 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):

16 January 2018

     11:46 

BioMicroCenter:People‎‎ (3 changes | history) . . (+267). . [Melissa Franco‎ (3×)]

     

11:46

(cur | prev) . . (+178). . Melissa Franco (talk | contribs) (UROPS / COOPS)

     

11:44

(cur | prev) . . (+2). . Melissa Franco (talk | contribs) (BioMicro Center Staff)

     

11:41

(cur | prev) . . (+87). . Melissa Franco (talk | contribs) (BioMicro Center Staff)

N    11:19  Template:Hassett‎ (diff | hist) . . (+1,062). . CMcDaniel (talk | contribs) (Created page with "150px <div style="padding: 10px; color: #ffffff; background-color: #000; width: 730px"> <center> Hassett | <font face="trebuchet ms" style="color:...")

     10:26 

(Deletion log). .

[Yar‎ (2×)]

     

10:26

. . Yar (talk | contribs) deleted page User talk:Sammy N. Saqer(Automatically deleted when merging users)

     

10:26

. . Yar (talk | contribs) deleted page User:Sammy N. Saqer(Automatically deleted when merging users)

     10:26 

(User merge log). .

[Yar‎ (2×)]

     

10:26

. . Yar (talk | contribs) Deleted user: Sammy N. Saqer (13395) ‎

     

10:26

. . Yar (talk | contribs) User Sammy N. Saqer (13395) merged to Sammy Saqer (13444) ‎

     10:21  Peyton:Internal‎ (diff | hist) . . (+85). . Elizabeth Brooks (talk | contribs) (Protocols)
     10:20 (Upload log) . . Elizabeth Brooks (talk | contribs) uploaded File:APTES DSC protocol 011618.pdf
     10:18  CAMRI:SeminarSeries‎ (diff | hist) . . (+26). . Michael S Beauchamp (talk | contribs)

     10:11 

(User creation log). .

[Yar‎ (13×)]

     

10:11

. . User account Melissa Franco (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Bmetzger (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Mgmonten (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Elena Gomez (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Amtran4 (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Dan (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Aml (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account GratreakBDK (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Aishaalsuwaidi-9 (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Biotechguy (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Reinca (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account Ninjatigerdeath (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     

10:11

. . User account CMcDaniel (talk | contribs) was created by Yar (talk | contribs) and password was sent by email ‎

     09:39  Beauchamp:Orientation‎ (diff | hist) . . (+51). . Michael S Beauchamp (talk | contribs)
     02:42  Harvard:Biophysics 101/2018‎ (diff | hist) . . (+231). . Geochurch (talk | contribs)

     00:13 

User:S. Saini‎‎ (5 changes | history) . . (+193). . [S. Saini‎ (5×)]

     

00:13

(cur | prev) . . (+2). . S. Saini (talk | contribs) (Contact)

     

00:13

(cur | prev) . . (0). . S. Saini (talk | contribs) (Conference Presentations/Invited Talks)

     

00:13

(cur | prev) . . (0). . S. Saini (talk | contribs) (Publications)

     

00:13

(cur | prev) . . (0). . S. Saini (talk | contribs) (Past Members)

     

00:13

(cur | prev) . . (+191). . S. Saini (talk | contribs) (Research Group)

15 January 2018

N    22:25  BME100 s2018:Projects3‎ (diff | hist) . . (+4,624). . Aahancoc (talk | contribs) (Created page with "{|{{table}} width="800" |- |style="background-color: #EEE"|128px<span style="font-size:22px;"> BME 100 Spring 2018</span> |style="background-col...")

N    22:21 

Template:ASUBME100 s2018 L2‎‎ (2 changes | history) . . (+2,336). . [Aahancoc‎ (2×)]

     

22:21

(cur | prev) . . (0). . Aahancoc (talk | contribs)

N    

22:20

(cur | prev) . . (+2,336). . Aahancoc (talk | contribs) (Created page with "{|{{table}} width="800" |- |style="background-color: #EEE"|128px<span style="font-size:22px;"> BME 100 Spring 2018</span> |style="background-col...")

N    22:18 

BME100 s2018:Projects2‎‎ (3 changes | history) . . (+4,624). . [Aahancoc‎ (3×)]

     

22:18

(cur | prev) . . (+173). . Aahancoc (talk | contribs)

     

22:17

(cur | prev) . . (+1,414). . Aahancoc (talk | contribs) (Lab 2: “Title”)

N    

22:16

(cur | prev) . . (+3,037). . Aahancoc (talk | contribs) (Created page with "=Lab 2: “Title”= * '''Content''' <br> * '''Content''' <br> * '''Content''' <br><br> '''HW: Lab Report 2 (due mm/dd/yy at hh:mm AM/PM through OpenWetWare)'''<br><br> '...")

     22:12  BME100 s2018:Projects1‎ (diff | hist) . . (0). . Aahancoc (talk | contribs)

N    22:06 

User:Aahancoc‎‎ (3 changes | history) . . (+2,999). . [Aahancoc‎ (3×)]

     

22:06

(cur | prev) . . (+1,414). . Aahancoc (talk | contribs)

     

22:05

(cur | prev) . . (+85). . Aahancoc (talk | contribs)

N    

22:02

(cur | prev) . . (+1,500). . Aahancoc (talk | contribs) (Created page with "{|{{table}} width="800" |- |style="background-color: #EEE"|128px<span style="font-size:22px;"> BME 100 Spring 2018</span> |style="background-col...")

     20:48 

User:J. Antonio Ibarra‎‎ (4 changes | history) . . (+616). . [J. Antonio Ibarra‎ (4×)]

     

20:48

(cur | prev) . . (+256). . J. Antonio Ibarra (talk | contribs)

     

20:33

(cur | prev) . . (+21). . J. Antonio Ibarra (talk | contribs) (Collaborators)

     

20:32

(cur | prev) . . (+106). . J. Antonio Ibarra (talk | contribs) (Research interests)

     

20:30

(cur | prev) . . (+233). . J. Antonio Ibarra (talk | contribs) (Contact Info)

     17:25  User:Jszab‎ (diff | hist) . . (-225). . Jszab (talk | contribs)
     12:26  Harvard:Biophysics 101/2018‎ (diff | hist) . . (+910). . Geochurch (talk | contribs)
     12:25  Template:Harvard Biophysics 101:2018‎ (diff | hist) . . (-145). . Geochurch (talk | contribs)

 m   11:17 

User:Richard J. Abbott‎‎ (2 changes | history) . . (-13). . [Richard J. Abbott‎ (2×)]

 m   

11:17

(cur | prev) . . (0). . Richard J. Abbott (talk | contribs) (Publications)

 m   

11:07

(cur | prev) . . (-13). . Richard J. Abbott (talk | contribs) (Publications)

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 MediaWiki 1.6. An older version that works with MediaWiki version 1.5 is 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.