From de495fa427519f8e6d71704177a1f38fd4474c2e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 10 Aug 2009 19:03:33 +0000 Subject: [PATCH] Pull back r54590, r54591, r54628, r54633, r54636, r54714 "Add after the link for "My Talk" "" if there are some" The number of edits doesn't correspond terribly well with "number of messages". Recommend leaving this for future when we actually have sensible message semantics. --- RELEASE-NOTES | 2 -- includes/Skin.php | 6 ++---- includes/SkinTemplate.php | 28 ++++------------------------ includes/User.php | 16 ++-------------- languages/messages/MessagesEn.php | 4 ++-- 5 files changed, 10 insertions(+), 46 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index beefaf1ae2..4f04224b12 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -405,8 +405,6 @@ this. Was used when mwEmbed was going to be an extension. * (bug 17864/19519) Added proper input normalization in Special:UserRights * (bug 20086) Add Hook to add extra statistics at the end of Special:Statistics * (bug 19289) importDump.php can now handle bzip2 and 7zip -* (bug 20103) Add after the link for "My Talk" a info with the number of the - new messages for the user * (bug 20131) Fixed a PHP notice for users having the "rollback" right on Special:RecentChangesLinked diff --git a/includes/Skin.php b/includes/Skin.php index 09460c9aea..7ea26084a6 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1041,11 +1041,9 @@ END; # do not show "You have new messages" text when we are viewing our # own talk page if( !$this->mTitle->equals( $wgUser->getTalkPage() ) ) { - $nu = $wgUser->getnewMessagesCount(); - $tl = $this->link( $wgUser->getTalkPage(), - wfMsgExt( 'newmessageslink', array( 'parsemag', 'escape' ) ), + wfMsgHtml( 'newmessageslink' ), array(), array( 'redirect' => 'no' ), array( 'known', 'noclasses' ) @@ -1053,7 +1051,7 @@ END; $dl = $this->link( $wgUser->getTalkPage(), - wfMsgExt( 'newmessagesdifflink', array( 'parsemag', 'escape' ), $nu ), + wfMsgHtml( 'newmessagesdifflink' ), array(), array( 'diff' => 'cur' ), array( 'known', 'noclasses' ) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 0e0f058914..0a4fb4e675 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -302,13 +302,11 @@ class SkinTemplate extends Skin { if( count( $newtalks ) == 1 && $newtalks[0]['wiki'] === wfWikiID() ) { $usertitle = $this->mUser->getUserPage(); $usertalktitle = $usertitle->getTalkPage(); - - $newmessagescount = $wgUser->getnewMessagesCount(); if( !$usertalktitle->equals( $this->mTitle ) ) { $newmessageslink = $this->link( $usertalktitle, - wfMsgExt( 'newmessageslink', array( 'parsemag', 'escape' ) ), + wfMsgHtml( 'newmessageslink' ), array(), array( 'redirect' => 'no' ), array( 'known', 'noclasses' ) @@ -316,7 +314,7 @@ class SkinTemplate extends Skin { $newmessagesdifflink = $this->link( $usertalktitle, - wfMsgExt( 'newmessagesdifflink', array( 'parsemag', 'escape' ), $newmessagescount ), + wfMsgHtml( 'newmessagesdifflink' ), array(), array( 'diff' => 'cur' ), array( 'known', 'noclasses' ) @@ -512,7 +510,7 @@ class SkinTemplate extends Skin { * @private */ function buildPersonalUrls() { - global $wgOut, $wgRequest, $wgUser, $wgLang; + global $wgOut, $wgRequest; $title = $wgOut->getTitle(); $pageurl = $title->getLocalURL(); @@ -533,26 +531,8 @@ class SkinTemplate extends Skin { 'active' => ( $this->userpageUrlDetails['href'] == $pageurl ) ); $usertalkUrlDetails = $this->makeTalkUrlDetails( $this->userpage ); - if ( $wgUser->getNewtalk() ) { - # do not show text when we are viewing our - # own talk page - if( !$title->equals( $wgUser->getTalkPage() ) ) { - $newmessagescount = $wgUser->getnewMessagesCount(); - $newtalk = wfMsg( 'word-separator' ) . wfMsg( 'parentheses', $newmessagescount ); - - # disable caching - $wgOut->setSquidMaxage( 0 ); - $wgOut->enableClientCache( false ); - } - else { - $newtalk = ''; - } - } - else { - $newtalk = ''; - } $personal_urls['mytalk'] = array( - 'text' => wfMsg( 'mytalk', $newtalk ), + 'text' => wfMsg( 'mytalk' ), 'href' => &$usertalkUrlDetails['href'], 'class' => $usertalkUrlDetails['exists'] ? false : 'new', 'active' => ( $usertalkUrlDetails['href'] == $pageurl ) diff --git a/includes/User.php b/includes/User.php index c2eead29c9..a1ef09ccbf 100644 --- a/includes/User.php +++ b/includes/User.php @@ -216,8 +216,6 @@ class User { //@} static $idCacheByName = array(); - - public $mNewtalknumber; /** * Lightweight constructor for an anonymous user. @@ -1548,10 +1546,9 @@ class User { } else { $db = wfGetDB( DB_SLAVE ); } - $query = $db->select( 'user_newtalk', $field, + $ok = $db->selectField( 'user_newtalk', $field, array( $field => $id ), __METHOD__ ); - $this->mNewtalknumber = $ok = $db->numRows( $query ); - return $ok !== 0; + return $ok !== false; } /** @@ -1634,15 +1631,6 @@ class User { $this->invalidateCache(); } } - - /** - * Return the number of new messages - * @return \int The number of new messages - */ - public function getnewMessagesCount() { - global $wgLang; - return $wgLang->formatNum( $this->mNewtalknumber ); - } /** * Generate a current or new-future timestamp to be stored in the diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index a0f3d514fa..afbb1fa5ac 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -751,7 +751,7 @@ XHTML id names. 'cancel' => 'Cancel', 'moredotdotdot' => 'More...', 'mypage' => 'My page', -'mytalk' => 'My talk$1', +'mytalk' => 'My talk', 'anontalk' => 'Talk for this IP', 'navigation' => 'Navigation', 'and' => ' and', @@ -896,7 +896,7 @@ See [[Special:Version|version page]].', 'retrievedfrom' => 'Retrieved from "$1"', 'youhavenewmessages' => 'You have $1 ($2).', 'newmessageslink' => 'new messages', -'newmessagesdifflink' => '{{PLURAL:$1|one change|$1 changes}}', +'newmessagesdifflink' => 'last change', 'youhavenewmessagesmulti' => 'You have new messages on $1', 'newtalkseparator' => ', ', # do not translate or duplicate this message to other languages 'editsection' => 'edit', -- 2.20.1