Extension:AutoWatch
From MediaWiki.org
| WARNING: The code or configuration described here poses a major security risk.
Site administrators: You are advised against using it until this security issue is resolved. Problem: Vulnerable to register_globals attacks. Solution: Always initialize every global variable. (Tagged: November 2012) |
| This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net. |
|
AutoWatch Release status: stable |
|||
|---|---|---|---|
| Implementation | User interface | ||
| Description | Add a custom defined list of user to watch any new or edited page + send an email on any new talk page | ||
| Author(s) | Brice Lenfant | ||
| Last version | 1.0 | ||
| MediaWiki | 1.10 | ||
| License | No license specified | ||
| Download | Download | ||
|
|||
| Check usage and version matrix | |||
Extension:AutoWatch adds a custom list of users to watch any new or edited page plus send an email on any new talk page.
Usage [edit]
Save the code below to AutoWatch.php in MediaWiki's extensions folder.
Add the following line in the LocalSettings.php file:
$wgMultiWatchUserIDs = array(5, 3, 2, 6, 64, 9); #This is the list of your users' IDs to include in this mailing list require_once("extensions/AutoWatch.php");
Code [edit]
This code has been tested on MediaWiki 1.12.
History:
- 21 Nov 2007 -- Version 1.1 -- First release.
<?php ######################################################################### # Installation notes, add array $wgMultiWatchUserIDs to LocalSettings.php with all uses ID's to include # Example # $wgMultiWatchUserIDs = array(5, 3, 2, 6); # then add the line: require_once("extensions/AutoWatch.php"); # ######################################################################## $wgExtensionCredits['other'][] = array( 'name' => 'AutoWatch', 'version' => '1.0', 'author' => 'Brice Lenfant', 'description' => 'Add any new edited/created page to the watch list of defined users', 'url' => 'http://www.mediawiki.org/wiki/Extension:AutoWatch', ); $wgHooks['ArticleSaveComplete'][] = 'fnAddToWatch'; function fnAddToWatch(&$article, &$user, &$text, &$summary, &$minoredit, &$watchthis, &$sectionanchor, &$flags, $revision) { global $wgMultiWatchUserIDs; foreach ($wgMultiWatchUserIDs as $value){ #Add to watch $user = User::newFromId($value); $user->addWatch( $article->mTitle ); #Send email if it's a new talk if ( $article->mTitle->isTalkPage ()){ $eTitle = "Talk Page changed or created in Wiki - ".$article->mTitle->getTalkNsText().':'.$article->mTitle->getDBkey(); $eBody = $article->mTitle->GetFullURL(); $user->sendMail($eTitle, $eBody ); } } return true; }