Difference between revisions of "Extension talk:CategoryWatch"
m (→User friendly message) |
(→User friendly message: embed MediaWiki:Enotif_body) |
||
Line 21: | Line 21: | ||
The normal watched article notification content is as follows: | The normal watched article notification content is as follows: | ||
− | {{code| | + | {{code|{{#tag:pre|{{MediaWiki:Enotif_body}}}}}} |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 11:21, 20 April 2009
A feature that's missing from the MediaWiki Watchlist functionality is that if you watch a category page, you will only be notified when the content of the category page text changes. You won't be notified when pages are added to or removed from that category though which is probably the main information you were wanting.
It would be nice if, in addition to the normal behaviour, a message could be sent to the user listing the added and/or removed member articles.
This functionality would need to be added to the ArticleSaveComplete hook. The category links should be recorded at the start of the request if action is "submit", and then checked against that original state after the article is saved, if its changed, the notification message is sent (preferably using the same code as the normal Watchlist functionality).
Development notes
The notifyOnPageChange method in the EmailNotification class (in UserMailer.php), handles the mailing out of the notifications to all watching users, it takes $editor, $title, $timestamp, $summary and $minor parameters. The composeCommonMailtext method sets the EmailNotification object's from, replyto, subject and body properties using the enotif_body and enotif_subject messages.
So the simplest implementation would be to hook in to ArticleSaveComplete where it creates a list of affected categories with a message for each, then changes the enotif_body and enotif_subject messages, calls notifyOnPageChange, then restores the messages again. To assess the affected categories, it needs to know the content of the previous revision, or perhaps it can record the category links before and after being updated.
Error in mediaWiki-1.13.2
Fatal error: Cannot redeclare wfsetupcategorywatch() (previously declared in /var/www/extensions/CategoryWatch /CategoryWatch.php:163) in /var/www/extensions/CategoryWatch/CategoryWatch.php on line 179(http://setup.organicdesign.co.nz/wiki/index.php)
- Resolved, this extension was declared twice as it is in general extensions --Sven 21:49, 22 October 2008 (NZDT)
This could be due to an old versionbeing run on OD which currently contains a bug --Sven 21:39, 22 October 2008 (NZDT)
User friendly message
Make a better message with more information in it using a lot of the same code as EmailNotification::composeCommonMailtext() in includes/UserMailer.php.
The normal watched article notification content is as follows: