Pull back r54590, r54591, r54628, r54633, r54636, r54714 "Add after the link for "My Talk" "<number of new messages(edits)>" 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.
This commit is contained in:
Brion Vibber 2009-08-10 19:03:33 +00:00
parent cc4a4c8594
commit de495fa427
5 changed files with 10 additions and 46 deletions

View 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

View 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' )

View 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 )

View 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

View 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',