Extension:WhoIsWatching

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.svg
Who Is Watching

Release status:Extension status stable

ImplementationTemplate:Extension#type Special page, Database, Parser function
DescriptionTemplate:Extension#description Find out who is watching a particular page, and add others to watchlist for that page
Author(s)Template:Extension#username
Latest versionTemplate:Extension#version 0.12.1 (2018-04-16)
MediaWikiTemplate:Extension#mediawiki 1.26+
PHPTemplate:Extension#php 5.4+
LicenseTemplate:Extension#license GNU General Public License 2.0 only
Download
ExampleTemplate:Extension#example http://ec.europa.eu/eurostat/
ParametersTemplate:Extension#parameters
  • $whoiswatching_nametype
  • $whoiswatching_allowaddingpeople
  • $whoiswatching_showifzero
  • $whoiswatching_showwatchingusers
  • $whoiswatching_maxPicklistUsers
Added rightsTemplate:Extension#rights
  • addpagetoanywatchlist
  • seepagewatchers
Hooks usedTemplate:Extension#hook
SkinTemplateOutputPageBeforeExecManual:Hooks/SkinTemplateOutputPageBeforeExec
ParserFirstCallInitManual:Hooks/ParserFirstCallInit

Translate the WhoIsWatching extension if it is available at translatewiki.net

Check usage and version matrix.

The WhoIsWatching extension allows to find out who is watching a particular page, and add others to watchlist for that page

Rationale[edit]

Even though this notion goes against Wikipedia and Wikimedia privacy policy, some wikis may actually like to see which of its users are watching particular pages. This extension provides just such an interface at the bottom of every page. Additionally, this extension has an option to allow any user to add any page to any other user's watch list.

Installation[edit]

  • Download and place the file(s) in a directory called WhoIsWatching in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'WhoIsWatching' );
    # $whoiswatching_nametype = "RealName";
    # $whoiswatching_allowaddingpeople = false;
    # $whoiswatching_showifzero = true;
    # $whoiswatching_showwatchingusers = false;
    # $whoiswatching_maxPicklistUsers = 10;
    # $wgGroupPermissions['sysop']['addpagetoanywatchlist'] = true;
    # $wgGroupPermissions['sysop']['seepagewatchers'] = true;
    
  • YesY Done - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration[edit]

You can simply start using the extension without changing anything else. The only additional configuration that is currently possible for the extension defines how to display the names of the users watching the pages. In SpecialWhoIsWatching.php, there is

# Set the following to either 'UserName' or 'RealName' to change how watching
# users are displayed.
$whoiswatching_nametype = 'RealName';

As the comment implies, depending on the value of this variable, you can display either the real names of the watching users or their wiki usernames. The reason some wiki's may want to switch over to the 'UserName' mode is if they do not require their members to have a valid real name.

Another configurable option in the extension is the ability to switch on/off the option to allow any user to add any page to any other user's watch list. This is done in SpecialWhoIsWatching.php, where there is

# Set true if you don't want to use permissions and users are allowed to add
# to other user's watchlists.
$whoiswatching_allowaddingpeople = true;

It is also possible to only display the count of watching people if the count is greater than zero. This is done in SpecialWhoIsWatching.php, where there is

# Set to true if you want people with permission to see 0 if no one is watching
# the page.
$whoiswatching_showifzero = true;

Finally, newer versions of this extension, while we attempt to be backward compatible, allow you to use permissions instead of global variables.

# Set to true if you don't want to use permissions.
$whoiswatching_showwatchingusers = true;

By default, users in the sysop group have permission to see page watchers and add pages to anyone's watchlist. You can grant these permissions to logged in users, too, or any group you think needs it.

# Give all logged in users full access.
$wgGroupPermissions['user']['addpagetoanywatchlist'] = true;
$wgGroupPermissions['user']['seepagewatchers'] = true;

Usage[edit]

This extension also provides the {{#whoiswatching|Some Page}} parser function showing the number of watching users of Some Page plus providing a link to Special:WhoIsWatching/Some Page. This can be used with skins not supporting footer links or to create the WhoIsWatching link somewhere in a wiki page.

Known Issues[edit]

The first time after a you submit a request to remove a page from the users watchlist, the user is still shown on the form. To get around this it is disabled and displayed with a red strikethrough.