/**
* Show "Updated (since my last visit)" marker in RC view, watchlist and history
* view for watched pages with new changes */
-$wgShowUpdatedMarker = true; # UPO
+$wgShowUpdatedMarker = true;
$wgCookieExpiration = 2592000;
$title = $this->mTitle->getText();
$uid = $wgUser->getID();
$db =& wfGetDB( DB_SLAVE );
- if ($uid && $wgShowUpdatedMarker && $wgUser->getOption( 'showupdated' ))
+ if ($uid && $wgShowUpdatedMarker )
$notificationtimestamp = $db->selectField( 'watchlist',
'wl_notificationtimestamp',
array( 'wl_namespace' => $namespace, 'wl_title' => $this->mTitle->getDBkey(), 'wl_user' => $uid ),
'hideminor',
$wgRCShowWatchingUsers ? 'shownumberswatching' : false,
'usenewrc',
- 'rcusemodstyle',
- array(
- 'showupdated',
- wfMsg('updatedmarker')
- ) )
+ 'rcusemodstyle' )
) . '</fieldset>'
);
$rc->counter = $counter++;
if ($wgShowUpdatedMarker
- && $wgUser->getOption( 'showupdated' )
&& !empty( $obj->wl_notificationtimestamp )
&& ($obj->rc_timestamp >= $obj->wl_notificationtimestamp)) {
$rc->notificationtimestamp = true;
/**
* constructor
*/
-function wfSpecialWatchlist() {
+function wfSpecialWatchlist( $par ) {
global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgRequest, $wgContLang;;
global $wgUseWatchlistCache, $wgWLCacheTimeout, $wgDBname;
- global $wgEnotif, $wgShowUpdatedMarker, $wgRCShowWatchingUsers;
+ global $wgRCShowWatchingUsers, $wgEnotifWatchlist, $wgShowUpdatedMarker;
$fname = 'wfSpecialWatchlist';
$wgOut->setPagetitle( wfMsg( 'watchlist' ) );
$id = $wgRequest->getArray( 'id' );
$uid = $wgUser->getID();
- if( $wgRequest->getVal( 'reset' ) == 'all' ) {
+ if( $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) {
$wgUser->clearAllNotifications( $uid );
}
}
- if($wgRequest->getBool('edit')) {
+ if($wgRequest->getBool('edit') || $par == 'edit' ) {
$wgOut->addWikiText( wfMsg( 'watchlistcontains', $wgLang->formatNum( $nitems ) ) .
"\n\n" . wfMsg( 'watcheditlist' ) );
$andHideOwn = $hideOwn ? "AND (rev_user <> $uid)" : '';
# Show watchlist header
- if( $wgUser->getOption( 'enotifwatchlistpages' ) ) {
- $wgOut->addHTML( "<div class='enotifinfo'>\n" );
-
- $wgOut->addWikiText( wfMsg( 'enotif_infotext' ) );
+ $header = '';
+ if( $wgUser->getOption( 'enotifwatchlistpages' ) && $wgEnotifWatchlist) {
+ $header .= wfMsg( 'wlheader-enotif' ) . "\n";
+ }
+ if ( $wgShowUpdatedMarker ) {
+ $header .= wfMsg( 'wlheader-showupdated' ) . "\n";
+ }
+ $header .= wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ),
+ $wgLang->formatNum( $npages ), $y,
+ $specialTitle->getFullUrl( 'edit=yes' ) );
+ $wgOut->addWikiText( $header );
+
+ if ( $wgShowUpdatedMarker ) {
$wgOut->addHTML( '<form action="' .
- $specialTitle->escapeLocalUrl( 'action=submit&edit=yes' ) .
+ $specialTitle->escapeLocalUrl() .
'" method="post"><input type="submit" name="dummy" value="' .
htmlspecialchars( wfMsg( 'enotif_reset' ) ) .
'" /><input type="hidden" name="reset" value="all" /></form>' .
- "</div>\n\n" );
+ "\n\n" );
}
-
-
- $wgOut->addHTML( '<i>' . wfMsg( 'watchdetails',
- $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), $y,
- $specialTitle->escapeLocalUrl( 'edit=yes' ) ) . "</i><br />\n" );
$use_index = $dbr->useIndexClause( $x );
$sql = "SELECT
$rc = RecentChange::newFromCurRow( $obj );
$rc->counter = $counter++;
- if ($wgShowUpdatedMarker && $wgUser->getOption( 'showupdated' )) {
+ if ( $wgShowUpdatedMarker ) {
$updated = $obj->wl_notificationtimestamp;
} else {
- $updated = false;
+ // Same visual appearance as MW 1.4
+ $updated = true;
}
if ($wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) {
global $wgEnotifRevealEditorAddress;
global $wgEnotifFromEditor;
global $wgEmailAuthentication;
+ global $wgShowUpdatedMarker;
$fname = 'UserMailer::notifyOnPageChange';
wfProfileIn( $fname );
$enotifusertalkpage = ($isUserTalkPage && $wgEnotifUserTalk);
$enotifwatchlistpage = (!$isUserTalkPage && $wgEnotifWatchlist);
+
if ( ($enotifusertalkpage || $enotifwatchlistpage) && (!$minorEdit || $wgEnotifMinorEdits) ) {
$dbr =& wfGetDB( DB_MASTER );
extract( $dbr->tableNames( 'watchlist' ) );
} # if the watching user has an email address in the preferences
}
-
- # mark the changed watch-listed page with a timestamp, so that the page is
- # listed with an "updated since your last visit" icon in the watch list, ...
- $dbw =& wfGetDB( DB_MASTER );
- $success = $dbw->update( 'watchlist',
- array( /* SET */
- 'wl_notificationtimestamp' => $timestamp
- ), array( /* WHERE */
- 'wl_title' => $title->getDBkey(),
- 'wl_namespace' => $title->getNamespace(),
- ), 'UserMailer::NotifyOnChange'
- );
} # if anyone is watching
} # if $wgEnotifWatchlist = true
+
+ if ( $wgShowUpdatedMarker || $wgEnotifWatchlist ) {
+ # mark the changed watch-listed page with a timestamp, so that the page is
+ # listed with an "updated since your last visit" icon in the watch list, ...
+ $dbw =& wfGetDB( DB_MASTER );
+ $success = $dbw->update( 'watchlist',
+ array( /* SET */
+ 'wl_notificationtimestamp' => $timestamp
+ ), array( /* WHERE */
+ 'wl_title' => $title->getDBkey(),
+ 'wl_namespace' => $title->getNamespace(),
+ ), 'UserMailer::NotifyOnChange'
+ );
+ }
+
} # function NotifyOnChange
/**
'enotifrevealaddr' => 0,
'shownumberswatching' => 1,
'rcusemodstyle' => 1,
- 'showupdated' => 1,
'fancysig' => 0,
'externaleditor' => 0,
'externaldiff' => 0,
'enotifrevealaddr',
'shownumberswatching',
'rcusemodstyle',
- 'showupdated',
'fancysig',
'externaleditor',
'externaldiff',
'tog-enotifrevealaddr' => 'Reveal my email address in notification mails',
'tog-shownumberswatching' => 'Show the number of watching users',
'tog-rcusemodstyle' => 'Show recent changes in UseMod style: only the most recent change of any page is listed.',
-'tog-showupdated' => 'Show update marker ',
'tog-fancysig' => 'Raw signatures (without automatic link)',
'tog-externaleditor' => 'Use external editor by default',
'tog-externaldiff' => 'Use external diff by default',
'unwatchthispage' => 'Stop watching',
'notanarticle' => 'Not a content page',
'watchnochange' => 'None of your watched items were edited in the time period displayed.',
-'watchdetails' => "($1 pages watched not counting talk pages;
-$2 total pages edited since cutoff;
-$3...
-<a href='$4'>show and edit complete list</a>.)",
+'watchdetails' => "* $1 pages watched not counting talk pages, $2 total pages edited in the specified period
+* Query method: $3
+* [[Special:Watchlist/edit|Show and edit complete watchlist]]
+",
+'wlheader-enotif' => "* Email notification is enabled.",
+'wlheader-showupdated' => "* Pages which have been changed since you last visited them are shown in '''bold'''",
'watchmethod-recent'=> 'checking recent edits for watched pages',
'watchmethod-list' => 'checking watched pages for recent edits',
'removechecked' => 'Remove checked items from watchlist',
'wlhide' => 'Hide',
'enotif_mailer' => '{{SITENAME}} Notification Mailer',
-'enotif_infotext' => "* Email notification is enabled
-* Pages which have been changed since you last visited them are shown in '''bold'''",
'enotif_reset' => 'Mark all pages visited',
'enotif_newpagetext'=> 'This is a new page.',
'changed' => 'changed',