r92622 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92621‎ | r92622 | r92623 >
Date:11:07, 20 July 2011
Author:ashley
Status:ok
Tags:
Comment:
SocialProfile: follow-up to r92621: do the same for UserStats
Modified paths:
  • /trunk/extensions/SocialProfile/UserStats/TopFansByStat.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserStats/TopFansRecent.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserStats/TopUsers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserStats/TopFansRecent.php
@@ -15,7 +15,7 @@
1616 * @param $par Mixed: parameter passed to the page or null
1717 */
1818 public function execute( $par ) {
19 - global $wgRequest, $wgUser, $wgOut, $wgMemc, $wgUploadPath, $wgScriptPath;
 19+ global $wgRequest, $wgUser, $wgOut, $wgMemc, $wgScriptPath;
2020
2121 // Load CSS
2222 $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/SocialProfile/UserStats/TopList.css' );
@@ -120,13 +120,13 @@
121121 foreach ( $user_list as $user ) {
122122 $user_title = Title::makeTitle( NS_USER, $user['user_name'] );
123123 $avatar = new wAvatar( $user['user_id'], 'm' );
124 - $avatarImage = $avatar->getAvatarImage();
 124+ $avatarImage = $avatar->getAvatarURL();
125125
126126 $out .= '<div class="top-fan-row">
127127 <span class="top-fan-num">' . $x . '.</span>
128 - <span class="top-fan">
129 - <img src="' . $wgUploadPath . '/avatars/' . $avatarImage . '" alt="" border="" />
130 - <a href="' . $user_title->escapeFullURL() . '" >' . $user['user_name'] . '</a>
 128+ <span class="top-fan">' .
 129+ $avatarImage .
 130+ '<a href="' . $user_title->escapeFullURL() . '" >' . $user['user_name'] . '</a>
131131 </span>';
132132
133133 $out .= '<span class="top-fan-points"><b>' .
Index: trunk/extensions/SocialProfile/UserStats/TopFansByStat.php
@@ -15,7 +15,7 @@
1616 * @param $par Mixed: parameter passed to the page or null
1717 */
1818 public function execute( $par ) {
19 - global $wgRequest, $wgLang, $wgOut, $wgMemc, $wgUploadPath, $wgScriptPath;
 19+ global $wgRequest, $wgLang, $wgOut, $wgMemc, $wgScriptPath;
2020 global $wgUserStatsTrackWeekly, $wgUserStatsTrackMonthly;
2121
2222 // Load CSS
@@ -121,7 +121,7 @@
122122 $user_name = $wgLang->truncate( $user['user_name'], 22 );
123123 $user_title = Title::makeTitle( NS_USER, $user['user_name'] );
124124 $avatar = new wAvatar( $user['user_id'], 'm' );
125 - $commentIcon = $avatar->getAvatarImage();
 125+ $commentIcon = $avatar->getAvatarURL();
126126
127127 // Stats row
128128 // TODO: opinion_average isn't currently working, so it's not enabled in menus
@@ -140,9 +140,9 @@
141141
142142 $out .= '<div class="top-fan-row">
143143 <span class="top-fan-num">' . $x . '.</span>
144 - <span class="top-fan">
145 - <img src="' . $wgUploadPath . '/avatars/' . $commentIcon . '" alt="" border="" />
146 - <a href="' . $user_title->escapeFullURL() . '">' . $user_name . '</a>
 144+ <span class="top-fan">' .
 145+ $commentIcon .
 146+ '<a href="' . $user_title->escapeFullURL() . '">' . $user_name . '</a>
147147 </span>
148148 <span class="top-fan-points"><b>' . $statistics_row . '</b> ' . $lowercase_statistics_name . '</span>
149149 <div class="cleared"></div>
Index: trunk/extensions/SocialProfile/UserStats/TopUsers.php
@@ -15,7 +15,7 @@
1616 * @param $par Mixed: parameter passed to the page or null
1717 */
1818 public function execute( $par ) {
19 - global $wgOut, $wgScriptPath, $wgMemc, $wgUserStatsTrackWeekly, $wgUserStatsTrackMonthly, $wgUserLevels, $wgUploadPath;
 19+ global $wgOut, $wgScriptPath, $wgMemc, $wgUserStatsTrackWeekly, $wgUserStatsTrackMonthly, $wgUserLevels;
2020
2121 // Load CSS
2222 $wgOut->addExtensionStyle( $wgScriptPath . '/extensions/SocialProfile/UserStats/TopList.css' );
@@ -112,7 +112,7 @@
113113 foreach ( $user_list as $user ) {
114114 $user_title = Title::makeTitle( NS_USER, $user['user_name'] );
115115 $avatar = new wAvatar( $user['user_id'], 'm' );
116 - $commentIcon = $avatar->getAvatarImage();
 116+ $commentIcon = $avatar->getAvatarURL();
117117
118118 // Break list into sections based on User Level if it's defined for this site
119119 if ( is_array( $wgUserLevels ) ) {
@@ -128,7 +128,8 @@
129129 $out .= "<div class=\"top-fan-row\">
130130 <span class=\"top-fan-num\">{$x}.</span>
131131 <span class=\"top-fan\">
132 - <img src='{$wgUploadPath}/avatars/" . $commentIcon . "' alt='' border='' /> <a href='" . $user_title->escapeFullURL() . "'>" . $user['user_name'] . '</a>
 132+ {$commentIcon} <a href='" . $user_title->escapeFullURL() . "'>" .
 133+ $user['user_name'] . '</a>
133134 </span>';
134135
135136 $out .= '<span class="top-fan-points"><b>' . number_format( $user['points'] ) . '</b> ' . wfMsg( 'top-fans-points' ) . '</span>';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92621SocialProfile: since we already have a wAvatar object available, use its getA...ashley10:49, 20 July 2011

Status & tagging log