Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php |
— | — | @@ -127,13 +127,17 @@ |
128 | 128 | $stats = new UserStats( $user_id, $user_name ); |
129 | 129 | $stats_data = $stats->getUserStats(); |
130 | 130 | |
131 | | - $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 | + $total_value = $stats_data['edits'] . $stats_data['votes'] . |
| 132 | + $stats_data['comments'] . $stats_data['recruits'] . |
| 133 | + $stats_data['poll_votes'] . |
| 134 | + $stats_data['picture_game_votes'] . |
| 135 | + $stats_data['quiz_points']; |
132 | 136 | |
133 | 137 | if ( $total_value != 0 ) { |
134 | 138 | $output .= '<div class="user-section-heading"> |
135 | | - <div class="user-section-title"> |
136 | | - ' . wfMsg( 'user-stats-title' ) . ' |
137 | | - </div> |
| 139 | + <div class="user-section-title">' |
| 140 | + . wfMsg( 'user-stats-title' ) . |
| 141 | + '</div> |
138 | 142 | <div class="user-section-actions"> |
139 | 143 | <div class="action-right"> |
140 | 144 | </div> |
— | — | @@ -151,8 +155,9 @@ |
152 | 156 | $this->getUserStatsRow( wfMsgExt( 'user-stats-poll-votes', 'parsemag', $stats_data['poll_votes'] ), $stats_data['poll_votes'] ) . |
153 | 157 | $this->getUserStatsRow( wfMsgExt( 'user-stats-picture-game-votes', 'parsemag', $stats_data['picture_game_votes'] ), $stats_data['picture_game_votes'] ) . |
154 | 158 | $this->getUserStatsRow( wfMsgExt( 'user-stats-quiz-points', 'parsemag', $stats_data['quiz_points'] ), $stats_data['quiz_points'] ); |
155 | | - if ( $stats_data['currency'] != '10,000' ) |
| 159 | + if ( $stats_data['currency'] != '10,000' ) { |
156 | 160 | $output .= $this->getUserStatsRow( wfMsgExt( 'user-stats-pick-points', 'parsemag', $stats_data['currency'] ), $stats_data['currency'] ); |
| 161 | + } |
157 | 162 | $output .= '</div>'; |
158 | 163 | } |
159 | 164 | |
— | — | @@ -219,24 +224,31 @@ |
220 | 225 | $location .= $profile_data['location_country']; |
221 | 226 | } |
222 | 227 | |
223 | | - if ( $location == ', ' ) $location = ''; |
| 228 | + if ( $location == ', ' ) { |
| 229 | + $location = ''; |
| 230 | + } |
224 | 231 | |
225 | 232 | $hometown = $profile_data['hometown_city'] . ', ' . $profile_data['hometown_state']; |
226 | 233 | if ( $profile_data['hometown_country'] != 'United States' ) { |
227 | 234 | $hometown = ''; |
228 | 235 | $hometown .= $profile_data['hometown_country']; |
229 | 236 | } |
230 | | - if ( $hometown == ', ' ) $hometown = ''; |
| 237 | + if ( $hometown == ', ' ) { |
| 238 | + $hometown = ''; |
| 239 | + } |
231 | 240 | |
232 | | - $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']; |
| 241 | + $joined_data = $profile_data['real_name'] . $location . $hometown . |
| 242 | + $profile_data['birthday'] . $profile_data['occupation'] . |
| 243 | + $profile_data['websites'] . $profile_data['places_lived'] . |
| 244 | + $profile_data['schools'] . $profile_data['about']; |
233 | 245 | $edit_info_link = SpecialPage::getTitleFor( 'UpdateProfile' ); |
234 | 246 | |
235 | 247 | $output = ''; |
236 | 248 | if ( $joined_data ) { |
237 | 249 | $output .= '<div class="user-section-heading"> |
238 | | - <div class="user-section-title"> |
239 | | - ' . wfMsg( 'user-personal-info-title' ) . ' |
240 | | - </div> |
| 250 | + <div class="user-section-title">' |
| 251 | + . wfMsg( 'user-personal-info-title' ) . |
| 252 | + '</div> |
241 | 253 | <div class="user-section-actions"> |
242 | 254 | <div class="action-right">'; |
243 | 255 | if ( $wgUser->getName() == $user_name ) { |
— | — | @@ -260,9 +272,9 @@ |
261 | 273 | '</div>'; |
262 | 274 | } elseif ( $wgUser->getName() == $user_name ) { |
263 | 275 | $output .= '<div class="user-section-heading"> |
264 | | - <div class="user-section-title"> |
265 | | - ' . wfMsg( 'user-personal-info-title' ) . ' |
266 | | - </div> |
| 276 | + <div class="user-section-title">' |
| 277 | + . wfMsg( 'user-personal-info-title' ) . |
| 278 | + '</div> |
267 | 279 | <div class="user-section-actions"> |
268 | 280 | <div class="action-right"> |
269 | 281 | <a href="' . $edit_info_link->escapeFullURL() . '">' |
— | — | @@ -273,9 +285,9 @@ |
274 | 286 | </div> |
275 | 287 | </div> |
276 | 288 | <div class="cleared"></div> |
277 | | - <div class="no-info-container"> |
278 | | - ' . wfMsg( 'user-no-personal-info' ) . ' |
279 | | - </div>'; |
| 289 | + <div class="no-info-container">' |
| 290 | + . wfMsg( 'user-no-personal-info' ) . |
| 291 | + '</div>'; |
280 | 292 | } |
281 | 293 | |
282 | 294 | return $output; |
— | — | @@ -294,15 +306,16 @@ |
295 | 307 | } |
296 | 308 | $profile_data = $this->profile_data; |
297 | 309 | |
298 | | - $joined_data = $profile_data['custom_1'] . $profile_data['custom_2'] . $profile_data['custom_3'] . $profile_data['custom_4']; |
| 310 | + $joined_data = $profile_data['custom_1'] . $profile_data['custom_2'] . |
| 311 | + $profile_data['custom_3'] . $profile_data['custom_4']; |
299 | 312 | $edit_info_link = SpecialPage::getTitleFor( 'UpdateProfile' ); |
300 | 313 | |
301 | 314 | $output = ''; |
302 | 315 | if ( $joined_data ) { |
303 | 316 | $output .= '<div class="user-section-heading"> |
304 | | - <div class="user-section-title"> |
305 | | - ' . wfMsg( 'custom-info-title' ) . ' |
306 | | - </div> |
| 317 | + <div class="user-section-title">' |
| 318 | + . wfMsg( 'custom-info-title' ) . |
| 319 | + '</div> |
307 | 320 | <div class="user-section-actions"> |
308 | 321 | <div class="action-right">'; |
309 | 322 | if ( $wgUser->getName() == $user_name ) { |
— | — | @@ -321,22 +334,22 @@ |
322 | 335 | '</div>'; |
323 | 336 | } elseif ( $wgUser->getName() == $user_name ) { |
324 | 337 | $output .= '<div class="user-section-heading"> |
325 | | - <div class="user-section-title"> |
326 | | - ' . wfMsg( 'custom-info-title' ) . ' |
327 | | - </div> |
| 338 | + <div class="user-section-title">' |
| 339 | + . wfMsg( 'custom-info-title' ) . |
| 340 | + '</div> |
328 | 341 | <div class="user-section-actions"> |
329 | 342 | <div class="action-right"> |
330 | | - <a href="' . $edit_info_link->escapeFullURL() . '/custom"> |
331 | | - ' . wfMsg( 'user-edit-this' ) . ' |
332 | | - </a> |
| 343 | + <a href="' . $edit_info_link->escapeFullURL() . '/custom">' |
| 344 | + . wfMsg( 'user-edit-this' ) . |
| 345 | + '</a> |
333 | 346 | </div> |
334 | 347 | <div class="cleared"></div> |
335 | 348 | </div> |
336 | 349 | </div> |
337 | 350 | <div class="cleared"></div> |
338 | | - <div class="no-info-container"> |
339 | | - ' . wfMsg( 'custom-no-info' ) . ' |
340 | | - </div>'; |
| 351 | + <div class="no-info-container">' |
| 352 | + . wfMsg( 'custom-no-info' ) . |
| 353 | + '</div>'; |
341 | 354 | } |
342 | 355 | |
343 | 356 | return $output; |
— | — | @@ -357,16 +370,20 @@ |
358 | 371 | $this->profile_data = $profile->getProfile(); |
359 | 372 | } |
360 | 373 | $profile_data = $this->profile_data; |
361 | | - $joined_data = $profile_data['movies'] . $profile_data['tv'] . $profile_data['music'] . $profile_data['books'] . $profile_data['video_games'] . $profile_data['magazines'] . $profile_data['drinks'] . $profile_data['snacks']; |
| 374 | + $joined_data = $profile_data['movies'] . $profile_data['tv'] . |
| 375 | + $profile_data['music'] . $profile_data['books'] . |
| 376 | + $profile_data['video_games'] . |
| 377 | + $profile_data['magazines'] . $profile_data['drinks'] . |
| 378 | + $profile_data['snacks']; |
362 | 379 | $edit_info_link = SpecialPage::getTitleFor( 'UpdateProfile' ); |
363 | 380 | |
364 | 381 | $output = ''; |
365 | 382 | if ( $joined_data ) { |
366 | 383 | |
367 | 384 | $output .= '<div class="user-section-heading"> |
368 | | - <div class="user-section-title"> |
369 | | - ' . wfMsg( 'other-info-title' ) . ' |
370 | | - </div> |
| 385 | + <div class="user-section-title">' |
| 386 | + . wfMsg( 'other-info-title' ) . |
| 387 | + '</div> |
371 | 388 | <div class="user-section-actions"> |
372 | 389 | <div class="action-right">'; |
373 | 390 | if ( $wgUser->getName() == $user_name ) { |
— | — | @@ -390,9 +407,9 @@ |
391 | 408 | |
392 | 409 | } elseif ( $wgUser->getName() == $user_name ) { |
393 | 410 | $output .= '<div class="user-section-heading"> |
394 | | - <div class="user-section-title"> |
395 | | - ' . wfMsg( 'other-info-title' ) . ' |
396 | | - </div> |
| 411 | + <div class="user-section-title">' |
| 412 | + . wfMsg( 'other-info-title' ) . |
| 413 | + '</div> |
397 | 414 | <div class="user-section-actions"> |
398 | 415 | <div class="action-right"> |
399 | 416 | <a href="' . $edit_info_link->escapeFullURL() . '/personal">' . wfMsg( 'user-edit-this' ) . '</a> |
— | — | @@ -401,9 +418,9 @@ |
402 | 419 | </div> |
403 | 420 | </div> |
404 | 421 | <div class="cleared"></div> |
405 | | - <div class="no-info-container"> |
406 | | - ' . wfMsg( 'other-no-info' ) . ' |
407 | | - </div>'; |
| 422 | + <div class="no-info-container">' |
| 423 | + . wfMsg( 'other-no-info' ) . |
| 424 | + '</div>'; |
408 | 425 | } |
409 | 426 | return $output; |
410 | 427 | } |
— | — | @@ -644,13 +661,17 @@ |
645 | 662 | |
646 | 663 | // Chop down username that gets displayed |
647 | 664 | $user_name = mb_substr( $friend['user_name'], 0, 9 ); |
648 | | - if ( $user_name != $friend['user_name'] ) $user_name .= '..'; |
| 665 | + if ( $user_name != $friend['user_name'] ) { |
| 666 | + $user_name .= '..'; |
| 667 | + } |
649 | 668 | |
650 | 669 | $output .= "<a href=\"" . $user->escapeFullURL() . "\" title=\"{$friend["user_name"]}\" rel=\"nofollow\"> |
651 | 670 | {$avatar_img}<br /> |
652 | 671 | {$user_name} |
653 | 672 | </a>"; |
654 | | - if ( $x == count( $friends ) || $x != 1 && $x % $per_row == 0 ) $output .= '<div class="cleared"></div>'; |
| 673 | + if ( $x == count( $friends ) || $x != 1 && $x % $per_row == 0 ) { |
| 674 | + $output .= '<div class="cleared"></div>'; |
| 675 | + } |
655 | 676 | $x++; |
656 | 677 | } |
657 | 678 | $output .= '</div>'; |
— | — | @@ -686,9 +707,9 @@ |
687 | 708 | |
688 | 709 | if ( $activity ) { |
689 | 710 | $output .= '<div class="user-section-heading"> |
690 | | - <div class="user-section-title"> |
691 | | - ' . wfMsg( 'user-recent-activity-title' ) . ' |
692 | | - </div> |
| 711 | + <div class="user-section-title">' |
| 712 | + . wfMsg( 'user-recent-activity-title' ) . |
| 713 | + '</div> |
693 | 714 | <div class="user-section-actions"> |
694 | 715 | <div class="action-right"> |
695 | 716 | </div> |
— | — | @@ -711,12 +732,14 @@ |
712 | 733 | $user_title = Title::makeTitle( NS_USER, $item['username'] ); |
713 | 734 | $user_title_2 = Title::makeTitle( NS_USER, $item['comment'] ); |
714 | 735 | |
715 | | - if ( $user_title_2 ) |
| 736 | + if ( $user_title_2 ) { |
716 | 737 | $user_link_2 = '<a href="' . $user_title_2->escapeFullURL() . '" rel="nofollow">' . $item['comment'] . '</a>'; |
| 738 | + } |
717 | 739 | |
718 | 740 | $comment_url = ''; |
719 | | - if ( $item['type'] == 'comment' ) |
| 741 | + if ( $item['type'] == 'comment' ) { |
720 | 742 | $comment_url = "#comment-{$item["id"]}"; |
| 743 | + } |
721 | 744 | |
722 | 745 | $page_link = '<b><a href="' . $title->escapeFullURL() . "{$comment_url}\">" . $title->getPrefixedText() . '</a></b> '; |
723 | 746 | $b = new UserBoard(); // Easier than porting the time-related functions here |
— | — | @@ -792,14 +815,6 @@ |
793 | 816 | \"{$item["namespace"]}\" |
794 | 817 | </div>"; |
795 | 818 | break; |
796 | | - /*case 'network_update': |
797 | | - $page_link = '' . $item['network'] . '</a> '; |
798 | | - $network_image = SportsTeams::getLogo( $item['sport_id'], $item['team_id'], 's' ); |
799 | | - $item_html .= wfMsg( 'user-recent-activity-network-update' ) . ' |
800 | | - <div class="item"> |
801 | | - <a href="' . SportsTeams::getNetworkURL( $item['sport_id'], $item['team_id'] ) . "\" rel=\"nofollow\">{$network_image} \"{$item["comment"]}\"</a> |
802 | | - </div>"; |
803 | | - break;*/ |
804 | 819 | } |
805 | 820 | |
806 | 821 | $item_html .= '</div>'; |
— | — | @@ -874,13 +889,6 @@ |
875 | 890 | } |
876 | 891 | } |
877 | 892 | |
878 | | - /*$by_type = ''; |
879 | | - if( isset( $items_html_type['network_update'] ) && is_array( $items_html_type['network_update'] ) ) { |
880 | | - foreach( $items_html_type['network_update'] as $item ){ |
881 | | - $by_type .= $item; |
882 | | - } |
883 | | - }*/ |
884 | | - |
885 | 893 | } |
886 | 894 | |
887 | 895 | return $output; |
— | — | @@ -921,16 +929,15 @@ |
922 | 930 | $per_row = 4; |
923 | 931 | |
924 | 932 | if ( $gifts ) { |
925 | | - |
926 | 933 | $output .= '<div class="user-section-heading"> |
927 | 934 | <div class="user-section-title"> |
928 | 935 | ' . wfMsg( 'user-gifts-title' ) . ' |
929 | 936 | </div> |
930 | 937 | <div class="user-section-actions"> |
931 | 938 | <div class="action-right">'; |
932 | | - if ( $gift_count > 4 ) { |
933 | | - $output .= '<a href="' . $gift_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
934 | | - } |
| 939 | + if ( $gift_count > 4 ) { |
| 940 | + $output .= '<a href="' . $gift_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
| 941 | + } |
935 | 942 | $output .= '</div> |
936 | 943 | <div class="action-left">'; |
937 | 944 | if ( $gift_count > 4 ) { |
— | — | @@ -948,7 +955,6 @@ |
949 | 956 | $x = 1; |
950 | 957 | |
951 | 958 | foreach ( $gifts as $gift ) { |
952 | | - |
953 | 959 | if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) { |
954 | 960 | $g->clearUserGiftStatus( $gift['id'] ); |
955 | 961 | $wgMemc->delete( $key ); |
— | — | @@ -1008,14 +1014,14 @@ |
1009 | 1015 | $x = 1; |
1010 | 1016 | |
1011 | 1017 | $output .= '<div class="user-section-heading"> |
1012 | | - <div class="user-section-title"> |
1013 | | - ' . wfMsg( 'user-awards-title' ) . ' |
1014 | | - </div> |
| 1018 | + <div class="user-section-title">' |
| 1019 | + . wfMsg( 'user-awards-title' ) . |
| 1020 | + '</div> |
1015 | 1021 | <div class="user-section-actions"> |
1016 | 1022 | <div class="action-right">'; |
1017 | | - if ( $system_gift_count > 4 ) { |
1018 | | - $output .= '<a href="' . $system_gift_link->escapeFullURL( 'user=' . $user_name ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
1019 | | - } |
| 1023 | + if ( $system_gift_count > 4 ) { |
| 1024 | + $output .= '<a href="' . $system_gift_link->escapeFullURL( 'user=' . $user_name ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>'; |
| 1025 | + } |
1020 | 1026 | $output .= '</div> |
1021 | 1027 | <div class="action-left">'; |
1022 | 1028 | if ( $system_gift_count > 4 ) { |
— | — | @@ -1031,7 +1037,6 @@ |
1032 | 1038 | <div class="user-gift-container">'; |
1033 | 1039 | |
1034 | 1040 | foreach ( $system_gifts as $gift ) { |
1035 | | - |
1036 | 1041 | if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) { |
1037 | 1042 | $sg->clearUserGiftStatus( $gift['id'] ); |
1038 | 1043 | $wgMemc->delete( $sg_key ); |
— | — | @@ -1091,9 +1096,9 @@ |
1092 | 1097 | } |
1093 | 1098 | |
1094 | 1099 | $output .= '<div class="user-section-heading"> |
1095 | | - <div class="user-section-title"> |
1096 | | - ' . wfMsg( 'user-board-title' ) . ' |
1097 | | - </div> |
| 1100 | + <div class="user-section-title">' |
| 1101 | + . wfMsg( 'user-board-title' ) . |
| 1102 | + '</div> |
1098 | 1103 | <div class="user-section-actions"> |
1099 | 1104 | <div class="action-right">'; |
1100 | 1105 | if ( $wgUser->getName() == $user_name ) { |
— | — | @@ -1138,9 +1143,9 @@ |
1139 | 1144 | </div>'; |
1140 | 1145 | } else { |
1141 | 1146 | $login_link = SpecialPage::getTitleFor( 'Userlogin' ); |
1142 | | - $output .= '<div class="user-page-message-form"> |
1143 | | - ' . wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ) . ' |
1144 | | - </div>'; |
| 1147 | + $output .= '<div class="user-page-message-form">' |
| 1148 | + . wfMsg( 'user-board-login-message', $login_link->escapeFullURL() ) . |
| 1149 | + '</div>'; |
1145 | 1150 | } |
1146 | 1151 | } |
1147 | 1152 | $output .= '<div id="user-page-board">'; |
— | — | @@ -1192,11 +1197,10 @@ |
1193 | 1198 | $per_row = 1; |
1194 | 1199 | |
1195 | 1200 | if ( $fanboxes ) { |
1196 | | - |
1197 | 1201 | $output .= '<div class="user-section-heading"> |
1198 | | - <div class="user-section-title"> |
1199 | | - ' . wfMsg( 'user-fanbox-title' ) . ' |
1200 | | - </div> |
| 1202 | + <div class="user-section-title">' |
| 1203 | + . wfMsg( 'user-fanbox-title' ) . |
| 1204 | + '</div> |
1201 | 1205 | <div class="user-section-actions"> |
1202 | 1206 | <div class="action-right">'; |
1203 | 1207 | if ( $fanbox_count > 10 ) { |