Pull back r54590, r54591, r54628, r54633, r54636, r54714 "Add after the link for...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 10 Aug 2009 19:03:33 +0000 (19:03 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 10 Aug 2009 19:03:33 +0000 (19:03 +0000)
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
includes/Skin.php
includes/SkinTemplate.php
includes/User.php
languages/messages/MessagesEn.php

index beefaf1..4f04224 100644 (file)
@@ -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
 
index 09460c9..7ea2608 100644 (file)
@@ -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' )
index 0e0f058..0a4fb4e 100644 (file)
@@ -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 )
index c2eead2..a1ef09c 100644 (file)
@@ -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
index a0f3d51..afbb1fa 100644 (file)
@@ -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'           => '&#32;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'             => ',&#32;', # do not translate or duplicate this message to other languages
 'editsection'                  => 'edit',