Coder Social home page Coder Social logo

wikimedia / mediawiki-extensions-whoiswatching Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 732 KB

Github mirror of MediaWiki extension WhoIsWatching - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)

Home Page: https://gerrit.wikimedia.org

PHP 98.33% JavaScript 1.47% CSS 0.20%

mediawiki-extensions-whoiswatching's Introduction

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

Table of Contents

Rationale

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 Instructions

Step 1

Download the version of the extension code appropriate for your MediaWiki version from here and extract into the extensions/WhoIsWatching folder.

Step 2

Add the following text to 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;

Additional Configuration

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;

Known Issues

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.

(There maybe a way to address this in a better way, patches welcome!)

Revisions

0.12.1 - April 15, 2017
  • Deprecated PHP entry point was removed.
0.12.0 - May 22, 2016
Incompatibilites:
  • Requires at least MediaWiki 1.26
  • If you've made changes to the message displayed at the bottom of the page in MediaWiki:number_of_watching_users_pageview, you'll need to see if it matches what is in MediaWiki:whoiswatchingpageview on your wiki.
  • Note the use of permissions is preferred to globals to allow access to the Special Page
Other Changes:
  • Use extension.json
  • Remove .i18n.php stub.
  • Add rights so that we can use those instead of globals to control access:
    • addpagetoanywatchlist: gets to use the special page to add users.
    • seepagewatchers: gets to see the watchers.
  • Clean up WhoIsWatching::execute() method:
    • Use fewer globals. Use GlobalVarConfig where possible.
    • Use protected methods for various parts of the execution path.
    • Add stub (WhoIsWatching::eNotifUser()) to later notify editors when their watchlists are changed.
    • Add stub (WhoIsWatching::uiNotifyUser()) to later provide better feedback to users of this extension.
    • Instead of listing out every user to choose from, provide autocomplete for user selection.
    • Instead of showing a confusing "usage" message, provide an autocomplete input box so that the user can select a page to inspect.
    • Provide slightly better error messages.
    • Refactor to make code more readable.
  • Adapted to changes in core MediaWiki since 1.25:
    • Moved $wgPageShowWatchingUsers which was removed from core in 1.25 to $whoiswathing_showwatchingusers
    • Since the message had to be changed anyway, moved the message from number_of_watching_users_pageview to whoiswatchingpageview
    • Remove use of sprintf for i18n construction.
0.11.0 - April 1, 2014
  • I18n was migrated to use json files.
0.10.0
  • ?
0.9.0 - October 6, 2008
  • Fixed the extension instantiation to work across MW versions
  • Fixed the feature that displays count of users if zero
0.8.0 - September 29, 2008
  • optionally display a count of 0 watching users (contributed by user:Djomp)
0.7.0 - September 5, 2008
  • added descriptionmsg, change special page alias loading method; removed obsolete code (by user:siebrand)
0.6.0 - June 6, 2008
  • Optionally disable the feature to make other users watch the page.
0.5.0 - May 12, 2008
  • Better handling of user names
0.4.0 - December 27, 2007
  • new feature - add other users to the list of people watching the page
  • sort the list of people watching the page
  • minor bug fix on listing which page the information is pertaining to when the page is a category
0.3.0 - November 25, 2007
  • More standard way to load i18n messages (resolve bug about "Call to undefined function wfLoadExtensionMessages()")
0.2.0 - November 23, 2007
0.1.0 - October 12, 2007
  • Initial publication.

mediawiki-extensions-whoiswatching's People

Contributors

aaronschulz avatar cicalese avatar floriansw avatar hexmode avatar jayprakash-se avatar jdforrester avatar jdlrobson avatar kizule avatar ladsgroup avatar legoktm avatar motlib avatar neoncitylights avatar raymondde avatar reedy avatar siebrand avatar thiemowmde avatar translatewiki avatar umherirrender avatar vitalif avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

mediawiki-extensions-whoiswatching's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.