Extension talk:WhoIsWatching/Archive
Add topicProblem with installation.
[edit]I've installed WhoIsWatching on MediaWiki 1.9.1 and the extension shows up in the version page. However, on the Special Pages, I show the list leading with <specialwhoiswatching>, which when clicked gives this error:
Fatal error: Call to undefined function wfLoadExtensionMessages() in ... (ip address) ... /wiki/extensions/SpecialWhoIsWatching_body.php on line 25
Any ideas? --C4duser 23:00, 24 November 2007 (UTC)
- After doing some searching, it looks like this is a bug in MediaWiki itself. Apparently there are some version that did not have the wfLoadExtensionMessages() function. Anyways, I changed the way the internationalization messages get loaded to not rely on this function. The new code is available in v0.3 (already in SVN). Please let me know if this code works any better for you. --Gri6507 14:43, 25 November 2007 (UTC)
- Thanks. The error message has gone away and the Special page shows up properly. However, I don't seem to be using the extension properly. When clicking on the special page, I get: "This special page cannot be used on its own. Please use the page MediaWiki:Number_of_watching_users_pageview to define an entry point to this special page." I've placed the code you stipulate on the MediaWiki message page. What I am trying to do is to be able to set up a link on the sidebar (say "Current Watchers") that when clicked will produce a list of users that are watching that particular page. Is this possible? --C4duser 02:49, 26 November 2007 (UTC)
- OK. I've figured out that what is supposed to happen is for a message to appear at the bottom of the page showing the number of watchers. I do get a message at the bottom of the page, but something is wrong with the code. Here is the message: "[http:// ...IP address .../wiki/index.php?title=Special:SpecialWhoIsWatching&ns=...correct namespace ...&page=...correct pagename ...1] watching users" The number of "watching users" was indeed 1, so that appears to be correct, but I don't think there should be two "specials" in the special page name or that the IP address should appear. Might this be a problem in the MediaWiki message page? It seems that what is supposed to happen is that the message "1 watching user" should appear with a link to the Special page, where (hopefully) there would be a list of who those watcher are. Any way, thanks for the time. --C4duser 03:42, 26 November 2007 (UTC)
- After doing some searching, it looks like this is a bug in MediaWiki itself. Apparently there are some version that did not have the wfLoadExtensionMessages() function. Anyways, I changed the way the internationalization messages get loaded to not rely on this function. The new code is available in v0.3 (already in SVN). Please let me know if this code works any better for you. --Gri6507 14:43, 25 November 2007 (UTC)
- I found another error message on the system messages page. Perhaps this is the problem? --C4duser 04:06, 26 November 2007 (UTC)
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'WhoIsWatching::loadMessages' was given in ...IP address... /wiki/includes/Hooks.php on line 114
- This has been addressed in v0.9 --Gri6507 13:47, 6 October 2008 (UTC)
Installed the latest version; Still doesn't work.
[edit]I've installed the latest version and the problem noted above persists. --C4duser 01:02, 31 December 2007 (UTC)
- Are you talking about the Warning or the Fatal Error? --Gri6507 03:01, 31 December 2007 (UTC)
- Reinstalled the extension and now it works as described. Thanks. --C4duser 22:02, 24 May 2008 (UTC)
Installation Instructions - Correction?
[edit]I had to insert the following code in order for the extension to work properly:
<a href="//www.mediawiki.org/w/index.php?title=Special:WhoIsWatching&ns=Extension talk&page=WhoIsWatching/Archive">$1 watching users</a>
Does this look correct?
- Where did you insert this code? Are you talking about the Extension:WhoIsWatching#Step_3 installation instruction? --Gri6507 22:14, 8 February 2008 (UTC)
- Yes, this went into MediaWiki:Number_of_watching_users_pageview. I couldn't get the prescribed way to work.
- Sorry for the long delay. You are correct in your syntax. I have updated the instructions. --Gri6507 20:09, 20 May 2008 (UTC)
- Just fought with this for the last hour thinking the instructions were updated. I too had to change 'Special:Who_Is_Watching_a_wiki_page' in step 3 to 'Special:WhoIsWatching'. Seems to work now. Being able to add users to watchlists is REALLY helpful in my application. Love the Extension! --lbillett 18:49, 27 February 2009 (UTC)
Some errors
[edit]I get a non existing page error clicking the linked number of watching users (Special:WhoIsWatching).
But Special:Who_Is_Watching_a_wiki_page appears in the list of special pages (Mistake by you imo).
So when fixing the special page name after clicking the linked watching users I have the list of watching users but some are bad titles and appear as unlinked text:
[[User:Milky|]] [[User:Paulezzz|]] [[User:Pokasissu|]]
Thos who are linked are fucked up as well. user linked is notthe same as user displayed.
Also I will disable "Add users to watch the page" as this seems pretty useless. I'll wait and see what Extension:WhoIsWatchingTabbed is going to look like. --Subfader 11:23, 11 May 2008 (UTC)
- What version of the extension are you using? What version of MediaWiki are you using? What localization is your account set for? I just double checked on my installation and Special:WhoIsWatching is correctly created by the extension. The part of the code which creates the special page is near the top of SpecialWhoIsWatching_body.php and there it clearly states that the special page should be called Special:WhoIsWatching.
- I can confirm the problem with having some users show up are "dead links". This is because those users do not have a configured "real name". Since having a real name is not required, I have changed the extension to default to either a username or a realname (if one is available) depending on the setting of a new configuration variable (see $whoiswatching_nametype in v0.5). --Gri6507 11:38, 12 May 2008 (UTC)
I was using Version 0.4 on MW 1.12.0rc. I don't have any localization thingy installed. I downloaded the new files and I still have it.
I don't wanna confuse you so and since I won't use thsi extension you can ignore my comments till someone else may report the same problem --Subfader 22:13, 12 May 2008 (UTC)
- based on your first screen capture, I can see that unfortunately you were a victim of a typo on the instructions. Those have been updated and the link at the bottom on every page should now work. As for the links to the user pages in the list of users watching a page, I don't see anything wrong in your screen capture. It simply shows that many users watching that page do not have a user page created from themselves. --Gri6507 20:13, 20 May 2008 (UTC)
- Since I'v updated my wiki from MW1.11.0 to MW1.12.0, the special page (and the link at bottom of every page) become invalid.
My Environment
[edit]- MediaWiki: 1.12.0
- Win XP
- The AppServ Open Project - 2.5.7 for Windows
- Apache Web Server Version 2.2.3
- PHP Script Language Version 5.1.6
- MySQL Database Version 5.0.24a
Could you give me a hand?
--Roc michael 00:02, 7 June 2008 (UTC)
- It looks like as part of your MW upgrade, you accidentally overwrote the LocalSettings.php file. If you look on the main page for this extension, you will notice that you have to set in order for the information to appear at the footer of every page. Can you please give that a try and let me know if it works? --Gri6507 13:58, 7 June 2008 (UTC)
$wgPageShowWatchingUsers = true;
- It looks like as part of your MW upgrade, you accidentally overwrote the LocalSettings.php file. If you look on the main page for this extension, you will notice that you have to set
- Hi Gri6507,
- Thanks for your quick respond. During I captured the images at the above, the following code was in my Localsetting.php:
require_once( "$IP/extensions/WhoIsWatching/SpecialWhoIsWatching.php" );
$wgPageShowWatchingUsers = true;
- So I don't know how to do something for this.
- BTW, I upgraded my wiki by following steps:
- I used
ww\mediawiki-1.12.0\config\index.php
to generate a new Localsetting.php. - After I finished upgrading, I moved the Localsetting.php to the folder of
www\mediawiki-1.12.0
- Then, I copy extension-settings form my old Localsetting.php in the folder of
www\mediawiki-1.11.0
. - Finally, I checked all the extensions I used whether them work fine or not.
- So I don't know how to do something for this.
--Roc michael 21:59, 7 June 2008 (UTC)
Description Suggestion
[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 in the bottom of every page. Additionally, this extension allows any user to add any page to any other user's watch list.
Any idea?--Roc michael 22:48, 23 May 2008 (UTC)
- I agree - I made the change on the mail page. --Gri6507 14:55, 25 May 2008 (UTC)
How to turn off "Add Users to Watch the Page"?
[edit]Is there any way to turn of the "add users to watch the page" feature? I would like to be able just to show what users are watching, without giving users to ability to add other users to watch a page.
Thanks.--C4duser 22:05, 24 May 2008 (UTC)
Not official reply
[edit]There are some easy ways you can use:
- Use Extension:WhoIsWatchingTabbed not this extension.
- Use Extension:Blacklist with following code:
$wgWhitelist['sysop']['read'] = $wgBlacklist['*']['read'] = array("^Special:(Export|WhoIsWatching|Listusers|Ipblocklist|Log|Allmessages)$");
- Use Extension:RightFunctions in the page "MediaWiki:Number_of_watching_users_pageview"
- Hope my answers is useful. --Roc michael 23:12, 24 May 2008 (UTC)
(Slightly more) Official response
[edit]Next week, I will modify the extension so that this feature is made optional. Please stay tuned. --Gri6507 14:58, 25 May 2008 (UTC)
- I just released v0.6 of the extension which has the ability to optionally turn on this capability. --Gri6507 17:00, 6 June 2008 (UTC)
Force number of watchers to be shown even when Zero
[edit]It is very useful to be able to add users to the watch list, but if no-one is watching a page, the link at the bottom isn't show. It is tricky to get a link to the WhoIsWatching page to add people to an empty watchlist. This bit of code forces the link to be shown at the bottom (as long as $wgPageShowWatchingUsers
is set to true in LocalSettings.php
.
Add the following to the end of SpecialWhoIsWatching.php
:
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = 'fnShowWatchingCount';
function fnShowWatchingCount(&$template, &$tpl)
{
global $wgLang, $wgPageShowWatchingUsers;
if ($wgPageShowWatchingUsers) {
$dbr = wfGetDB( DB_SLAVE );
$watchlist = $dbr->tableName( 'watchlist' );
$sql = "SELECT COUNT(*) AS n FROM $watchlist
WHERE wl_title='" . $dbr->strencode($template->mTitle->getDBkey()) .
"' AND wl_namespace=" . $template->mTitle->getNamespace() ;
$res = $dbr->query( $sql, 'SkinTemplate::outputPage');
$x = $dbr->fetchObject( $res );
$numberofwatchingusers = $x->n;
$tpl->set('numberofwatchingusers',
wfMsgExt('number_of_watching_users_pageview', array('parseinline'),
$wgLang->formatNum($numberofwatchingusers))
);
}
return true;
}
This is a copy of the code from includes/SkinTemplate.php
with the if ($numberofwatchingusers > 0)
condition removed.
--Djomp 13:06, 4 August 2008 (UTC)
- This is a great idea! I will add it to the main line code when I get a chance. Thanks! --Gri6507 13:31, 4 August 2008 (UTC)
- This is now released in version 0.8. Sorry it took so long to incorporate it. --Gri6507 12:50, 29 September 2008 (UTC)
- This is a great idea! I will add it to the main line code when I get a chance. Thanks! --Gri6507 13:31, 4 August 2008 (UTC)
MediaWiki:Number of watching users pageview
[edit]I had trouble getting this to work until I changed the page to the following: --Mark Weiser 01:55, 14 August 2008 (UTC)
[{{SERVER}}{{SCRIPTPATH}}/index.php/Special:Who_is_watching_a_wiki_page?ns={{NAMESPACE}}&page={{PAGENAMEE}} $1 watching {{PLURAL:$1|user|users}}]
Product Version MediaWiki 1.12.0 PHP 5.2.5 (apache2handler) MySQL 5.0.45-community-nt
Special page not exist and footer not html
[edit]I am having 2 issues...
1. The extension puts the number of users watching at the bottom of page with a link to WhoIsWatching special page to add other users... BUT this is not being parsed as HTML! It comes out on the screen as;
<a href="http://localhost/mediawiki/index.php?title=Special:WhoIsWatching&ns=&page=Main_Page">1</a> watching user
the same as Roc michael's screenshot below
If I check the source of the page the code that is outputing is:
<a href="<a href="http://localhost/bhptest/index.php?title=Special:WhoIsWatching&ns=&page=Main_Page"
class="external free" title="http://localhost/bhptest/index.php
title=Special:WhoIsWatching&ns=&page=Main_Page"
rel="nofollow">
http://localhost/bhptest/index.php?title=Special:WhoIsWatching&ns=&page=Main_Page
</a>">1</a> watching user
2. When you go the the URL "http://localhost/mediawiki/index.php?title=Special:WhoIsWatching&ns=&page=Main_Page" it says that the page cannot be found same as Subfader's screenshot below
My Environment
[edit]- MediaWiki: 1.12.0
- PHP 5
- IIS 6
- MySQL Server 5
Questions
[edit]- Is the WhoIsWatching extension compatible with MediaWiki 1.12??
- Are these issues linked (one fix for both) or separate (2 different issues)?
Thanks, any help appreciated!! --Luke 11:51, 14 August 2008 (WST)
- : The a href syntax worked in 1.9.x, but we saw the same problem when we tried to upgrade to 1.13. I fixed the issue in 1.13 by changing the "MediaWiki:Number of watching users pageview" page from:
<a href="{{fullurl:Special:WhoIsWatching|ns={{NAMESPACE}}&page={{PAGENAMEE}}}}">$1</a> watching {{PLURAL:$1|user|users}}
to[{{fullurl:Special:Who_Is_Watching_a_wiki_page|ns={{NAMESPACE}}&page={{PAGENAMEE}}}} $1] watching {{PLURAL:$1|user|users}}
- Paul, the installation instructions on the extension page should probably be updated, but I'm not sure in which version the new syntax is required. Hope this helps... --Msul01 20:43, 26 August 2008 (UTC)
- Thanks for the info. I have updated the instructions on the extension main page. --Gri6507 11:58, 27 August 2008 (UTC)
Solution
[edit]It worked for me, when I changed
[{{fullurl:Special:Who_Is_Watching_a_wiki_page|ns={{NAMESPACE}}&page={{PAGENAMEE}}}} $1] watching {{PLURAL:$1|user|users}}
to
[{{fullurl:Spezial:Wer_beobachtet|ns={{NAMESPACE}}&page={{PAGENAMEE}}}} $1] watching {{PLURAL:$1|user|users}}
I am running mediawiki 1.13.3. on xampp 1.6.7 as a german language wiki
and I had to change Special into Spezial, and Who_Is_Watching_a_wiki_page into Wer_beobachtet.
Check Your language in and may be this helps. --Mrmuehle 18:30, 22 December 2008 (UTC)
Notify users immediately
[edit]If a user is being added by someone else, it would be polite to have that person notified immediately of this fact. It seems inpolite to have him notified only once a change has been made. And if someone is being added, this person obviously is interested and needs to be even notified before a change happens.
Allow add user only for user who are logged in
[edit]In my opinion a user should not be added by a user who is not logged in. Or this should be configurable. The added user should also get information by whom he was added. Therefore I support the edit before (Notify users immediately)
Odd users - how to remove from display?
[edit]I've got the extension installed and working fine but have two entries for "User:10.1.210.57" on some pages. I can't find any other reference to such a user in the database (I didn't browse Everything!) so please could someone tell me where I can delete the entries?
Suggestion - just for some defined users
[edit]Hi, a suggestion for this useful extension, as you state it can violate privacy policy, what if you add a way to define which specific users can use the extension? Something like:
$whoiswatching_allowed_users = 'CarlosRuiz,JohnDoe';
--CarlosRuiz 12:21, 4 June 2010 (UTC)
Suggestion: I use Extension:Lockdown#.24wgSpecialPageLockdown
How to remove a user easily from the watchlist
[edit]The names in the "watch list" are not the same as the names in the "add list". The $whoiswatching_nametype setting ('UserName' or 'RealName') only seems to change the watch list.
So it is easy to make a mistake when adding "watchers".
What is the best way then to remove someone from the watch list?
- We have a number of wikis in our School where we want to keep track of which pages are unwatched but this is undermined when users leave. I'm not sure what is the best way round this. It seems that users can't be safely deleted using Extension:DeleteUser or edited using Extension:EditUser.
- I guess Extension:Merge and Delete could merge the user with a known user whose login details are known. I also wonder if Extension:Password Reset would give access to the departed user's watchlist. I also wonder if the Watchlist table could just have a SQL DELETE statement run against it.
- Yes, they guy who set up our wikis has left and I've been left with trying to figure this out. --Dmontford 15:08, 10 December 2010 (UTC)
- I changed the code (I'm not a php programmer but it works): I added a second form with a list of the watchers and based on which form I use I either call $u->addWatch($pageTitle); or $u->removeWatch($pageTitle);
Broken in 1.18
[edit]I lost the use of this great extension (corporate environment) after upgrading to 1.18. Any plans to update it so it works again? - Lbillett (talk) 13:26, 23 August 2012 (UTC)
- It has been fixed! Here is the raw file WhoIsWatching_body.php. It works on my 1.18.1 mediawiki. Bill Johnson (talk) 16:33, 7 December 2012 (UTC)
- It worked! Thank you thank you thank you!! - Lbillett (talk) 14:58, 11 December 2012 (UTC)
Feature Request
[edit]I run a small (20,000 articles ~300 users) wiki that is internal to my organization. In many cases, the number of contributors watching a page are in the single digits. I often forget if I'm watching a page and when I see the "1 person is watching" I'm always clicking to discover it's myself that's watching. Yes, I realize that I can also scroll back to the top to see if (in Vector) my watchlist star is blue, but that often doesn't occur to me and involves moving back to the top of the page when I'm curious to who is watching a given page.
My suggestion is to change the label if the page in question is on the current logged in user's watchlist.
For example. If my account is the only one watching a page, instead of saying "1 person is watching" it would say, 'You are watching this page". I could also see this scaling to a larger number of watchers relatively easy. "You and 8 other people are watching this page".
In short, could it be possible that the count of watchers could reflect if the current user is watching the page and change the description to match?
Will no longer work in 1.25+
[edit]With the release of MediaWiki 1.25 $wgPageShowWatchingUsers has been removed from MediaWiki core. Hit counters have also been removed from core. This extension relies on the $wgPageShowWatchingUsers setting to be available and set to 'true'. As such, with the introduction of 1.25 this extension will no longer work as-is. Ckoerner (talk) 14:46, 20 April 2015 (UTC)
- Was it tested with Extension:HitCounters? Nemo 07:02, 13 March 2017 (UTC)
Usage in 1.27
[edit]Downloading and activating the version for 1.27 appears to stop the wiki from working. Installing the version for 1.29 in 1.27 works fine though. (In Debian Stretch.)