From 5703792bbba0d320c8540e701aaaea136ffe85a0 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 29 May 2005 04:29:29 +0000 Subject: [PATCH] Removed "show updated marker" user preference option. It's now visually inoffensive, and has no performance penalty for reads, so there's no reason users would want to have it off. System administrators may want to have it off though, since it impacts on page save performance. Also changed the watchlist header format. --- includes/DefaultSettings.php | 2 +- includes/PageHistory.php | 2 +- includes/SpecialPreferences.php | 6 +---- includes/SpecialRecentchanges.php | 1 - includes/SpecialWatchlist.php | 39 +++++++++++++++++-------------- includes/UserMailer.php | 29 +++++++++++++---------- languages/Language.php | 15 +++++------- 7 files changed, 48 insertions(+), 46 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d8a6843ace..4cb9f4554c 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -774,7 +774,7 @@ $wgPageShowWatchingUsers = false; /** * 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; diff --git a/includes/PageHistory.php b/includes/PageHistory.php index 43db2a975c..830d14f399 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -62,7 +62,7 @@ class PageHistory { $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 ), diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 79ced8e4c7..cdd43aee3b 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -695,11 +695,7 @@ class PreferencesForm { 'hideminor', $wgRCShowWatchingUsers ? 'shownumberswatching' : false, 'usenewrc', - 'rcusemodstyle', - array( - 'showupdated', - wfMsg('updatedmarker') - ) ) + 'rcusemodstyle' ) ) . '' ); diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 911bb9f446..4024a005cd 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -208,7 +208,6 @@ function wfSpecialRecentchanges( $par, $specialPage ) { $rc->counter = $counter++; if ($wgShowUpdatedMarker - && $wgUser->getOption( 'showupdated' ) && !empty( $obj->wl_notificationtimestamp ) && ($obj->rc_timestamp >= $obj->wl_notificationtimestamp)) { $rc->notificationtimestamp = true; diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index c849ce1fcc..f6833de5a5 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -14,10 +14,10 @@ require_once( 'WatchedItem.php' ); /** * 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' ) ); @@ -40,7 +40,7 @@ function wfSpecialWatchlist() { $id = $wgRequest->getArray( 'id' ); $uid = $wgUser->getID(); - if( $wgRequest->getVal( 'reset' ) == 'all' ) { + if( $wgRequest->getVal( 'reset' ) && $wgRequest->wasPosted() ) { $wgUser->clearAllNotifications( $uid ); } @@ -118,7 +118,7 @@ function wfSpecialWatchlist() { } - if($wgRequest->getBool('edit')) { + if($wgRequest->getBool('edit') || $par == 'edit' ) { $wgOut->addWikiText( wfMsg( 'watchlistcontains', $wgLang->formatNum( $nitems ) ) . "\n\n" . wfMsg( 'watcheditlist' ) ); @@ -179,23 +179,27 @@ function wfSpecialWatchlist() { $andHideOwn = $hideOwn ? "AND (rev_user <> $uid)" : ''; # Show watchlist header - if( $wgUser->getOption( 'enotifwatchlistpages' ) ) { - $wgOut->addHTML( "
\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( '
' . - "
\n\n" ); + "\n\n" ); } - - - $wgOut->addHTML( '' . wfMsg( 'watchdetails', - $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), $y, - $specialTitle->escapeLocalUrl( 'edit=yes' ) ) . "
\n" ); $use_index = $dbr->useIndexClause( $x ); $sql = "SELECT @@ -246,10 +250,11 @@ function wfSpecialWatchlist() { $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' )) { diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 23a2e0f04c..7c1225c469 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -161,6 +161,7 @@ class EmailNotification { global $wgEnotifRevealEditorAddress; global $wgEnotifFromEditor; global $wgEmailAuthentication; + global $wgShowUpdatedMarker; $fname = 'UserMailer::notifyOnPageChange'; wfProfileIn( $fname ); @@ -173,6 +174,7 @@ class EmailNotification { $enotifusertalkpage = ($isUserTalkPage && $wgEnotifUserTalk); $enotifwatchlistpage = (!$isUserTalkPage && $wgEnotifWatchlist); + if ( ($enotifusertalkpage || $enotifwatchlistpage) && (!$minorEdit || $wgEnotifMinorEdits) ) { $dbr =& wfGetDB( DB_MASTER ); extract( $dbr->tableNames( 'watchlist' ) ); @@ -212,20 +214,23 @@ class EmailNotification { } # 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 /** diff --git a/languages/Language.php b/languages/Language.php index e79a34b0f1..b4f3f29910 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -84,7 +84,6 @@ if(isset($wgExtraNamespaces)) { 'enotifrevealaddr' => 0, 'shownumberswatching' => 1, 'rcusemodstyle' => 1, - 'showupdated' => 1, 'fancysig' => 0, 'externaleditor' => 0, 'externaldiff' => 0, @@ -149,7 +148,6 @@ if(isset($wgExtraNamespaces)) { 'enotifrevealaddr', 'shownumberswatching', 'rcusemodstyle', - 'showupdated', 'fancysig', 'externaleditor', 'externaldiff', @@ -296,7 +294,6 @@ Only put [a-z-] in the level one headings since it will be used as an XHMTL id. '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', @@ -1230,10 +1227,12 @@ make it easier to pick out. '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... -show and edit complete list.)", +'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', @@ -1252,8 +1251,6 @@ at the bottom of the screen (deleting a content page also deletes the accompanyi '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', -- 2.20.1