Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php |
— | — | @@ -18,10 +18,10 @@ |
19 | 19 | */ |
20 | 20 | function __construct( &$title ){ |
21 | 21 | global $wgUser; |
22 | | - parent::__construct($title); |
| 22 | + parent::__construct( $title ); |
23 | 23 | $this->user_name = $title->getText(); |
24 | | - $this->user_id = User::idFromName($this->user_name); |
25 | | - $this->user = User::newFromId($this->user_id); |
| 24 | + $this->user_id = User::idFromName( $this->user_name ); |
| 25 | + $this->user = User::newFromId( $this->user_id ); |
26 | 26 | $this->user->loadFromDatabase(); |
27 | 27 | |
28 | 28 | $this->is_owner = ( $this->user_name == $wgUser->getName() ); |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | } |
37 | 37 | |
38 | 38 | function view(){ |
39 | | - global $wgOut, $wgUser, $wgRequest, $wgTitle, $wgContLang, $wgSitename; |
| 39 | + global $wgOut, $wgUser, $wgTitle; |
40 | 40 | |
41 | 41 | $sk = $wgUser->getSkin(); |
42 | 42 | |
— | — | @@ -47,9 +47,9 @@ |
48 | 48 | return ''; |
49 | 49 | } |
50 | 50 | |
51 | | - $wgOut->addHTML('<div id="profile-top">'); |
52 | | - $wgOut->addHTML( $this->getProfileTop($this->user_id, $this->user_name) ); |
53 | | - $wgOut->addHTML('<div class="cleared"></div></div>'); |
| 51 | + $wgOut->addHTML( '<div id="profile-top">' ); |
| 52 | + $wgOut->addHTML( $this->getProfileTop( $this->user_id, $this->user_name ) ); |
| 53 | + $wgOut->addHTML( '<div class="cleared"></div></div>' ); |
54 | 54 | |
55 | 55 | // User does not want social profile for User:user_name, so we just show header + page content |
56 | 56 | if( $wgTitle->getNamespace() == NS_USER && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ){ |
— | — | @@ -58,44 +58,44 @@ |
59 | 59 | } |
60 | 60 | |
61 | 61 | // Left side |
62 | | - $wgOut->addHTML('<div id="user-page-left" class="clearfix">'); |
| 62 | + $wgOut->addHTML( '<div id="user-page-left" class="clearfix">' ); |
63 | 63 | |
64 | | - if ( !wfRunHooks( 'UserProfileBeginLeft', array( &$this ) ) ) { |
| 64 | + if ( !wfRunHooks( 'UserProfileBeginLeft', array( &$this ) ) ) { |
65 | 65 | wfDebug( __METHOD__ . ": UserProfileBeginLeft messed up profile!\n" ); |
66 | 66 | } |
67 | 67 | |
68 | | - $wgOut->addHTML( $this->getRelationships($this->user_name, 1) ); |
69 | | - $wgOut->addHTML( $this->getRelationships($this->user_name, 2) ); |
70 | | - $wgOut->addHTML( $this->getGifts($this->user_name) ); |
71 | | - $wgOut->addHTML( $this->getAwards($this->user_name) ); |
72 | | - $wgOut->addHTML( $this->getCustomInfo($this->user_name) ); |
73 | | - $wgOut->addHTML( $this->getInterests($this->user_name) ); |
74 | | - $wgOut->addHTML( $this->getFanBoxes($this->user_name) ); |
75 | | - $wgOut->addHTML( $this->getUserStats($this->user_id, $this->user_name) ); |
| 68 | + $wgOut->addHTML( $this->getRelationships( $this->user_name, 1 ) ); |
| 69 | + $wgOut->addHTML( $this->getRelationships( $this->user_name, 2 ) ); |
| 70 | + $wgOut->addHTML( $this->getGifts( $this->user_name ) ); |
| 71 | + $wgOut->addHTML( $this->getAwards( $this->user_name ) ); |
| 72 | + $wgOut->addHTML( $this->getCustomInfo( $this->user_name ) ); |
| 73 | + $wgOut->addHTML( $this->getInterests( $this->user_name ) ); |
| 74 | + $wgOut->addHTML( $this->getFanBoxes( $this->user_name ) ); |
| 75 | + $wgOut->addHTML( $this->getUserStats( $this->user_id, $this->user_name ) ); |
76 | 76 | |
77 | 77 | if ( !wfRunHooks( 'UserProfileEndLeft', array( &$this ) ) ) { |
78 | 78 | wfDebug( __METHOD__ . ": UserProfileEndLeft messed up profile!\n" ); |
79 | 79 | } |
80 | 80 | |
81 | | - $wgOut->addHTML('</div>'); |
| 81 | + $wgOut->addHTML( '</div>' ); |
82 | 82 | |
83 | 83 | wfDebug("profile start right\n"); |
84 | 84 | |
85 | 85 | // Right side |
86 | | - $wgOut->addHTML('<div id="user-page-right" class="clearfix">'); |
| 86 | + $wgOut->addHTML( '<div id="user-page-right" class="clearfix">' ); |
87 | 87 | |
88 | | - if ( !wfRunHooks( 'UserProfileBeginRight', array( &$this ) ) ) { |
| 88 | + if ( !wfRunHooks( 'UserProfileBeginRight', array( &$this ) ) ) { |
89 | 89 | wfDebug( __METHOD__ . ": UserProfileBeginRight messed up profile!\n" ); |
90 | 90 | } |
91 | 91 | |
92 | | - $wgOut->addHTML( $this->getPersonalInfo($this->user_id, $this->user_name) ); |
93 | | - $wgOut->addHTML( $this->getUserBoard($this->user_id, $this->user_name) ); |
| 92 | + $wgOut->addHTML( $this->getPersonalInfo( $this->user_id, $this->user_name ) ); |
| 93 | + $wgOut->addHTML( $this->getUserBoard( $this->user_id, $this->user_name ) ); |
94 | 94 | |
95 | | - if ( !wfRunHooks( 'UserProfileEndRight', array( &$this ) ) ) { |
| 95 | + if ( !wfRunHooks( 'UserProfileEndRight', array( &$this ) ) ) { |
96 | 96 | wfDebug( __METHOD__ . ": UserProfileEndRight messed up profile!\n" ); |
97 | 97 | } |
98 | 98 | |
99 | | - $wgOut->addHTML('</div><div class="cleared"></div>'); |
| 99 | + $wgOut->addHTML( '</div><div class="cleared"></div>' ); |
100 | 100 | } |
101 | 101 | |
102 | 102 | function getUserStatsRow( $label, $value ) { |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | } |
114 | 114 | |
115 | 115 | function getUserStats( $user_id, $user_name ) { |
116 | | - global $wgUser, $wgUserProfileDisplay; |
| 116 | + global $wgUserProfileDisplay; |
117 | 117 | |
118 | 118 | // Load messages, we're gonna need 'em |
119 | 119 | wfLoadExtensionMessages( 'SocialProfileUserProfile' ); |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | |
125 | 125 | $output = ''; // Prevent E_NOTICE |
126 | 126 | |
127 | | - $stats = new UserStats($user_id, $user_name); |
| 127 | + $stats = new UserStats( $user_id, $user_name ); |
128 | 128 | $stats_data = $stats->getUserStats(); |
129 | 129 | |
130 | 130 | $total_value = $stats_data['edits'] . $stats_data['votes'] . $stats_data['comments'] . $stats_data['recruits'] . $stats_data['poll_votes'] . $stats_data['picture_game_votes'] . $stats_data['quiz_points']; |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | if( $total_value != 0 ) { |
133 | 133 | $output .= '<div class="user-section-heading"> |
134 | 134 | <div class="user-section-title"> |
135 | | - '.wfMsg('user-stats-title').' |
| 135 | + ' . wfMsg( 'user-stats-title' ) . ' |
136 | 136 | </div> |
137 | 137 | <div class="user-section-actions"> |
138 | 138 | <div class="action-right"> |
— | — | @@ -143,15 +143,15 @@ |
144 | 144 | </div> |
145 | 145 | <div class="cleared"></div> |
146 | 146 | <div class="profile-info-container bold-fix">'. |
147 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-edits', array( 'parsemag' ), $stats_data['edits'] ), $stats_data['edits'] ) . |
148 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-votes', array( 'parsemag' ), $stats_data['votes'] ), $stats_data['votes'] ) . |
149 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-comments', array( 'parsemag' ), $stats_data['comments'] ), $stats_data['comments'] ) . |
150 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-recruits', array( 'parsemag' ), $stats_data['recruits'] ), $stats_data['recruits'] ) . |
151 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-poll-votes', array( 'parsemag' ), $stats_data['poll_votes'] ), $stats_data['poll_votes'] ) . |
152 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-picture-game-votes', array( 'parsemag' ), $stats_data['picture_game_votes']), $stats_data['picture_game_votes'] ) . |
153 | | - $this->getUserStatsRow( wfMsgExt( 'user-stats-quiz-points', array( 'parsemag' ), $stats_data['quiz_points'] ), $stats_data['quiz_points'] ); |
| 147 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-edits', 'parsemag', $stats_data['edits'] ), $stats_data['edits'] ) . |
| 148 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-votes', 'parsemag', $stats_data['votes'] ), $stats_data['votes'] ) . |
| 149 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-comments', 'parsemag', $stats_data['comments'] ), $stats_data['comments'] ) . |
| 150 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-recruits', 'parsemag', $stats_data['recruits'] ), $stats_data['recruits'] ) . |
| 151 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-poll-votes', 'parsemag', $stats_data['poll_votes'] ), $stats_data['poll_votes'] ) . |
| 152 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-picture-game-votes', 'parsemag', $stats_data['picture_game_votes']), $stats_data['picture_game_votes'] ) . |
| 153 | + $this->getUserStatsRow( wfMsgExt( 'user-stats-quiz-points', 'parsemag', $stats_data['quiz_points'] ), $stats_data['quiz_points'] ); |
154 | 154 | if( $stats_data['currency'] != '10,000' ) |
155 | | - $output .= $this->getUserStatsRow( wfMsgExt( 'user-stats-pick-points', array( 'parsemag' ), $stats_data['currency'] ), $stats_data['currency'] ); |
| 155 | + $output .= $this->getUserStatsRow( wfMsgExt( 'user-stats-pick-points', 'parsemag', $stats_data['currency'] ), $stats_data['currency'] ); |
156 | 156 | $output .= '</div>'; |
157 | 157 | } |
158 | 158 | |
— | — | @@ -183,7 +183,7 @@ |
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | | - $value = $wgOut->parse( trim($value), false ); |
| 187 | + $value = $wgOut->parse( trim( $value ), false ); |
188 | 188 | |
189 | 189 | $output = "<div><b>{$label}</b>{$value}</div>"; |
190 | 190 | } |
— | — | @@ -191,7 +191,7 @@ |
192 | 192 | } |
193 | 193 | |
194 | 194 | function getPersonalInfo( $user_id, $user_name ) { |
195 | | - global $wgUser, $wgMemc, $wgUserProfileDisplay; |
| 195 | + global $wgUser, $wgUserProfileDisplay; |
196 | 196 | |
197 | 197 | // Load messages, we're gonna need 'em |
198 | 198 | wfLoadExtensionMessages( 'SocialProfileUserProfile' ); |
— | — | @@ -200,31 +200,31 @@ |
201 | 201 | return ''; |
202 | 202 | } |
203 | 203 | |
204 | | - $stats = new UserStats($user_id, $user_name); |
| 204 | + $stats = new UserStats( $user_id, $user_name ); |
205 | 205 | $stats_data = $stats->getUserStats(); |
206 | | - $user_level = new UserLevel($stats_data['points']); |
207 | | - $level_link = Title::makeTitle( NS_HELP, wfMsgHtml('user-profile-userlevels-link') ); |
| 206 | + $user_level = new UserLevel( $stats_data['points'] ); |
| 207 | + $level_link = Title::makeTitle( NS_HELP, wfMsgHtml( 'user-profile-userlevels-link' ) ); |
208 | 208 | |
209 | 209 | if( !$this->profile_data ){ |
210 | | - $profile = new UserProfile($user_name); |
| 210 | + $profile = new UserProfile( $user_name ); |
211 | 211 | $this->profile_data = $profile->getProfile(); |
212 | 212 | } |
213 | 213 | $profile_data = $this->profile_data; |
214 | 214 | |
215 | | - $location = $profile_data['location_city'] . ", " . $profile_data['location_state']; |
| 215 | + $location = $profile_data['location_city'] . ', ' . $profile_data['location_state']; |
216 | 216 | if( $profile_data['location_country'] != 'United States' ){ |
217 | 217 | $location = ''; |
218 | 218 | $location .= $profile_data['location_country']; |
219 | 219 | } |
220 | 220 | |
221 | | - if( $location == ", " ) $location = ''; |
| 221 | + if( $location == ', ' ) $location = ''; |
222 | 222 | |
223 | | - $hometown = $profile_data['hometown_city'] . ", " . $profile_data['hometown_state']; |
| 223 | + $hometown = $profile_data['hometown_city'] . ', ' . $profile_data['hometown_state']; |
224 | 224 | if( $profile_data['hometown_country'] != 'United States' ){ |
225 | 225 | $hometown = ''; |
226 | 226 | $hometown .= $profile_data['hometown_country']; |
227 | 227 | } |
228 | | - if( $hometown == ", " ) $hometown = ''; |
| 228 | + if( $hometown == ', ' ) $hometown = ''; |
229 | 229 | |
230 | 230 | $joined_data = $profile_data['real_name'] . $location. $hometown . $profile_data['birthday'] . $profile_data['occupation'] . $profile_data['websites'] . $profile_data['places_lived'] . $profile_data['schools'] . $profile_data['about']; |
231 | 231 | $edit_info_link = SpecialPage::getTitleFor( 'UpdateProfile' ); |
— | — | @@ -233,12 +233,12 @@ |
234 | 234 | if( $joined_data ) { |
235 | 235 | $output .= '<div class="user-section-heading"> |
236 | 236 | <div class="user-section-title"> |
237 | | - '.wfMsg('user-personal-info-title').' |
| 237 | + ' . wfMsg( 'user-personal-info-title' ) . ' |
238 | 238 | </div> |
239 | 239 | <div class="user-section-actions"> |
240 | 240 | <div class="action-right">'; |
241 | 241 | if( $wgUser->getName() == $user_name ) { |
242 | | - $output .= '<a href="'.$edit_info_link->escapeFullURL().'">'.wfMsg('user-edit-this').'</a>'; |
| 242 | + $output .= '<a href="' . $edit_info_link->escapeFullURL() . '">' . wfMsg( 'user-edit-this' ) . '</a>'; |
243 | 243 | } |
244 | 244 | $output .= '</div> |
245 | 245 | <div class="cleared"></div> |
— | — | @@ -246,25 +246,25 @@ |
247 | 247 | </div> |
248 | 248 | <div class="cleared"></div> |
249 | 249 | <div class="profile-info-container">'. |
250 | | - $this->getProfileSection(wfMsg('user-personal-info-real-name'), $profile_data['real_name'], false). |
251 | | - $this->getProfileSection(wfMsg('user-personal-info-location'), $location, false). |
252 | | - $this->getProfileSection(wfMsg('user-personal-info-hometown'), $hometown, false). |
253 | | - $this->getProfileSection(wfMsg('user-personal-info-birthday'), $profile_data['birthday'], false). |
254 | | - $this->getProfileSection(wfMsg('user-personal-info-occupation'), $profile_data['occupation'], false). |
255 | | - $this->getProfileSection(wfMsg('user-personal-info-websites'), $profile_data['websites'], false). |
256 | | - $this->getProfileSection(wfMsg('user-personal-info-places-lived'), $profile_data['places_lived'], false). |
257 | | - $this->getProfileSection(wfMsg('user-personal-info-schools'), $profile_data['schools'], false). |
258 | | - $this->getProfileSection(wfMsg('user-personal-info-about-me'), $profile_data['about'], false). |
259 | | - "</div>"; |
| 250 | + $this->getProfileSection( wfMsg( 'user-personal-info-real-name' ), $profile_data['real_name'], false ). |
| 251 | + $this->getProfileSection( wfMsg( 'user-personal-info-location' ), $location, false ). |
| 252 | + $this->getProfileSection( wfMsg( 'user-personal-info-hometown' ), $hometown, false ). |
| 253 | + $this->getProfileSection( wfMsg( 'user-personal-info-birthday' ), $profile_data['birthday'], false ). |
| 254 | + $this->getProfileSection( wfMsg( 'user-personal-info-occupation' ), $profile_data['occupation'], false ). |
| 255 | + $this->getProfileSection( wfMsg( 'user-personal-info-websites' ), $profile_data['websites'], false ). |
| 256 | + $this->getProfileSection( wfMsg( 'user-personal-info-places-lived' ), $profile_data['places_lived'], false ). |
| 257 | + $this->getProfileSection( wfMsg( 'user-personal-info-schools' ), $profile_data['schools'], false ). |
| 258 | + $this->getProfileSection( wfMsg( 'user-personal-info-about-me' ), $profile_data['about'], false ). |
| 259 | + '</div>'; |
260 | 260 | } else if( $wgUser->getName() == $user_name ) { |
261 | 261 | $output .= '<div class="user-section-heading"> |
262 | 262 | <div class="user-section-title"> |
263 | | - '.wfMsg('user-personal-info-title').' |
| 263 | + ' . wfMsg( 'user-personal-info-title' ) . ' |
264 | 264 | </div> |
265 | 265 | <div class="user-section-actions"> |
266 | 266 | <div class="action-right"> |
267 | | - <a href="'.$edit_info_link->escapeFullURL().'">' |
268 | | - .wfMsg('user-edit-this'). |
| 267 | + <a href="' . $edit_info_link->escapeFullURL() . '">' |
| 268 | + . wfMsg( 'user-edit-this' ) . |
269 | 269 | '</a> |
270 | 270 | </div> |
271 | 271 | <div class="cleared"></div> |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | </div> |
274 | 274 | <div class="cleared"></div> |
275 | 275 | <div class="no-info-container"> |
276 | | - '.wfMsg('user-no-personal-info').' |
| 276 | + ' . wfMsg( 'user-no-personal-info' ) . ' |
277 | 277 | </div>'; |
278 | 278 | } |
279 | 279 | |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | } |
282 | 282 | |
283 | 283 | function getCustomInfo( $user_name ) { |
284 | | - global $wgUser, $wgMemc, $wgUserProfileDisplay; |
| 284 | + global $wgUser, $wgUserProfileDisplay; |
285 | 285 | |
286 | 286 | if( $wgUserProfileDisplay['custom'] == false ) { |
287 | 287 | return ''; |
— | — | @@ -299,12 +299,12 @@ |
300 | 300 | if( $joined_data ) { |
301 | 301 | $output .= '<div class="user-section-heading"> |
302 | 302 | <div class="user-section-title"> |
303 | | - '.wfMsg('custom-info-title').' |
| 303 | + ' . wfMsg( 'custom-info-title' ) . ' |
304 | 304 | </div> |
305 | 305 | <div class="user-section-actions"> |
306 | 306 | <div class="action-right">'; |
307 | 307 | if( $wgUser->getName() == $user_name ) { |
308 | | - $output .= '<a href="'.$edit_info_link->escapeFullURL().'/custom">'.wfMsg('user-edit-this').'</a>'; |
| 308 | + $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/custom">' . wfMsg( 'user-edit-this' ) . '</a>'; |
309 | 309 | } |
310 | 310 | $output .= '</div> |
311 | 311 | <div class="cleared"></div> |
— | — | @@ -312,20 +312,20 @@ |
313 | 313 | </div> |
314 | 314 | <div class="cleared"></div> |
315 | 315 | <div class="profile-info-container">'. |
316 | | - $this->getProfileSection(wfMsg('custom-info-field1'), $profile_data['custom_1'], false). |
317 | | - $this->getProfileSection(wfMsg('custom-info-field2'), $profile_data['custom_2'], false). |
318 | | - $this->getProfileSection(wfMsg('custom-info-field3'), $profile_data['custom_3'], false). |
319 | | - $this->getProfileSection(wfMsg('custom-info-field4'), $profile_data['custom_4'], false). |
320 | | - "</div>"; |
| 316 | + $this->getProfileSection( wfMsg( 'custom-info-field1' ), $profile_data['custom_1'], false ). |
| 317 | + $this->getProfileSection( wfMsg( 'custom-info-field2' ), $profile_data['custom_2'], false ). |
| 318 | + $this->getProfileSection( wfMsg( 'custom-info-field3' ), $profile_data['custom_3'], false ). |
| 319 | + $this->getProfileSection( wfMsg( 'custom-info-field4' ), $profile_data['custom_4'], false ). |
| 320 | + '</div>'; |
321 | 321 | } else if( $wgUser->getName() == $user_name ) { |
322 | 322 | $output .= '<div class="user-section-heading"> |
323 | 323 | <div class="user-section-title"> |
324 | | - '.wfMsg('custom-info-title').' |
| 324 | + ' . wfMsg( 'custom-info-title' ) . ' |
325 | 325 | </div> |
326 | 326 | <div class="user-section-actions"> |
327 | 327 | <div class="action-right"> |
328 | | - <a href="'.$edit_info_link->escapeFullURL().'/custom"> |
329 | | - '.wfMsg('user-edit-this').' |
| 328 | + <a href="' . $edit_info_link->escapeFullURL() . '/custom"> |
| 329 | + ' . wfMsg( 'user-edit-this' ) . ' |
330 | 330 | </a> |
331 | 331 | </div> |
332 | 332 | <div class="cleared"></div> |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | </div> |
335 | 335 | <div class="cleared"></div> |
336 | 336 | <div class="no-info-container"> |
337 | | - '.wfMsg('custom-no-info').' |
| 337 | + ' . wfMsg( 'custom-no-info' ) . ' |
338 | 338 | </div>'; |
339 | 339 | } |
340 | 340 | |
— | — | @@ -341,7 +341,7 @@ |
342 | 342 | } |
343 | 343 | |
344 | 344 | function getInterests( $user_name ) { |
345 | | - global $wgUser, $wgMemc, $wgUserProfileDisplay; |
| 345 | + global $wgUser, $wgUserProfileDisplay; |
346 | 346 | |
347 | 347 | // Load messages, we're gonna need 'em |
348 | 348 | wfLoadExtensionMessages( 'SocialProfileUserProfile' ); |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | } |
353 | 353 | |
354 | 354 | if( !$this->profile_data ){ |
355 | | - $profile = new UserProfile($user_name); |
| 355 | + $profile = new UserProfile( $user_name ); |
356 | 356 | $this->profile_data = $profile->getProfile(); |
357 | 357 | } |
358 | 358 | $profile_data = $this->profile_data; |
— | — | @@ -363,12 +363,12 @@ |
364 | 364 | |
365 | 365 | $output .= '<div class="user-section-heading"> |
366 | 366 | <div class="user-section-title"> |
367 | | - '.wfMsg('other-info-title').' |
| 367 | + ' . wfMsg( 'other-info-title' ) . ' |
368 | 368 | </div> |
369 | 369 | <div class="user-section-actions"> |
370 | 370 | <div class="action-right">'; |
371 | 371 | if( $wgUser->getName() == $user_name ) { |
372 | | - $output .= '<a href="'.$edit_info_link->escapeFullURL().'/personal">'.wfMsg('user-edit-this').'</a>'; |
| 372 | + $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/personal">' . wfMsg( 'user-edit-this' ) . '</a>'; |
373 | 373 | } |
374 | 374 | $output .= '</div> |
375 | 375 | <div class="cleared"></div> |
— | — | @@ -376,59 +376,59 @@ |
377 | 377 | </div> |
378 | 378 | <div class="cleared"></div> |
379 | 379 | <div class="profile-info-container">'. |
380 | | - $this->getProfileSection(wfMsg('other-info-movies'), $profile_data['movies'], false). |
381 | | - $this->getProfileSection(wfMsg('other-info-tv'), $profile_data['tv'], false). |
382 | | - $this->getProfileSection(wfMsg('other-info-music'), $profile_data['music'], false). |
383 | | - $this->getProfileSection(wfMsg('other-info-books'), $profile_data['books'], false). |
384 | | - $this->getProfileSection(wfMsg('other-info-video-games'), $profile_data['video_games'], false). |
385 | | - $this->getProfileSection(wfMsg('other-info-magazines'), $profile_data['magazines'], false). |
386 | | - $this->getProfileSection(wfMsg('other-info-snacks'), $profile_data['snacks'], false). |
387 | | - $this->getProfileSection(wfMsg('other-info-drinks'), $profile_data['drinks'], false). |
| 380 | + $this->getProfileSection( wfMsg( 'other-info-movies' ), $profile_data['movies'], false ). |
| 381 | + $this->getProfileSection( wfMsg( 'other-info-tv' ), $profile_data['tv'], false ). |
| 382 | + $this->getProfileSection( wfMsg( 'other-info-music' ), $profile_data['music'], false ). |
| 383 | + $this->getProfileSection( wfMsg( 'other-info-books' ), $profile_data['books'], false ). |
| 384 | + $this->getProfileSection( wfMsg( 'other-info-video-games' ), $profile_data['video_games'], false ). |
| 385 | + $this->getProfileSection( wfMsg( 'other-info-magazines' ), $profile_data['magazines'], false ). |
| 386 | + $this->getProfileSection( wfMsg( 'other-info-snacks' ), $profile_data['snacks'], false ). |
| 387 | + $this->getProfileSection( wfMsg( 'other-info-drinks' ), $profile_data['drinks'], false ). |
388 | 388 | '</div>'; |
389 | 389 | |
390 | 390 | } else if( $wgUser->getName() == $user_name ) { |
391 | 391 | $output .= '<div class="user-section-heading"> |
392 | 392 | <div class="user-section-title"> |
393 | | - '.wfMsg('other-info-title').' |
| 393 | + ' . wfMsg( 'other-info-title' ) . ' |
394 | 394 | </div> |
395 | 395 | <div class="user-section-actions"> |
396 | 396 | <div class="action-right"> |
397 | | - <a href="'.$edit_info_link->escapeFullURL().'/personal">'.wfMsg('user-edit-this').'</a> |
| 397 | + <a href="' . $edit_info_link->escapeFullURL() . '/personal">' . wfMsg( 'user-edit-this' ) . '</a> |
398 | 398 | </div> |
399 | 399 | <div class="cleared"></div> |
400 | 400 | </div> |
401 | 401 | </div> |
402 | 402 | <div class="cleared"></div> |
403 | 403 | <div class="no-info-container"> |
404 | | - '.wfMsg('other-no-info').' |
| 404 | + ' . wfMsg( 'other-no-info' ) . ' |
405 | 405 | </div>'; |
406 | 406 | } |
407 | 407 | return $output; |
408 | 408 | } |
409 | 409 | |
410 | 410 | function getProfileTop( $user_id, $user_name ) { |
411 | | - global $wgTitle, $wgUser, $wgMemc, $wgUploadPath, $wgLang; |
| 411 | + global $wgTitle, $wgUser, $wgUploadPath, $wgLang; |
412 | 412 | |
413 | 413 | // Load messages, we're gonna need 'em |
414 | 414 | wfLoadExtensionMessages( 'SocialProfileUserProfile' ); |
415 | 415 | |
416 | | - $stats = new UserStats($user_id, $user_name); |
| 416 | + $stats = new UserStats( $user_id, $user_name ); |
417 | 417 | $stats_data = $stats->getUserStats(); |
418 | | - $user_level = new UserLevel($stats_data['points']); |
419 | | - $level_link = Title::makeTitle( NS_HELP, wfMsgHtml('user-profile-userlevels-link') ); |
| 418 | + $user_level = new UserLevel( $stats_data['points'] ); |
| 419 | + $level_link = Title::makeTitle( NS_HELP, wfMsgHtml( 'user-profile-userlevels-link' ) ); |
420 | 420 | |
421 | 421 | if( !$this->profile_data ){ |
422 | | - $profile = new UserProfile($user_name); |
| 422 | + $profile = new UserProfile( $user_name ); |
423 | 423 | $this->profile_data = $profile->getProfile(); |
424 | 424 | } |
425 | 425 | $profile_data = $this->profile_data; |
426 | 426 | |
427 | 427 | // Variables and other crap |
428 | 428 | $page_title = $wgTitle->getText(); |
429 | | - $title_parts = explode("/", $page_title); |
| 429 | + $title_parts = explode( '/', $page_title ); |
430 | 430 | $user = $title_parts[0]; |
431 | | - $id = User::idFromName($user); |
432 | | - $user_safe = urlencode($user); |
| 431 | + $id = User::idFromName( $user ); |
| 432 | + $user_safe = urlencode( $user ); |
433 | 433 | |
434 | 434 | // Safe urls |
435 | 435 | $add_relationship = SpecialPage::getTitleFor( 'AddRelationship' ); |
— | — | @@ -447,33 +447,37 @@ |
448 | 448 | $user_wiki = Title::makeTitle( NS_USER_WIKI, $user ); |
449 | 449 | |
450 | 450 | if( $id != 0 ) $relationship = UserRelationship::getUserRelationshipByID( $id, $wgUser->getID() ); |
451 | | - $avatar = new wAvatar($this->user_id, 'l'); |
| 451 | + $avatar = new wAvatar( $this->user_id, 'l' ); |
452 | 452 | |
453 | 453 | wfDebug("profile type" . $profile_data['user_page_type'] . "\n"); |
454 | 454 | $output = ''; |
455 | 455 | if ( $this->isOwner() ) { |
456 | 456 | $toggle_title = SpecialPage::getTitleFor( 'ToggleUserPage' ); |
457 | | - $output .= '<div id="profile-toggle-button"><a href="'.$toggle_title->escapeFullURL().'" rel="nofollow">'. ( ( $this->profile_data['user_page_type'] == 1 ) ? wfMsg('user-type-toggle-old') : wfMsg('user-type-toggle-new') ) .'</a></div>'; |
| 457 | + $output .= '<div id="profile-toggle-button"> |
| 458 | + <a href="' . $toggle_title->escapeFullURL() . '" rel="nofollow">' |
| 459 | + . ( ( $this->profile_data['user_page_type'] == 1 ) ? wfMsg( 'user-type-toggle-old' ) : wfMsg( 'user-type-toggle-new' ) ) . |
| 460 | + '</a> |
| 461 | + </div>'; |
458 | 462 | } |
459 | 463 | |
460 | 464 | $output .= '<div id="profile-image"> |
461 | | - <img src="'.$wgUploadPath.'/avatars/'.$avatar->getAvatarImage().'" alt="" border="0"/> |
| 465 | + <img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" /> |
462 | 466 | </div>'; |
463 | 467 | |
464 | 468 | $output .= '<div id="profile-right">'; |
465 | 469 | |
466 | 470 | $output .= '<div id="profile-title-container"> |
467 | 471 | <div id="profile-title"> |
468 | | - '.$user_name.' |
| 472 | + ' . $user_name . ' |
469 | 473 | </div>'; |
470 | 474 | global $wgUserLevels; |
471 | 475 | if( $wgUserLevels ){ |
472 | | - $output .= "<div id=\"points-level\"> |
473 | | - <a href=\"{$level_link->escapeFullURL()}\">" . wfMsgExt( 'user-profile-points', 'parsemag', $stats_data["points"] ) . "</a> |
| 476 | + $output .= '<div id="points-level"> |
| 477 | + <a href="' . $level_link->escapeFullURL() .'">' . wfMsgExt( 'user-profile-points', 'parsemag', $stats_data['points'] ) . '</a> |
474 | 478 | </div> |
475 | | - <div id=\"honorific-level\"> |
476 | | - <a href=\"{$level_link->escapeFullURL()}\" rel=\"nofollow\">({$user_level->getLevelName()})</a> |
477 | | - </div>"; |
| 479 | + <div id="honorific-level"> |
| 480 | + <a href="' . $level_link->escapeFullURL() .'" rel="nofollow">(' . $user_level->getLevelName() .')</a> |
| 481 | + </div>'; |
478 | 482 | } |
479 | 483 | $output .= '<div class="cleared"></div> |
480 | 484 | </div> |
— | — | @@ -489,8 +493,8 @@ |
490 | 494 | } else if( $wgUser->isLoggedIn() ) { |
491 | 495 | if( $relationship == false ) { |
492 | 496 | $output .= $wgLang->pipeList( array( |
493 | | - '<a href="'.$add_relationship->escapeFullURL('user='.$user_safe.'&rel_type=1').'" rel="nofollow">'.wfMsg('user-add-friend').'</a>', |
494 | | - '<a href="'.$add_relationship->escapeFullURL('user='.$user_safe.'&rel_type=2').'" rel="nofollow">'.wfMsg('user-add-foe').'</a>', |
| 497 | + '<a href="' . $add_relationship->escapeFullURL( 'user=' . $user_safe . '&rel_type=1' ) . '" rel="nofollow">' . wfMsg( 'user-add-friend' ) . '</a>', |
| 498 | + '<a href="' . $add_relationship->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '" rel="nofollow">' . wfMsg( 'user-add-foe' ) . '</a>', |
495 | 499 | '' |
496 | 500 | ) ); |
497 | 501 | } else { |
— | — | @@ -510,27 +514,27 @@ |
511 | 515 | |
512 | 516 | global $wgUserBoard; |
513 | 517 | if( $wgUserBoard ){ |
514 | | - $output .= '<a href="'.$send_message->escapeFullURL('user='.$wgUser->getName().'&conv='.$user_safe).'" rel="nofollow">'.wfMsg('user-send-message').'</a>'; |
515 | | - $output .= wfMsgExt( 'pipe-separator' , 'escapenoentities' ); |
| 518 | + $output .= '<a href="' . $send_message->escapeFullURL( 'user=' . $wgUser->getName() . '&conv=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-send-message' ) . '</a>'; |
| 519 | + $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' ); |
516 | 520 | } |
517 | | - $output .= '<a href="'.$give_gift->escapeFullURL('user='.$user_safe).'" rel="nofollow">'.wfMsg('user-send-gift').'</a>'; |
518 | | - $output .= wfMsgExt( 'pipe-separator' , 'escapenoentities' ); |
| 521 | + $output .= '<a href="' . $give_gift->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-send-gift' ) . '</a>'; |
| 522 | + $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' ); |
519 | 523 | } |
520 | 524 | |
521 | | - $output .= '<a href="'.$contributions->escapeFullURL().'" rel="nofollow">'.wfMsg('user-contributions').'</a> '; |
| 525 | + $output .= '<a href="' . $contributions->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-contributions' ) . '</a> '; |
522 | 526 | |
523 | 527 | // Links to User:user_name from User_profile: |
524 | 528 | if( $wgTitle->getNamespace() == NS_USER_PROFILE && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ){ |
525 | | - $output .= '| <a href="'.$user_page->escapeFullURL().'" rel="nofollow">'.wfMsg('user-page-link').'</a> '; |
| 529 | + $output .= '| <a href="' . $user_page->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-page-link' ) . '</a> '; |
526 | 530 | } |
527 | 531 | |
528 | 532 | // Links to User:user_name from User_profile: |
529 | 533 | if( $wgTitle->getNamespace() == NS_USER && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ){ |
530 | | - $output .= '| <a href="'.$user_social_profile->escapeFullURL().'" rel="nofollow">'.wfMsg('user-social-profile-link').'</a> '; |
| 534 | + $output .= '| <a href="' . $user_social_profile->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-social-profile-link' ) . '</a> '; |
531 | 535 | } |
532 | 536 | |
533 | 537 | if( $wgTitle->getNamespace() == NS_USER && ( !$this->profile_data['user_id'] || $this->profile_data['user_page_type'] == 1 ) ){ |
534 | | - $output .= '| <a href="'.$user_wiki->escapeFullURL().'" rel="nofollow">'.wfMsg('user-wiki-link').'</a>'; |
| 538 | + $output .= '| <a href="' . $user_wiki->escapeFullURL() . '" rel="nofollow">' . wfMsg( 'user-wiki-link' ) . '</a>'; |
535 | 539 | } |
536 | 540 | |
537 | 541 | $output .= '</div> |
— | — | @@ -543,17 +547,17 @@ |
544 | 548 | function getProfileImage( $user_name ){ |
545 | 549 | global $wgUser, $wgUploadPath; |
546 | 550 | |
547 | | - $avatar = new wAvatar($this->user_id, 'l'); |
| 551 | + $avatar = new wAvatar( $this->user_id, 'l' ); |
548 | 552 | $avatar_title = SpecialPage::getTitleFor( 'UploadAvatar' ); |
549 | 553 | |
550 | 554 | $output .= '<div class="profile-image">'; |
551 | 555 | if( $wgUser->getName() == $this->user_name ) { |
552 | | - $output .= "<a href=\"{$avatar->escapeFullURL()}\" rel=\"nofollow\"> |
553 | | - <img src=\"{$wgUploadPath}/avatars/".$avatar->getAvatarImage()."\" alt=\"\" border=\"0\"/><br /> |
554 | | - (".( ( strpos( $avatar->getAvatarImage(), 'default_' ) != false ) ? "upload image" : "new image" ).") |
555 | | - </a>"; |
| 556 | + $output .= '<a href="' . $avatar->escapeFullURL() .'" rel="nofollow"> |
| 557 | + <img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" /><br /> |
| 558 | + (' . ( ( strpos( $avatar->getAvatarImage(), 'default_' ) != false ) ? 'upload image' : 'new image' ) . ') |
| 559 | + </a>'; |
556 | 560 | } else { |
557 | | - $output .= '<img src="'.$wgUploadPath.'/avatars/'.$avatar->getAvatarImage().'" alt="" border="0"/>'; |
| 561 | + $output .= '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
558 | 562 | } |
559 | 563 | $output .= '</div>'; |
560 | 564 | |
— | — | @@ -586,41 +590,40 @@ |
587 | 591 | |
588 | 592 | // Try cache |
589 | 593 | if( !$data ) { |
590 | | - $friends = $rel->getRelationshipList($rel_type,$count); |
| 594 | + $friends = $rel->getRelationshipList( $rel_type, $count ); |
591 | 595 | $wgMemc->set( $key, $friends ); |
592 | 596 | } else { |
593 | 597 | wfDebug( "Got profile relationship type {$rel_type} for user {$user_name} from cache\n" ); |
594 | 598 | $friends = $data; |
595 | 599 | } |
596 | 600 | |
597 | | - $stats = new UserStats($rel->user_id, $user_name); |
| 601 | + $stats = new UserStats( $rel->user_id, $user_name ); |
598 | 602 | $stats_data = $stats->getUserStats(); |
599 | 603 | $user_safe = urlencode( $user_name ); |
600 | 604 | $view_all_title = SpecialPage::getTitleFor( 'ViewRelationships' ); |
601 | 605 | |
602 | 606 | if( $rel_type == 1 ) { |
603 | 607 | $relationship_count = $stats_data['friend_count']; |
604 | | - $relationship_title = wfMsg('user-friends-title'); |
605 | | - |
| 608 | + $relationship_title = wfMsg( 'user-friends-title' ); |
606 | 609 | } else { |
607 | 610 | $relationship_count = $stats_data['foe_count']; |
608 | | - $relationship_title = wfMsg('user-foes-title'); |
| 611 | + $relationship_title = wfMsg( 'user-foes-title' ); |
609 | 612 | } |
610 | 613 | |
611 | | - if( count($friends) > 0 ) { |
| 614 | + if( count( $friends ) > 0 ) { |
612 | 615 | $x = 1; |
613 | 616 | $per_row = 4; |
614 | 617 | |
615 | 618 | $output .= '<div class="user-section-heading"> |
616 | | - <div class="user-section-title">'.$relationship_title.'</div> |
| 619 | + <div class="user-section-title">' . $relationship_title . '</div> |
617 | 620 | <div class="user-section-actions"> |
618 | 621 | <div class="action-right">'; |
619 | | - if( intval( str_replace( ",", "", $relationship_count ) ) > 4 ) { |
620 | | - $output .= '<a href="'.$view_all_title->escapeFullURL('user='.$user_name.'&rel_type='.$rel_type).'" rel="nofollow">'.wfMsg('user-view-all').'</a>'; |
| 622 | + if( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) { |
| 623 | + $output .= '<a href="' . $view_all_title->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
621 | 624 | } |
622 | 625 | $output .= '</div> |
623 | 626 | <div class="action-left">'; |
624 | | - if( intval( str_replace( ",", "", $relationship_count ) ) > 4 ) { |
| 627 | + if( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) { |
625 | 628 | $output .= wfMsg( 'user-count-separator', $per_row, $relationship_count ); |
626 | 629 | } else { |
627 | 630 | $output .= wfMsg( 'user-count-separator', $relationship_count, $relationship_count ); |
— | — | @@ -635,17 +638,17 @@ |
636 | 639 | foreach( $friends as $friend ) { |
637 | 640 | $user = Title::makeTitle( NS_USER, $friend['user_name'] ); |
638 | 641 | $avatar = new wAvatar( $friend['user_id'], 'ml' ); |
639 | | - $avatar_img = '<img src="'.$wgUploadPath.'/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0"/>'; |
| 642 | + $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />'; |
640 | 643 | |
641 | 644 | // Chop down username that gets displayed |
642 | | - $user_name = substr($friend['user_name'], 0, 9); |
| 645 | + $user_name = substr( $friend['user_name'], 0, 9 ); |
643 | 646 | if( $user_name != $friend['user_name'] ) $user_name.= '..'; |
644 | 647 | |
645 | 648 | $output .= "<a href=\"".$user->escapeFullURL()."\" title=\"{$friend["user_name"]}\" rel=\"nofollow\"> |
646 | 649 | {$avatar_img}<br /> |
647 | 650 | {$user_name} |
648 | 651 | </a>"; |
649 | | - if( $x == count($friends) || $x != 1 && $x%$per_row == 0 ) $output.= '<div class="cleared"></div>'; |
| 652 | + if( $x == count( $friends ) || $x != 1 && $x%$per_row == 0 ) $output.= '<div class="cleared"></div>'; |
650 | 653 | $x++; |
651 | 654 | } |
652 | 655 | $output .= '</div>'; |
— | — | @@ -667,8 +670,8 @@ |
668 | 671 | $output = ''; |
669 | 672 | |
670 | 673 | // USER TO USER GIFTS |
671 | | - $g = new UserGifts($user_name); |
672 | | - $user_safe = urlencode($user_name); |
| 674 | + $g = new UserGifts( $user_name ); |
| 675 | + $user_safe = urlencode( $user_name ); |
673 | 676 | |
674 | 677 | // Try cache |
675 | 678 | $key = wfMemcKey( 'user', 'profile', 'gifts', "{$g->user_id}" ); |
— | — | @@ -676,14 +679,14 @@ |
677 | 680 | |
678 | 681 | if( !$data ){ |
679 | 682 | wfDebug( "Got profile gifts for user {$user_name} from DB\n" ); |
680 | | - $gifts = $g->getUserGiftList(0, 4); |
| 683 | + $gifts = $g->getUserGiftList( 0, 4 ); |
681 | 684 | $wgMemc->set( $key, $gifts, 60 * 60 * 4 ); |
682 | 685 | } else { |
683 | 686 | wfDebug( "Got profile gifts for user {$user_name} from cache\n" ); |
684 | 687 | $gifts = $data; |
685 | 688 | } |
686 | 689 | |
687 | | - $gift_count = $g->getGiftCountByUsername($user_name); |
| 690 | + $gift_count = $g->getGiftCountByUsername( $user_name ); |
688 | 691 | $gift_link = SpecialPage::getTitleFor( 'ViewGifts' ); |
689 | 692 | $per_row = 4; |
690 | 693 | |
— | — | @@ -691,17 +694,17 @@ |
692 | 695 | |
693 | 696 | $output .= '<div class="user-section-heading"> |
694 | 697 | <div class="user-section-title"> |
695 | | - '.wfMsg('user-gifts-title').' |
| 698 | + ' . wfMsg( 'user-gifts-title' ) . ' |
696 | 699 | </div> |
697 | 700 | <div class="user-section-actions"> |
698 | 701 | <div class="action-right">'; |
699 | 702 | if( $gift_count > 4 ) { |
700 | | - $output .= '<a href="'.$gift_link->escapeFullURL('user='.$user_safe).'" rel="nofollow">'.wfMsg('user-view-all').'</a>'; |
| 703 | + $output .= '<a href="' . $gift_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
701 | 704 | } |
702 | 705 | $output .= '</div> |
703 | 706 | <div class="action-left">'; |
704 | 707 | if( $gift_count > 4 ) { |
705 | | - $output .= wfMsg( 'user-count-separator', "4", $gift_count ); |
| 708 | + $output .= wfMsg( 'user-count-separator', '4', $gift_count ); |
706 | 709 | } else { |
707 | 710 | $output .= wfMsg( 'user-count-separator', $gift_count, $gift_count ); |
708 | 711 | } |
— | — | @@ -723,10 +726,10 @@ |
724 | 727 | } |
725 | 728 | |
726 | 729 | $user = Title::makeTitle( NS_USER, $gift['user_name_from'] ); |
727 | | - $gift_image = '<img src="'.$wgUploadPath.'/awards/' . Gifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />'; |
| 730 | + $gift_image = '<img src="' . $wgUploadPath . '/awards/' . Gifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />'; |
728 | 731 | $gift_link = $user = SpecialPage::getTitleFor( 'ViewGift' ); |
729 | 732 | $output .= "<a href=\"".$gift_link->escapeFullURL('gift_id='.$gift['id'])."\" ".( ( $gift['status'] == 1 ) ? 'class="user-page-new"' : '' )." rel=\"nofollow\">{$gift_image}</a>"; |
730 | | - if( $x == count($gifts) || $x != 1 && $x%$per_row == 0 ) $output .= '<div class="cleared"></div>'; |
| 733 | + if( $x == count( $gifts ) || $x != 1 && $x%$per_row == 0 ) $output .= '<div class="cleared"></div>'; |
731 | 734 | $x++; |
732 | 735 | |
733 | 736 | } |
— | — | @@ -751,21 +754,21 @@ |
752 | 755 | $output = ''; |
753 | 756 | |
754 | 757 | // SYSTEM GIFTS |
755 | | - $sg = new UserSystemGifts($user_name); |
| 758 | + $sg = new UserSystemGifts( $user_name ); |
756 | 759 | |
757 | 760 | // Try cache |
758 | 761 | $sg_key = wfMemcKey( 'user', 'profile', 'system_gifts', "{$sg->user_id}" ); |
759 | 762 | $data = $wgMemc->get( $sg_key ); |
760 | 763 | if( !$data ){ |
761 | 764 | wfDebug( "Got profile awards for user {$user_name} from DB\n" ); |
762 | | - $system_gifts = $sg->getUserGiftList(0, 4); |
| 765 | + $system_gifts = $sg->getUserGiftList( 0, 4 ); |
763 | 766 | $wgMemc->set( $sg_key, $system_gifts, 60 * 60 * 4 ); |
764 | 767 | } else { |
765 | 768 | wfDebug( "Got profile awards for user {$user_name} from cache\n" ); |
766 | 769 | $system_gifts = $data; |
767 | 770 | } |
768 | 771 | |
769 | | - $system_gift_count = $sg->getGiftCountByUsername($user_name); |
| 772 | + $system_gift_count = $sg->getGiftCountByUsername( $user_name ); |
770 | 773 | $system_gift_link = SpecialPage::getTitleFor( 'ViewSystemGifts' ); |
771 | 774 | $per_row = 4; |
772 | 775 | |
— | — | @@ -774,44 +777,44 @@ |
775 | 778 | |
776 | 779 | $output .= '<div class="user-section-heading"> |
777 | 780 | <div class="user-section-title"> |
778 | | - '.wfMsg('user-awards-title').' |
| 781 | + ' . wfMsg( 'user-awards-title' ) . ' |
779 | 782 | </div> |
780 | 783 | <div class="user-section-actions"> |
781 | 784 | <div class="action-right">'; |
782 | 785 | if( $system_gift_count > 4 ) { |
783 | | - $output .= '<a href="'.$system_gift_link->escapeFullURL('user='.$user_name).'" rel="nofollow">'.wfMsg('user-view-all').'</a>'; |
| 786 | + $output .= '<a href="' . $system_gift_link->escapeFullURL( 'user=' . $user_name ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
784 | 787 | } |
785 | 788 | $output .= '</div> |
786 | 789 | <div class="action-left">'; |
787 | 790 | if( $system_gift_count > 4 ) { |
788 | | - $output .= wfMsg( 'user-count-separator', "4", $system_gift_count ); |
| 791 | + $output .= wfMsg( 'user-count-separator', '4', $system_gift_count ); |
789 | 792 | } else { |
790 | 793 | $output .= wfMsg( 'user-count-separator', $system_gift_count, $system_gift_count ); |
791 | 794 | } |
792 | | - $output .= "</div> |
793 | | - <div class=\"cleared\"></div> |
| 795 | + $output .= '</div> |
| 796 | + <div class="cleared"></div> |
794 | 797 | </div> |
795 | 798 | </div> |
796 | | - <div class=\"cleared\"></div> |
797 | | - <div class=\"user-gift-container\">"; |
| 799 | + <div class="cleared"></div> |
| 800 | + <div class="user-gift-container">'; |
798 | 801 | |
799 | 802 | foreach( $system_gifts as $gift ) { |
800 | 803 | |
801 | 804 | if( $gift['status'] == 1 && $user_name == $wgUser->getName() ){ |
802 | | - $sg->clearUserGiftStatus($gift['id']); |
| 805 | + $sg->clearUserGiftStatus( $gift['id'] ); |
803 | 806 | $wgMemc->delete( $sg_key ); |
804 | 807 | $sg->decNewSystemGiftCount( $wgUser->getID() ); |
805 | 808 | } |
806 | 809 | |
807 | | - $gift_image = '<img src="'.$wgUploadPath.'/awards/' . SystemGifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />'; |
| 810 | + $gift_image = '<img src="' . $wgUploadPath . '/awards/' . SystemGifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />'; |
808 | 811 | $gift_link = $user = SpecialPage::getTitleFor( 'ViewSystemGift' ); |
809 | 812 | |
810 | 813 | $output .= "<a href=\"".$gift_link->escapeFullURL('gift_id='.$gift['id'])."\" ".( ( $gift['status'] == 1 ) ? 'class="user-page-new"' : '' )." rel=\"nofollow\"> |
811 | 814 | {$gift_image} |
812 | 815 | </a>"; |
813 | 816 | |
814 | | - if( $x == count($system_gifts) || $x != 1 && $x%$per_row == 0 ) $output .= '<div class="cleared"></div>'; |
815 | | - $x++; |
| 817 | + if( $x == count( $system_gifts ) || $x != 1 && $x%$per_row == 0 ) $output .= '<div class="cleared"></div>'; |
| 818 | + $x++; |
816 | 819 | } |
817 | 820 | |
818 | 821 | $output .= '</div>'; |
— | — | @@ -834,13 +837,13 @@ |
835 | 838 | |
836 | 839 | $output = ''; // Prevent E_NOTICE |
837 | 840 | |
838 | | - $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgUserProfileScripts}/UserProfilePage.js\"></script>\n"); |
| 841 | + $wgOut->addScriptFile( $wgUserProfileScripts . '/UserProfilePage.js' ); |
839 | 842 | |
840 | | - $rel = new UserRelationship($user_name); |
841 | | - $friends = $rel->getRelationshipList(1, 4); |
| 843 | + $rel = new UserRelationship( $user_name ); |
| 844 | + $friends = $rel->getRelationshipList( 1, 4 ); |
842 | 845 | |
843 | | - $user_safe = str_replace("&", "%26", $user_name); |
844 | | - $stats = new UserStats($user_id, $user_name); |
| 846 | + $user_safe = str_replace( '&', '%26', $user_name ); |
| 847 | + $stats = new UserStats( $user_id, $user_name ); |
845 | 848 | $stats_data = $stats->getUserStats(); |
846 | 849 | $total = $stats_data['user_board']; |
847 | 850 | |
— | — | @@ -848,19 +851,19 @@ |
849 | 852 | |
850 | 853 | $output .= '<div class="user-section-heading"> |
851 | 854 | <div class="user-section-title"> |
852 | | - '.wfMsg("user-board-title").' |
| 855 | + ' . wfMsg( 'user-board-title' ) . ' |
853 | 856 | </div> |
854 | 857 | <div class="user-section-actions"> |
855 | 858 | <div class="action-right">'; |
856 | 859 | if( $wgUser->getName() == $user_name ) { |
857 | | - if( $friends ) $output .= '<a href="' . UserBoard::getBoardBlastURL().'">'.wfMsg('user-send-board-blast').'</a>'; |
858 | | - if( $total > 10 ) $output .= wfMsgExt( 'pipe-separator' , 'escapenoentities' ); |
| 860 | + if( $friends ) $output .= '<a href="' . UserBoard::getBoardBlastURL() . '">' . wfMsg( 'user-send-board-blast' ) . '</a>'; |
| 861 | + if( $total > 10 ) $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' ); |
859 | 862 | } |
860 | | - if( $total > 10 ) $output .= '<a href="'.UserBoard::getUserBoardURL($user_name).'">'.wfMsg('user-view-all').'</a>'; |
| 863 | + if( $total > 10 ) $output .= '<a href="' . UserBoard::getUserBoardURL( $user_name ) . '">' . wfMsg( 'user-view-all' ) . '</a>'; |
861 | 864 | $output .= '</div> |
862 | 865 | <div class="action-left">'; |
863 | 866 | if( $total > 10 ) { |
864 | | - $output .= wfMsg( 'user-count-separator', "10", $total ); |
| 867 | + $output .= wfMsg( 'user-count-separator', '10', $total ); |
865 | 868 | } else if( $total > 0 ) { |
866 | 869 | $output .= wfMsg( 'user-count-separator', $total, $total ); |
867 | 870 | } |
— | — | @@ -875,7 +878,7 @@ |
876 | 879 | // Some nice message in a other part of the extension :) |
877 | 880 | wfLoadExtensionMessages( 'SocialProfileUserBoard' ); |
878 | 881 | $output .= '<div class="user-page-message-form"> |
879 | | - <input type="hidden" id="user_name_to" name="user_name_to" value="' . addslashes($user_name).'"/> |
| 882 | + <input type="hidden" id="user_name_to" name="user_name_to" value="' . addslashes( $user_name ) . '" /> |
880 | 883 | <span style="color:#797979;">' . wfMsgHtml( 'userboard_messagetype' ) . '</span> |
881 | 884 | <select id="message_type"> |
882 | 885 | <option value="0">' . wfMsgHtml( 'userboard_public' ) . '</option> |
— | — | @@ -883,20 +886,20 @@ |
884 | 887 | </select><p> |
885 | 888 | <textarea name="message" id="message" cols="43" rows="4"/></textarea> |
886 | 889 | <div class="user-page-message-box-button"> |
887 | | - <input type="button" value="' . wfMsg('userboard_sendbutton') . '" class="site-button" onclick="javascript:send_message();"> |
| 890 | + <input type="button" value="' . wfMsg( 'userboard_sendbutton' ) . '" class="site-button" onclick="javascript:send_message();"> |
888 | 891 | </div> |
889 | 892 | </div>'; |
890 | 893 | } else { |
891 | | - $login_link = SpecialPage::getTitleFor( 'UserLogin' ); |
| 894 | + $login_link = SpecialPage::getTitleFor( 'Userlogin' ); |
892 | 895 | |
893 | 896 | $output .= '<div class="user-page-message-form"> |
894 | | - '.wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ).' |
| 897 | + ' . wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ) . ' |
895 | 898 | </div>'; |
896 | 899 | } |
897 | 900 | } |
898 | 901 | $output .= '<div id="user-page-board">'; |
899 | 902 | $b = new UserBoard(); |
900 | | - $output .= $b->displayMessages($user_id, 0, 10); |
| 903 | + $output .= $b->displayMessages( $user_id, 0, 10 ); |
901 | 904 | |
902 | 905 | $output .= '</div>'; |
903 | 906 | |
— | — | @@ -908,7 +911,7 @@ |
909 | 912 | * and FanBoxes extension is installed. |
910 | 913 | */ |
911 | 914 | function getFanBoxes( $user_name ){ |
912 | | - global $wgOut, $wgUser, $wgTitle, $wgMemc, $wgUserProfileDisplay, $wgFanBoxScripts, $wgFanBoxDirectory, $wgEnableUserBoxes; |
| 915 | + global $wgOut, $wgUser, $wgTitle, $wgMemc, $wgUserProfileDisplay, $wgFanBoxScripts, $wgEnableUserBoxes; |
913 | 916 | |
914 | 917 | if ( !$wgEnableUserBoxes || $wgUserProfileDisplay['userboxes'] == false ) { |
915 | 918 | return ''; |
— | — | @@ -921,7 +924,7 @@ |
922 | 925 | |
923 | 926 | $output = ''; |
924 | 927 | $f = new UserFanBoxes( $user_name ); |
925 | | - $user_safe = ($user_name); |
| 928 | + $user_safe = ( $user_name ); |
926 | 929 | |
927 | 930 | // Try cache |
928 | 931 | //$key = wfMemcKey( 'user', 'profile', 'fanboxes', "{$f->user_id}" ); |
— | — | @@ -991,6 +994,7 @@ |
992 | 995 | $fantag_leftside = $fantag_leftside->getText(); |
993 | 996 | } |
994 | 997 | |
| 998 | + $leftfontsize = '10px'; |
995 | 999 | if ( $fanbox['fantag_left_textsize'] == 'mediumfont' ) { |
996 | 1000 | $leftfontsize = '11px'; |
997 | 1001 | } |
— | — | @@ -1030,9 +1034,9 @@ |
1031 | 1035 | if( $wgUser->isLoggedIn() ) { |
1032 | 1036 | if( $check_user_fanbox == 0 ) { |
1033 | 1037 | $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox".$fanbox['fantag_id']."\"> |
1034 | | - <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\" > |
| 1038 | + <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> |
1035 | 1039 | <tr> |
1036 | | - <td style=\"font-size:10px\">". wfMsgForContent( 'fanbox-add-fanbox' ) ."</td> |
| 1040 | + <td style=\"font-size:10px\">". wfMsg( 'fanbox-add-fanbox' ) ."</td> |
1037 | 1041 | </tr> |
1038 | 1042 | <tr> |
1039 | 1043 | <td align=\"center\"> |
— | — | @@ -1046,7 +1050,7 @@ |
1047 | 1051 | $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox".$fanbox['fantag_id']."\"> |
1048 | 1052 | <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> |
1049 | 1053 | <tr> |
1050 | | - <td style=\"font-size:10px\">". wfMsgForContent( 'fanbox-remove-fanbox' ) ."</td> |
| 1054 | + <td style=\"font-size:10px\">". wfMsg( 'fanbox-remove-fanbox' ) ."</td> |
1051 | 1055 | </tr> |
1052 | 1056 | <tr> |
1053 | 1057 | <td align=\"center\"> |
— | — | @@ -1064,7 +1068,7 @@ |
1065 | 1069 | $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox".$fanbox['fantag_id']."\"> |
1066 | 1070 | <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\"> |
1067 | 1071 | <tr> |
1068 | | - <td style=\"font-size:10px\">". wfMsgForContent( 'fanbox-add-fanbox-login' ) ."<a href=\"{$login->getFullURL()}\">". wfMsgForContent( 'fanbox-login' ) ."</a></td> |
| 1072 | + <td style=\"font-size:10px\">". wfMsg( 'fanbox-add-fanbox-login' ) ."<a href=\"{$login->getFullURL()}\">". wfMsg( 'fanbox-login' ) ."</a></td> |
1069 | 1073 | </tr> |
1070 | 1074 | <tr> |
1071 | 1075 | <td align=\"center\"> |