r92624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92623‎ | r92624 | r92625 >
Date:11:25, 20 July 2011
Author:ashley
Status:ok
Tags:
Comment:
SocialProfile: follow-up to r92621, r92617: remove DIY avatar code from UserWelcome and apply the formatNum() fix
Modified paths:
  • /trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserWelcome/UserWelcome.php
@@ -5,7 +5,7 @@
66 *
77 * @file
88 * @ingroup Extensions
9 - * @version 1.3
 9+ * @version 1.3.1
1010 * @author David Pean <david.pean@gmail.com>
1111 * @author Jack Phoenix <jack@countervandalism.net>
1212 * @link http://www.mediawiki.org/wiki/Extension:UserWelcome Documentation
@@ -20,7 +20,7 @@
2121 $wgExtensionCredits['parserhook'][] = array(
2222 'path' => __FILE__,
2323 'name' => 'UserWelcome',
24 - 'version' => '1.3',
 24+ 'version' => '1.3.1',
2525 'author' => array( 'David Pean', 'Jack Phoenix' ),
2626 'descriptionmsg' => 'userwelcome-desc',
2727 'url' => 'http://www.mediawiki.org/wiki/Extension:UserWelcome',
@@ -30,7 +30,7 @@
3131 /**
3232 * Register <welcomeUser /> tag with the parser
3333 * @param $parser Object: instance of Parser
34 - * @return true
 34+ * @return Boolean: true
3535 */
3636 function wfWelcomeUser( &$parser ) {
3737 $parser->setHook( 'welcomeUser', 'getWelcomeUser' );
@@ -48,7 +48,7 @@
4949 }
5050
5151 function getWelcome() {
52 - global $wgUser, $wgOut, $wgScriptPath, $wgUploadPath;
 52+ global $wgUser, $wgOut, $wgScriptPath, $wgLang;
5353
5454 // Add CSS
5555 $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/SocialProfile/UserWelcome/UserWelcome.css' );
@@ -69,7 +69,8 @@
7070 $output = '<div class="mp-welcome-logged-in">
7171 <h2>' . wfMsg( 'mp-welcome-logged-in', $wgUser->getName() ) . '</h2>
7272 <div class="mp-welcome-image">
73 - <a href="' . $wgUser->getUserPage()->escapeFullURL() . '" rel="nofollow"><img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0"/></a>';
 73+ <a href="' . $wgUser->getUserPage()->escapeFullURL() . '" rel="nofollow">' .
 74+ $avatar->getAvatarURL() . '</a>';
7475 if ( strpos( $avatar->getAvatarImage(), 'default_' ) !== false ) {
7576 $output .= '<div><a href="' . $avatar_link->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'mp-welcome-upload' ) . '</a></div>';
7677 } else {
@@ -81,7 +82,12 @@
8283 if ( $wgUserLevels ) {
8384 $output .= '<div class="mp-welcome-points">
8485 <div class="points-and-level">
85 - <div class="total-points">' . wfMsgExt( 'mp-welcome-points', 'parsemag', $stats_data['points'] ) . '</div>
 86+ <div class="total-points">' .
 87+ wfMsgExt(
 88+ 'mp-welcome-points',
 89+ 'parsemag',
 90+ $wgLang->formatNum( $stats_data['points'] )
 91+ ) . '</div>
8692 <div class="honorific-level"><a href="' . $level_link->escapeFullURL() . '">(' . $user_level->getLevelName() . ')</a></div>
8793 </div>
8894 <div class="cleared"></div>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92617SocialProfile: run the amount of points through Language::formatNum() to fix ...ashley10:12, 20 July 2011
r92621SocialProfile: since we already have a wAvatar object available, use its getA...ashley10:49, 20 July 2011

Status & tagging log