r85137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85136‎ | r85137 | r85138 >
Date:17:18, 1 April 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: indentation tweaks, broke some looooooong lines, added documentation, removed a couple unused $user_safe variables in UserProfile/UserProfilePage.php
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -41,7 +41,7 @@
4242
4343 $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
4444
45 - # No need to display noarticletext, we use our own message
 45+ // No need to display noarticletext, we use our own message
4646 if ( !$this->user_id ) {
4747 parent::view();
4848 return '';
@@ -51,8 +51,14 @@
5252 $wgOut->addHTML( $this->getProfileTop( $this->user_id, $this->user_name ) );
5353 $wgOut->addHTML( '<div class="cleared"></div></div>' );
5454
55 - // User does not want social profile for User:user_name, so we just show header + page content
56 - if ( $wgTitle->getNamespace() == NS_USER && $this->profile_data['user_id'] && $this->profile_data['user_page_type'] == 0 ) {
 55+ // User does not want social profile for User:user_name, so we just
 56+ // show header + page content
 57+ if (
 58+ $wgTitle->getNamespace() == NS_USER &&
 59+ $this->profile_data['user_id'] &&
 60+ $this->profile_data['user_page_type'] == 0
 61+ )
 62+ {
5763 parent::view();
5864 return '';
5965 }
@@ -211,6 +217,7 @@
212218
213219 $defaultCountry = wfMsgForContent( 'user-profile-default-country' );
214220
 221+ // Current location
215222 $location = $profile_data['location_city'] . ', ' . $profile_data['location_state'];
216223 if ( $profile_data['location_country'] != $defaultCountry ) {
217224 if ( $profile_data['location_city'] && $profile_data['location_state'] ) { // city AND state
@@ -231,6 +238,7 @@
232239 $location = '';
233240 }
234241
 242+ // Hometown
235243 $hometown = $profile_data['hometown_city'] . ', ' . $profile_data['hometown_state'];
236244 if ( $profile_data['hometown_country'] != $defaultCountry ) {
237245 if ( $profile_data['hometown_city'] && $profile_data['hometown_state'] ) { // city AND state
@@ -265,10 +273,11 @@
266274 '</div>
267275 <div class="user-section-actions">
268276 <div class="action-right">';
269 - if ( $wgUser->getName() == $user_name ) {
270 - $output .= '<a href="' . $edit_info_link->escapeFullURL() . '">' . wfMsg( 'user-edit-this' ) . '</a>';
271 - }
272 - $output .= '</div>
 277+ if ( $wgUser->getName() == $user_name ) {
 278+ $output .= '<a href="' . $edit_info_link->escapeFullURL() . '">' .
 279+ wfMsg( 'user-edit-this' ) . '</a>';
 280+ }
 281+ $output .= '</div>
273282 <div class="cleared"></div>
274283 </div>
275284 </div>
@@ -307,6 +316,12 @@
308317 return $output;
309318 }
310319
 320+ /**
 321+ * Get the custom info (site-specific stuff) for a given user.
 322+ *
 323+ * @param $user_name String: user name whose custom info we should fetch
 324+ * @return String: HTML
 325+ */
311326 function getCustomInfo( $user_name ) {
312327 global $wgUser, $wgUserProfileDisplay;
313328
@@ -318,6 +333,7 @@
319334 $profile = new UserProfile( $user_name );
320335 $this->profile_data = $profile->getProfile();
321336 }
 337+
322338 $profile_data = $this->profile_data;
323339
324340 $joined_data = $profile_data['custom_1'] . $profile_data['custom_2'] .
@@ -332,10 +348,11 @@
333349 '</div>
334350 <div class="user-section-actions">
335351 <div class="action-right">';
336 - if ( $wgUser->getName() == $user_name ) {
337 - $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/custom">' . wfMsg( 'user-edit-this' ) . '</a>';
338 - }
339 - $output .= '</div>
 352+ if ( $wgUser->getName() == $user_name ) {
 353+ $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/custom">' .
 354+ wfMsg( 'user-edit-this' ) . '</a>';
 355+ }
 356+ $output .= '</div>
340357 <div class="cleared"></div>
341358 </div>
342359 </div>
@@ -369,6 +386,13 @@
370387 return $output;
371388 }
372389
 390+ /**
 391+ * Get the interests (favorite movies, TV shows, music, etc.) for a given
 392+ * user.
 393+ *
 394+ * @param $user_name String: user name whose interests we should fetch
 395+ * @return String: HTML
 396+ */
373397 function getInterests( $user_name ) {
374398 global $wgUser, $wgUserProfileDisplay;
375399
@@ -380,6 +404,7 @@
381405 $profile = new UserProfile( $user_name );
382406 $this->profile_data = $profile->getProfile();
383407 }
 408+
384409 $profile_data = $this->profile_data;
385410 $joined_data = $profile_data['movies'] . $profile_data['tv'] .
386411 $profile_data['music'] . $profile_data['books'] .
@@ -390,17 +415,17 @@
391416
392417 $output = '';
393418 if ( $joined_data ) {
394 -
395419 $output .= '<div class="user-section-heading">
396420 <div class="user-section-title">'
397421 . wfMsg( 'other-info-title' ) .
398422 '</div>
399423 <div class="user-section-actions">
400424 <div class="action-right">';
401 - if ( $wgUser->getName() == $user_name ) {
402 - $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/personal">' . wfMsg( 'user-edit-this' ) . '</a>';
403 - }
404 - $output .= '</div>
 425+ if ( $wgUser->getName() == $user_name ) {
 426+ $output .= '<a href="' . $edit_info_link->escapeFullURL() . '/personal">' .
 427+ wfMsg( 'user-edit-this' ) . '</a>';
 428+ }
 429+ $output .= '</div>
405430 <div class="cleared"></div>
406431 </div>
407432 </div>
@@ -415,7 +440,6 @@
416441 $this->getProfileSection( wfMsg( 'other-info-snacks' ), $profile_data['snacks'], false ) .
417442 $this->getProfileSection( wfMsg( 'other-info-drinks' ), $profile_data['drinks'], false ) .
418443 '</div>';
419 -
420444 } elseif ( $wgUser->getName() == $user_name ) {
421445 $output .= '<div class="user-section-heading">
422446 <div class="user-section-title">'
@@ -436,8 +460,17 @@
437461 return $output;
438462 }
439463
 464+ /**
 465+ * Get the header for the social profile page, which includes the user's
 466+ * points and user level (if enabled in the site configuration) and lots
 467+ * more.
 468+ *
 469+ * @param $user_id Integer: user ID
 470+ * @param $user_name String: user name
 471+ */
440472 function getProfileTop( $user_id, $user_name ) {
441473 global $wgTitle, $wgUser, $wgUploadPath, $wgLang;
 474+ global $wgUserLevels;
442475
443476 $stats = new UserStats( $user_id, $user_name );
444477 $stats_data = $stats->getUserStats();
@@ -476,14 +509,19 @@
477510 }
478511 $avatar = new wAvatar( $this->user_id, 'l' );
479512
480 - wfDebug( "profile type" . $profile_data['user_page_type'] . "\n" );
 513+ wfDebug( 'profile type: ' . $profile_data['user_page_type'] . "\n" );
481514 $output = '';
 515+
482516 if ( $this->isOwner() ) {
483517 $toggle_title = SpecialPage::getTitleFor( 'ToggleUserPage' );
 518+ if ( $this->profile_data['user_page_type'] == 1 ) {
 519+ $toggleMessage = wfMsg( 'user-type-toggle-old' );
 520+ } else {
 521+ $toggleMessage = wfMsg( 'user-type-toggle-new' );
 522+ }
484523 $output .= '<div id="profile-toggle-button">
485 - <a href="' . $toggle_title->escapeFullURL() . '" rel="nofollow">'
486 - . ( ( $this->profile_data['user_page_type'] == 1 ) ? wfMsg( 'user-type-toggle-old' ) : wfMsg( 'user-type-toggle-new' ) ) .
487 - '</a>
 524+ <a href="' . $toggle_title->escapeFullURL() . '" rel="nofollow">' .
 525+ $toggleMessage . '</a>
488526 </div>';
489527 }
490528
@@ -493,20 +531,21 @@
494532
495533 $output .= '<div id="profile-right">';
496534
497 - $output .= '<div id="profile-title-container">
498 - <div id="profile-title">
499 - ' . $user_name . '
500 - </div>';
501 - global $wgUserLevels;
502 - if ( $wgUserLevels ) {
503 - $output .= '<div id="points-level">
504 - <a href="' . $level_link->escapeFullURL() . '">' . wfMsgExt( 'user-profile-points', 'parsemag', $stats_data['points'] ) . '</a>
 535+ $output .= '<div id="profile-title-container">
 536+ <div id="profile-title">' .
 537+ $user_name .
 538+ '</div>';
 539+ if ( $wgUserLevels ) {
 540+ $output .= '<div id="points-level">
 541+ <a href="' . $level_link->escapeFullURL() . '">' .
 542+ wfMsgExt( 'user-profile-points', 'parsemag', $stats_data['points'] ) .
 543+ '</a>
505544 </div>
506545 <div id="honorific-level">
507546 <a href="' . $level_link->escapeFullURL() . '" rel="nofollow">(' . $user_level->getLevelName() . ')</a>
508547 </div>';
509 - }
510 - $output .= '<div class="cleared"></div>
 548+ }
 549+ $output .= '<div class="cleared"></div>
511550 </div>
512551 <div class="profile-actions">';
513552
@@ -575,22 +614,37 @@
576615 global $wgUser, $wgUploadPath;
577616
578617 $avatar = new wAvatar( $this->user_id, 'l' );
579 - $avatar_title = SpecialPage::getTitleFor( 'UploadAvatar' );
 618+ $avatarTitle = SpecialPage::getTitleFor( 'UploadAvatar' );
580619
581620 $output .= '<div class="profile-image">';
582 - if ( $wgUser->getName() == $this->user_name ) {
583 - $output .= '<a href="' . $avatar->escapeFullURL() . '" rel="nofollow">
584 - <img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" /><br />
585 - (' . ( ( strpos( $avatar->getAvatarImage(), 'default_' ) != false ) ? 'upload image' : 'new image' ) . ')
586 - </a>';
 621+ if ( $wgUser->getName() == $this->user_name ) {
 622+ if ( strpos( $avatar->getAvatarImage(), 'default_' ) != false ) {
 623+ $caption = 'upload image';
587624 } else {
588 - $output .= '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 625+ $caption = 'new image';
589626 }
 627+ $output .= '<a href="' . $avatarTitle->escapeFullURL() . '" rel="nofollow">
 628+ <img src="' . $wgUploadPath . '/avatars/' .
 629+ $avatar->getAvatarImage() . '" alt="" border="0" /><br />
 630+ (' . $caption . ')
 631+ </a>';
 632+ } else {
 633+ $output .= '<img src="' . $wgUploadPath . '/avatars/' .
 634+ $avatar->getAvatarImage() . '" alt="" border="0" />';
 635+ }
590636 $output .= '</div>';
591637
592638 return $output;
593639 }
594640
 641+ /**
 642+ * Get the relationships for a given user.
 643+ *
 644+ * @param $user_name String: name of the user whose relationships we want
 645+ * to fetch
 646+ * @param $rel_type Integer: 1 for friends, 2 (or anything else than 1) for
 647+ * foes
 648+ */
595649 function getRelationships( $user_name, $rel_type ) {
596650 global $wgMemc, $wgUser, $wgUserProfileDisplay, $wgUploadPath;
597651
@@ -623,7 +677,6 @@
624678
625679 $stats = new UserStats( $rel->user_id, $user_name );
626680 $stats_data = $stats->getUserStats();
627 - $user_safe = urlencode( $user_name );
628681 $view_all_title = SpecialPage::getTitleFor( 'ViewRelationships' );
629682
630683 if ( $rel_type == 1 ) {
@@ -642,51 +695,57 @@
643696 <div class="user-section-title">' . $relationship_title . '</div>
644697 <div class="user-section-actions">
645698 <div class="action-right">';
646 - if ( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) {
647 - $output .= '<a href="' . $view_all_title->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
648 - }
649 - $output .= '</div>
 699+ if ( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) {
 700+ $output .= '<a href="' . $view_all_title->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type ) .
 701+ '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
 702+ }
 703+ $output .= '</div>
650704 <div class="action-left">';
651 - if ( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) {
652 - $output .= wfMsg( 'user-count-separator', $per_row, $relationship_count );
653 - } else {
654 - $output .= wfMsg( 'user-count-separator', $relationship_count, $relationship_count );
655 - }
656 - $output .= '</div>
 705+ if ( intval( str_replace( ',', '', $relationship_count ) ) > 4 ) {
 706+ $output .= wfMsg( 'user-count-separator', $per_row, $relationship_count );
 707+ } else {
 708+ $output .= wfMsg( 'user-count-separator', $relationship_count, $relationship_count );
 709+ }
 710+ $output .= '</div>
657711 </div>
658712 <div class="cleared"></div>
659713 </div>
660714 <div class="cleared"></div>
661715 <div class="user-relationship-container">';
662716
663 - foreach ( $friends as $friend ) {
664 - $user = Title::makeTitle( NS_USER, $friend['user_name'] );
665 - $avatar = new wAvatar( $friend['user_id'], 'ml' );
666 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 717+ foreach ( $friends as $friend ) {
 718+ $user = Title::makeTitle( NS_USER, $friend['user_name'] );
 719+ $avatar = new wAvatar( $friend['user_id'], 'ml' );
 720+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
667721
668 - // Chop down username that gets displayed
669 - $user_name = mb_substr( $friend['user_name'], 0, 9 );
670 - if ( $user_name != $friend['user_name'] ) {
671 - $user_name .= '..';
672 - }
 722+ // Chop down username that gets displayed
 723+ $user_name = mb_substr( $friend['user_name'], 0, 9 );
 724+ if ( $user_name != $friend['user_name'] ) {
 725+ $user_name .= '..';
 726+ }
673727
674 - $output .= "<a href=\"" . $user->escapeFullURL() . "\" title=\"{$friend["user_name"]}\" rel=\"nofollow\">
675 - {$avatar_img}<br />
676 - {$user_name}
677 - </a>";
678 - if ( $x == count( $friends ) || $x != 1 && $x % $per_row == 0 ) {
679 - $output .= '<div class="cleared"></div>';
680 - }
681 - $x++;
 728+ $output .= "<a href=\"" . $user->escapeFullURL() . "\" title=\"{$friend['user_name']}\" rel=\"nofollow\">
 729+ {$avatar_img}<br />
 730+ {$user_name}
 731+ </a>";
 732+
 733+ if ( $x == count( $friends ) || $x != 1 && $x % $per_row == 0 ) {
 734+ $output .= '<div class="cleared"></div>';
682735 }
 736+
 737+ $x++;
 738+ }
 739+
683740 $output .= '</div>';
684741 }
 742+
685743 return $output;
686744 }
687745
688746 /**
689 - * Gets the recent social activity related to the current user
690 - * @param $user_name Mixed: name of the user whose activity we want to fetch
 747+ * Gets the recent social activity for a given user.
 748+ *
 749+ * @param $user_name String: name of the user whose activity we want to fetch
691750 */
692751 function getActivity( $user_name ) {
693752 global $wgUser, $wgUserProfileDisplay, $wgScriptPath, $wgUploadPath;
@@ -736,33 +795,40 @@
737796 $user_title_2 = Title::makeTitle( NS_USER, $item['comment'] );
738797
739798 if ( $user_title_2 ) {
740 - $user_link_2 = '<a href="' . $user_title_2->escapeFullURL() . '" rel="nofollow">' . $item['comment'] . '</a>';
 799+ $user_link_2 = '<a href="' . $user_title_2->escapeFullURL() .
 800+ '" rel="nofollow">' . $item['comment'] . '</a>';
741801 }
742802
743803 $comment_url = '';
744804 if ( $item['type'] == 'comment' ) {
745 - $comment_url = "#comment-{$item["id"]}";
 805+ $comment_url = "#comment-{$item['id']}";
746806 }
747807
748 - $page_link = '<b><a href="' . $title->escapeFullURL() . "{$comment_url}\">" . $title->getPrefixedText() . '</a></b> ';
 808+ $page_link = '<b><a href="' . $title->escapeFullURL() .
 809+ "{$comment_url}\">" . $title->getPrefixedText() . '</a></b> ';
749810 $b = new UserBoard(); // Easier than porting the time-related functions here
750 - $item_time = '<span class="item-small">' . wfMsg( 'user-time-ago', $b->getTimeAgo( $item['timestamp'] ) ) . '</span>';
 811+ $item_time = '<span class="item-small">' .
 812+ wfMsg( 'user-time-ago', $b->getTimeAgo( $item['timestamp'] ) ) .
 813+ '</span>';
751814
752815 if ( $x < $style_limit ) {
753816 $item_html .= '<div class="activity-item">
754 - <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/' . UserActivity::getTypeIcon( $item['type'] ) . '" alt="" border="0" />';
 817+ <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/' .
 818+ UserActivity::getTypeIcon( $item['type'] ) . '" alt="" border="0" />';
755819 } else {
756820 $item_html .= '<div class="activity-item-bottom">
757 - <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/' . UserActivity::getTypeIcon( $item['type'] ) . '" alt="" border="0" />';
 821+ <img src="' . $wgScriptPath . '/extensions/SocialProfile/images/' .
 822+ UserActivity::getTypeIcon( $item['type'] ) . '" alt="" border="0" />';
758823 }
759824
760825 switch( $item['type'] ) {
761826 case 'edit':
762827 $item_html .= wfMsg( 'user-recent-activity-edit' ) . " {$page_link} {$item_time}
763828 <div class=\"item\">";
764 - if ( $item['comment'] )
765 - $item_html .= "\"{$item["comment"]}\"";
766 - $item_html .= '</div>';
 829+ if ( $item['comment'] ) {
 830+ $item_html .= "\"{$item['comment']}\"";
 831+ }
 832+ $item_html .= '</div>';
767833 break;
768834 case 'vote':
769835 $item_html .= wfMsg( 'user-recent-activity-vote' ) . " {$page_link} {$item_time}";
@@ -770,36 +836,42 @@
771837 case 'comment':
772838 $item_html .= wfMsg( 'user-recent-activity-comment' ) . " {$page_link} {$item_time}
773839 <div class=\"item\">
774 - \"{$item["comment"]}\"
 840+ \"{$item['comment']}\"
775841 </div>";
776842 break;
777843 case 'gift-sent':
778 - $gift_image = "<img src=\"{$wgUploadPath}/awards/" . Gifts::getGiftImage( $item['namespace'], 'm' ) . "\" border=\"0\" alt=\"\" />";
 844+ $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
 845+ Gifts::getGiftImage( $item['namespace'], 'm' ) .
 846+ "\" border=\"0\" alt=\"\" />";
779847 $item_html .= wfMsg( 'user-recent-activity-gift-sent' ) . " {$user_link_2} {$item_time}
780848 <div class=\"item\">
781 - <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item["id"]}\" rel=\"nofollow\">
 849+ <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item['id']}\" rel=\"nofollow\">
782850 {$gift_image}
783 - {$item["pagetitle"]}
 851+ {$item['pagetitle']}
784852 </a>
785853 </div>";
786854 break;
787855 case 'gift-rec':
788 - $gift_image = "<img src=\"{$wgUploadPath}/awards/" . Gifts::getGiftImage( $item['namespace'], 'm' ) . "\" border=\"0\" alt=\"\" />";
 856+ $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
 857+ Gifts::getGiftImage( $item['namespace'], 'm' ) .
 858+ "\" border=\"0\" alt=\"\" />";
789859 $item_html .= wfMsg( 'user-recent-activity-gift-rec' ) . " {$user_link_2} {$item_time}</span>
790860 <div class=\"item\">
791 - <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item["id"]}\" rel=\"nofollow\">
 861+ <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewGift&gift_id={$item['id']}\" rel=\"nofollow\">
792862 {$gift_image}
793863 {$item["pagetitle"]}
794864 </a>
795865 </div>";
796866 break;
797867 case 'system_gift':
798 - $gift_image = "<img src=\"{$wgUploadPath}/awards/" . SystemGifts::getGiftImage( $item['namespace'], 'm' ) . "\" border=\"0\" alt=\"\" />";
 868+ $gift_image = "<img src=\"{$wgUploadPath}/awards/" .
 869+ SystemGifts::getGiftImage( $item['namespace'], 'm' ) .
 870+ "\" border=\"0\" alt=\"\" />";
799871 $item_html .= wfMsg( 'user-recent-system-gift' ) . " {$item_time}
800872 <div class=\"user-home-item-gift\">
801 - <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewSystemGift&gift_id={$item["id"]}\" rel=\"nofollow\">
 873+ <a href=\"" . $wgScriptPath . "/index.php?title=Special:ViewSystemGift&gift_id={$item['id']}\" rel=\"nofollow\">
802874 {$gift_image}
803 - {$item["pagetitle"]}
 875+ {$item['pagetitle']}
804876 </a>
805877 </div>";
806878 break;
@@ -810,12 +882,14 @@
811883 $item_html .= wfMsg( 'user-recent-activity-foe' ) . " <b>{$user_link_2}</b> {$item_time}";
812884 break;
813885 case 'system_message':
814 - $item_html .= "{$item["comment"]} {$item_time}";
 886+ $item_html .= "{$item['comment']} {$item_time}";
815887 break;
816888 case 'user_message':
817 - $item_html .= wfMsg( 'user-recent-activity-user-message' ) . " <b><a href=\"" . UserBoard::getUserBoardURL( $user_title_2->getText() ) . "\" rel=\"nofollow\">{$item["comment"]}</a></b> {$item_time}
 889+ $item_html .= wfMsg( 'user-recent-activity-user-message' ) .
 890+ " <b><a href=\"" . UserBoard::getUserBoardURL( $user_title_2->getText() ) .
 891+ "\" rel=\"nofollow\">{$item['comment']}</a></b> {$item_time}
818892 <div class=\"item\">
819 - \"{$item["namespace"]}\"
 893+ \"{$item['namespace']}\"
820894 </div>";
821895 break;
822896 }
@@ -930,48 +1004,56 @@
9311005
9321006 if ( $gifts ) {
9331007 $output .= '<div class="user-section-heading">
934 - <div class="user-section-title">
935 - ' . wfMsg( 'user-gifts-title' ) . '
936 - </div>
 1008+ <div class="user-section-title">' .
 1009+ wfMsg( 'user-gifts-title' ) .
 1010+ '</div>
9371011 <div class="user-section-actions">
9381012 <div class="action-right">';
939 - if ( $gift_count > 4 ) {
940 - $output .= '<a href="' . $gift_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
941 - }
942 - $output .= '</div>
 1013+ if ( $gift_count > 4 ) {
 1014+ $output .= '<a href="' . $gift_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' .
 1015+ wfMsg( 'user-view-all' ) . '</a>';
 1016+ }
 1017+ $output .= '</div>
9431018 <div class="action-left">';
944 - if ( $gift_count > 4 ) {
945 - $output .= wfMsg( 'user-count-separator', '4', $gift_count );
946 - } else {
947 - $output .= wfMsg( 'user-count-separator', $gift_count, $gift_count );
948 - }
949 - $output .= '</div>
 1019+ if ( $gift_count > 4 ) {
 1020+ $output .= wfMsg( 'user-count-separator', '4', $gift_count );
 1021+ } else {
 1022+ $output .= wfMsg( 'user-count-separator', $gift_count, $gift_count );
 1023+ }
 1024+ $output .= '</div>
9501025 <div class="cleared"></div>
9511026 </div>
9521027 </div>
9531028 <div class="cleared"></div>
9541029 <div class="user-gift-container">';
9551030
956 - $x = 1;
 1031+ $x = 1;
9571032
958 - foreach ( $gifts as $gift ) {
959 - if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) {
960 - $g->clearUserGiftStatus( $gift['id'] );
961 - $wgMemc->delete( $key );
962 - $g->decNewGiftCount( $wgUser->getID() );
963 - }
 1033+ foreach ( $gifts as $gift ) {
 1034+ if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) {
 1035+ $g->clearUserGiftStatus( $gift['id'] );
 1036+ $wgMemc->delete( $key );
 1037+ $g->decNewGiftCount( $wgUser->getID() );
 1038+ }
9641039
965 - $user = Title::makeTitle( NS_USER, $gift['user_name_from'] );
966 - $gift_image = '<img src="' . $wgUploadPath . '/awards/' . Gifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />';
967 - $gift_link = $user = SpecialPage::getTitleFor( 'ViewGift' );
968 - $output .= '<a href="' . $gift_link->escapeFullURL( 'gift_id=' . $gift['id'] ) . '" ' . ( ( $gift['status'] == 1 ) ? 'class="user-page-new"' : '' ) . " rel=\"nofollow\">{$gift_image}</a>";
969 - if ( $x == count( $gifts ) || $x != 1 && $x % $per_row == 0 ) {
970 - $output .= '<div class="cleared"></div>';
971 - }
972 - $x++;
973 -
 1040+ $user = Title::makeTitle( NS_USER, $gift['user_name_from'] );
 1041+ $gift_image = '<img src="' . $wgUploadPath . '/awards/' .
 1042+ Gifts::getGiftImage( $gift['gift_id'], 'ml' ) .
 1043+ '" border="0" alt="" />';
 1044+ $gift_link = $user = SpecialPage::getTitleFor( 'ViewGift' );
 1045+ $class = '';
 1046+ if ( $gift['status'] == 1 ) {
 1047+ $class = 'class="user-page-new"';
9741048 }
 1049+ $output .= '<a href="' . $gift_link->escapeFullURL( 'gift_id=' . $gift['id'] ) . '" ' .
 1050+ $class . " rel=\"nofollow\">{$gift_image}</a>";
 1051+ if ( $x == count( $gifts ) || $x != 1 && $x % $per_row == 0 ) {
 1052+ $output .= '<div class="cleared"></div>';
 1053+ }
9751054
 1055+ $x++;
 1056+ }
 1057+
9761058 $output .= '</div>';
9771059 }
9781060
@@ -1016,42 +1098,50 @@
10171099 '</div>
10181100 <div class="user-section-actions">
10191101 <div class="action-right">';
1020 - if ( $system_gift_count > 4 ) {
1021 - $output .= '<a href="' . $system_gift_link->escapeFullURL( 'user=' . $user_name ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
1022 - }
1023 - $output .= '</div>
 1102+ if ( $system_gift_count > 4 ) {
 1103+ $output .= '<a href="' . $system_gift_link->escapeFullURL( 'user=' . $user_name ) . '" rel="nofollow">' .
 1104+ wfMsg( 'user-view-all' ) . '</a>';
 1105+ }
 1106+ $output .= '</div>
10241107 <div class="action-left">';
1025 - if ( $system_gift_count > 4 ) {
1026 - $output .= wfMsg( 'user-count-separator', '4', $system_gift_count );
1027 - } else {
1028 - $output .= wfMsg( 'user-count-separator', $system_gift_count, $system_gift_count );
1029 - }
1030 - $output .= '</div>
 1108+ if ( $system_gift_count > 4 ) {
 1109+ $output .= wfMsg( 'user-count-separator', '4', $system_gift_count );
 1110+ } else {
 1111+ $output .= wfMsg( 'user-count-separator', $system_gift_count, $system_gift_count );
 1112+ }
 1113+ $output .= '</div>
10311114 <div class="cleared"></div>
10321115 </div>
10331116 </div>
10341117 <div class="cleared"></div>
10351118 <div class="user-gift-container">';
10361119
1037 - foreach ( $system_gifts as $gift ) {
1038 - if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) {
1039 - $sg->clearUserGiftStatus( $gift['id'] );
1040 - $wgMemc->delete( $sg_key );
1041 - $sg->decNewSystemGiftCount( $wgUser->getID() );
1042 - }
 1120+ foreach ( $system_gifts as $gift ) {
 1121+ if ( $gift['status'] == 1 && $user_name == $wgUser->getName() ) {
 1122+ $sg->clearUserGiftStatus( $gift['id'] );
 1123+ $wgMemc->delete( $sg_key );
 1124+ $sg->decNewSystemGiftCount( $wgUser->getID() );
 1125+ }
10431126
1044 - $gift_image = '<img src="' . $wgUploadPath . '/awards/' . SystemGifts::getGiftImage( $gift['gift_id'], 'ml' ) . '" border="0" alt="" />';
1045 - $gift_link = $user = SpecialPage::getTitleFor( 'ViewSystemGift' );
 1127+ $gift_image = '<img src="' . $wgUploadPath . '/awards/' .
 1128+ SystemGifts::getGiftImage( $gift['gift_id'], 'ml' ) .
 1129+ '" border="0" alt="" />';
 1130+ $gift_link = $user = SpecialPage::getTitleFor( 'ViewSystemGift' );
10461131
1047 - $output .= '<a href="' . $gift_link->escapeFullURL( 'gift_id=' . $gift['id'] ) . '" ' . ( ( $gift['status'] == 1 ) ? 'class="user-page-new"' : '' ) . " rel=\"nofollow\">
1048 - {$gift_image}
1049 - </a>";
 1132+ $class = '';
 1133+ if ( $gift['status'] == 1 ) {
 1134+ $class = 'class="user-page-new"';
 1135+ }
 1136+ $output .= '<a href="' . $gift_link->escapeFullURL( 'gift_id=' . $gift['id'] ) .
 1137+ '" ' . $class . " rel=\"nofollow\">
 1138+ {$gift_image}
 1139+ </a>";
10501140
1051 - if ( $x == count( $system_gifts ) || $x != 1 && $x % $per_row == 0 ) {
1052 - $output .= '<div class="cleared"></div>';
1053 - }
1054 - $x++;
 1141+ if ( $x == count( $system_gifts ) || $x != 1 && $x % $per_row == 0 ) {
 1142+ $output .= '<div class="cleared"></div>';
10551143 }
 1144+ $x++;
 1145+ }
10561146
10571147 $output .= '</div>';
10581148 }
@@ -1059,13 +1149,22 @@
10601150 return $output;
10611151 }
10621152
 1153+ /**
 1154+ * Get the user board for a given user.
 1155+ *
 1156+ * @param $user_id Integer: user's ID number
 1157+ * @param $user_name String: user name
 1158+ */
10631159 function getUserBoard( $user_id, $user_name ) {
10641160 global $wgUser, $wgOut, $wgUserProfileDisplay, $wgUserProfileScripts;
10651161
 1162+ // Anonymous users cannot have user boards
10661163 if ( $user_id == 0 ) {
10671164 return '';
10681165 }
10691166
 1167+ // Don't display anything if user board on social profiles isn't
 1168+ // enabled in site configuration
10701169 if ( $wgUserProfileDisplay['board'] == false ) {
10711170 return '';
10721171 }
@@ -1077,7 +1176,6 @@
10781177 $rel = new UserRelationship( $user_name );
10791178 $friends = $rel->getRelationshipList( 1, 4 );
10801179
1081 - $user_safe = str_replace( '&', '%26', $user_name );
10821180 $stats = new UserStats( $user_id, $user_name );
10831181 $stats_data = $stats->getUserStats();
10841182 $total = $stats_data['user_board'];
@@ -1095,25 +1193,27 @@
10961194 '</div>
10971195 <div class="user-section-actions">
10981196 <div class="action-right">';
1099 - if ( $wgUser->getName() == $user_name ) {
1100 - if ( $friends ) {
1101 - $output .= '<a href="' . UserBoard::getBoardBlastURL() . '">' . wfMsg( 'user-send-board-blast' ) . '</a>';
1102 - }
1103 - if ( $total > 10 ) {
1104 - $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
1105 - }
1106 - }
1107 - if ( $total > 10 ) {
1108 - $output .= '<a href="' . UserBoard::getUserBoardURL( $user_name ) . '">' . wfMsg( 'user-view-all' ) . '</a>';
1109 - }
1110 - $output .= '</div>
 1197+ if ( $wgUser->getName() == $user_name ) {
 1198+ if ( $friends ) {
 1199+ $output .= '<a href="' . UserBoard::getBoardBlastURL() . '">' .
 1200+ wfMsg( 'user-send-board-blast' ) . '</a>';
 1201+ }
 1202+ if ( $total > 10 ) {
 1203+ $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
 1204+ }
 1205+ }
 1206+ if ( $total > 10 ) {
 1207+ $output .= '<a href="' . UserBoard::getUserBoardURL( $user_name ) . '">' .
 1208+ wfMsg( 'user-view-all' ) . '</a>';
 1209+ }
 1210+ $output .= '</div>
11111211 <div class="action-left">';
1112 - if ( $total > 10 ) {
1113 - $output .= wfMsg( 'user-count-separator', '10', $total );
1114 - } elseif ( $total > 0 ) {
1115 - $output .= wfMsg( 'user-count-separator', $total, $total );
1116 - }
1117 - $output .= '</div>
 1212+ if ( $total > 10 ) {
 1213+ $output .= wfMsg( 'user-count-separator', '10', $total );
 1214+ } elseif ( $total > 0 ) {
 1215+ $output .= wfMsg( 'user-count-separator', $total, $total );
 1216+ }
 1217+ $output .= '</div>
11181218 <div class="cleared"></div>
11191219 </div>
11201220 </div>
@@ -1140,6 +1240,7 @@
11411241 '</div>';
11421242 }
11431243 }
 1244+
11441245 $output .= '<div id="user-page-board">';
11451246 $b = new UserBoard();
11461247 $output .= $b->displayMessages( $user_id, 0, 10 );
@@ -1150,8 +1251,12 @@
11511252 }
11521253
11531254 /**
1154 - * Gets the user's fanboxes if $wgEnableUserBoxes = true; and $wgUserProfileDisplay['userboxes'] = true;
1155 - * and FanBoxes extension is installed.
 1255+ * Gets the user's fanboxes if $wgEnableUserBoxes = true; and
 1256+ * $wgUserProfileDisplay['userboxes'] = true; and the FanBoxes extension is
 1257+ * installed.
 1258+ *
 1259+ * @param $user_name String: user name
 1260+ * @return String: HTML
11561261 */
11571262 function getFanBoxes( $user_name ) {
11581263 global $wgOut, $wgUser, $wgTitle, $wgMemc, $wgUserProfileDisplay, $wgFanBoxScripts, $wgEnableUserBoxes;
@@ -1168,17 +1273,19 @@
11691274 $user_safe = ( $user_name );
11701275
11711276 // Try cache
1172 - // $key = wfMemcKey( 'user', 'profile', 'fanboxes', "{$f->user_id}" );
1173 - // $data = $wgMemc->get( $key );
 1277+ /*
 1278+ $key = wfMemcKey( 'user', 'profile', 'fanboxes', "{$f->user_id}" );
 1279+ $data = $wgMemc->get( $key );
11741280
1175 - // if( !$data ){
1176 - // wfDebug( "Got profile fanboxes for user {$user_name} from db\n" );
1177 - // $fanboxes = $f->getUserFanboxes( 0, 10 );
1178 - // $wgMemc->set( $key, $fanboxes );
1179 - // } else {
1180 - // wfDebug( "Got profile fanboxes for user {$user_name} from cache\n" );
1181 - // $fanboxes = $data;
1182 - // }
 1281+ if( !$data ) {
 1282+ wfDebug( "Got profile fanboxes for user {$user_name} from DB\n" );
 1283+ $fanboxes = $f->getUserFanboxes( 0, 10 );
 1284+ $wgMemc->set( $key, $fanboxes );
 1285+ } else {
 1286+ wfDebug( "Got profile fanboxes for user {$user_name} from cache\n" );
 1287+ $fanboxes = $data;
 1288+ }
 1289+ */
11831290
11841291 $fanboxes = $f->getUserFanboxes( 0, 10 );
11851292
@@ -1193,17 +1300,20 @@
11941301 '</div>
11951302 <div class="user-section-actions">
11961303 <div class="action-right">';
1197 - if ( $fanbox_count > 10 ) {
1198 - $output .= '<a href="' . $fanbox_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
1199 - }
1200 - $output .= '</div>
 1304+ // If there are more than ten fanboxes, display a "View all" link
 1305+ // instead of listing them all on the profile page
 1306+ if ( $fanbox_count > 10 ) {
 1307+ $output .= '<a href="' . $fanbox_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' .
 1308+ wfMsg( 'user-view-all' ) . '</a>';
 1309+ }
 1310+ $output .= '</div>
12011311 <div class="action-left">';
1202 - if ( $fanbox_count > 10 ) {
1203 - $output .= wfMsg( 'user-count-separator', '10', $fanbox_count );
1204 - } else {
1205 - $output .= wfMsg( 'user-count-separator', $fanbox_count, $fanbox_count );
1206 - }
1207 - $output .= '</div>
 1312+ if ( $fanbox_count > 10 ) {
 1313+ $output .= wfMsg( 'user-count-separator', '10', $fanbox_count );
 1314+ } else {
 1315+ $output .= wfMsg( 'user-count-separator', $fanbox_count, $fanbox_count );
 1316+ }
 1317+ $output .= '</div>
12081318 <div class="cleared"></div>
12091319
12101320 </div>
@@ -1212,113 +1322,115 @@
12131323
12141324 <div class="user-fanbox-container clearfix">';
12151325
1216 - $x = 1;
1217 - $tagParser = new Parser();
1218 - foreach ( $fanboxes as $fanbox ) {
 1326+ $x = 1;
 1327+ $tagParser = new Parser();
 1328+ foreach ( $fanboxes as $fanbox ) {
 1329+ $check_user_fanbox = $f->checkIfUserHasFanbox( $fanbox['fantag_id'] );
12191330
1220 - $check_user_fanbox = $f->checkIfUserHasFanbox( $fanbox['fantag_id'] );
 1331+ if ( $fanbox['fantag_image_name'] ) {
 1332+ $fantag_image_width = 45;
 1333+ $fantag_image_height = 53;
 1334+ $fantag_image = wfFindFile( $fanbox['fantag_image_name'] );
 1335+ $fantag_image_url = $fantag_image->createThumb( $fantag_image_width, $fantag_image_height );
 1336+ $fantag_image_tag = '<img alt="" src="' . $fantag_image_url . '" />';
 1337+ }
12211338
1222 - if ( $fanbox['fantag_image_name'] ) {
1223 - $fantag_image_width = 45;
1224 - $fantag_image_height = 53;
1225 - $fantag_image = wfFindFile( $fanbox['fantag_image_name'] );
1226 - $fantag_image_url = $fantag_image->createThumb( $fantag_image_width, $fantag_image_height );
1227 - $fantag_image_tag = '<img alt="" src="' . $fantag_image_url . '" />';
1228 - }
 1339+ if ( $fanbox['fantag_left_text'] == '' ) {
 1340+ $fantag_leftside = $fantag_image_tag;
 1341+ } else {
 1342+ $fantag_leftside = $fanbox['fantag_left_text'];
 1343+ $fantag_leftside = $tagParser->parse( $fantag_leftside, $wgTitle, $wgOut->parserOptions(), false );
 1344+ $fantag_leftside = $fantag_leftside->getText();
 1345+ }
12291346
1230 - if ( $fanbox['fantag_left_text'] == '' ) {
1231 - $fantag_leftside = $fantag_image_tag;
1232 - } else {
1233 - $fantag_leftside = $fanbox['fantag_left_text'];
1234 - $fantag_leftside = $tagParser->parse( $fantag_leftside, $wgTitle, $wgOut->parserOptions(), false );
1235 - $fantag_leftside = $fantag_leftside->getText();
1236 - }
 1347+ $leftfontsize = '10px';
 1348+ if ( $fanbox['fantag_left_textsize'] == 'mediumfont' ) {
 1349+ $leftfontsize = '11px';
 1350+ }
12371351
1238 - $leftfontsize = '10px';
1239 - if ( $fanbox['fantag_left_textsize'] == 'mediumfont' ) {
1240 - $leftfontsize = '11px';
1241 - }
 1352+ if ( $fanbox['fantag_left_textsize'] == 'bigfont' ) {
 1353+ $leftfontsize = '15px';
 1354+ }
12421355
1243 - if ( $fanbox['fantag_left_textsize'] == 'bigfont' ) {
1244 - $leftfontsize = '15px';
1245 - }
 1356+ if ( $fanbox['fantag_right_textsize'] == 'smallfont' ) {
 1357+ $rightfontsize = '10px';
 1358+ }
12461359
1247 - if ( $fanbox['fantag_right_textsize'] == 'smallfont' ) {
1248 - $rightfontsize = '10px';
1249 - }
 1360+ if ( $fanbox['fantag_right_textsize'] == 'mediumfont' ) {
 1361+ $rightfontsize = '11px';
 1362+ }
12501363
1251 - if ( $fanbox['fantag_right_textsize'] == 'mediumfont' ) {
1252 - $rightfontsize = '11px';
1253 - }
 1364+ // Get permalink
 1365+ $fantag_title = Title::makeTitle( NS_FANTAG, $fanbox['fantag_title'] );
 1366+ $right_text = $fanbox['fantag_right_text'];
 1367+ $right_text = $tagParser->parse( $right_text, $wgTitle, $wgOut->parserOptions(), false );
 1368+ $right_text = $right_text->getText();
12541369
1255 - // Get permalink
1256 - $fantag_title = Title::makeTitle( NS_FANTAG, $fanbox['fantag_title'] );
1257 - $right_text = $fanbox['fantag_right_text'];
1258 - $right_text = $tagParser->parse( $right_text, $wgTitle, $wgOut->parserOptions(), false );
1259 - $right_text = $right_text->getText();
 1370+ // Output fanboxes
 1371+ $output .= "<div class=\"fanbox-item\">
 1372+ <div class=\"individual-fanbox\" id=\"individualFanbox" . $fanbox['fantag_id'] . "\">
 1373+ <div class=\"show-message-container-profile\" id=\"show-message-container" . $fanbox['fantag_id'] . "\">
 1374+ <a class=\"perma\" style=\"font-size:8px; color:" . $fanbox['fantag_right_textcolor'] . "\" href=\"" . $fantag_title->escapeFullURL() . "\" title=\"{$fanbox['fantag_title']}\">" . wfMsg( 'fanbox-perma' ) . "</a>
 1375+ <table class=\"fanBoxTableProfile\" onclick=\"javascript:openFanBoxPopup('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}')\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
 1376+ <tr>
 1377+ <td id=\"fanBoxLeftSideOutputProfile\" style=\"color:" . $fanbox['fantag_left_textcolor'] . "; font-size:$leftfontsize\" bgcolor=\"" . $fanbox['fantag_left_bgcolor'] . "\">" . $fantag_leftside . "</td>
 1378+ <td id=\"fanBoxRightSideOutputProfile\" style=\"color:" . $fanbox['fantag_right_textcolor'] . "; font-size:$rightfontsize\" bgcolor=\"" . $fanbox['fantag_right_bgcolor'] . "\">" . $right_text . "</td>
 1379+ </tr>
 1380+ </table>
 1381+ </div>
 1382+ </div>";
12601383
1261 - // Output fanboxes
1262 - $output .= "<div class=\"fanbox-item\">
1263 - <div class=\"individual-fanbox\" id=\"individualFanbox" . $fanbox['fantag_id'] . "\">
1264 - <div class=\"show-message-container-profile\" id=\"show-message-container" . $fanbox['fantag_id'] . "\">
1265 - <a class=\"perma\" style=\"font-size:8px; color:" . $fanbox['fantag_right_textcolor'] . "\" href=\"" . $fantag_title->escapeFullURL() . "\" title=\"{$fanbox["fantag_title"]}\">" . wfMsg( 'fanbox-perma' ) . "</a>
1266 - <table class=\"fanBoxTableProfile\" onclick=\"javascript:openFanBoxPopup('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
1267 - <tr>
1268 - <td id=\"fanBoxLeftSideOutputProfile\" style=\"color:" . $fanbox['fantag_left_textcolor'] . "; font-size:$leftfontsize\" bgcolor=\"" . $fanbox['fantag_left_bgcolor'] . "\">" . $fantag_leftside . "</td>
1269 - <td id=\"fanBoxRightSideOutputProfile\" style=\"color:" . $fanbox['fantag_right_textcolor'] . "; font-size:$rightfontsize\" bgcolor=\"" . $fanbox['fantag_right_bgcolor'] . "\">" . $right_text . "</td>
1270 - </tr>
1271 - </table>
1272 - </div>
 1384+ if ( $wgUser->isLoggedIn() ) {
 1385+ if ( $check_user_fanbox == 0 ) {
 1386+ $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox" . $fanbox['fantag_id'] . "\">
 1387+ <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
 1388+ <tr>
 1389+ <td style=\"font-size:10px\">" . wfMsg( 'fanbox-add-fanbox' ) . "</td>
 1390+ </tr>
 1391+ <tr>
 1392+ <td align=\"center\">
 1393+ <input type=\"button\" value=\"" . wfMsg( 'fanbox-add' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}'); showAddRemoveMessageUserPage(1, {$fanbox['fantag_id']}, 'show-addremove-message-half')\" />
 1394+ <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}')\" />
 1395+ </td>
 1396+ </tr>
 1397+ </table>
12731398 </div>";
1274 -
1275 - if ( $wgUser->isLoggedIn() ) {
1276 - if ( $check_user_fanbox == 0 ) {
1277 - $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox" . $fanbox['fantag_id'] . "\">
1278 - <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
1279 - <tr>
1280 - <td style=\"font-size:10px\">" . wfMsg( 'fanbox-add-fanbox' ) . "</td>
1281 - </tr>
1282 - <tr>
1283 - <td align=\"center\">
1284 - <input type=\"button\" value=\"" . wfMsg( 'fanbox-add' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}'); showAddRemoveMessageUserPage(1, {$fanbox["fantag_id"]}, 'show-addremove-message-half')\" />
1285 - <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" />
1286 - </td>
1287 - </tr>
1288 - </table>
1289 - </div>";
1290 - } else {
1291 - $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox" . $fanbox['fantag_id'] . "\">
1292 - <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
1293 - <tr>
1294 - <td style=\"font-size:10px\">" . wfMsg( 'fanbox-remove-fanbox' ) . "</td>
1295 - </tr>
1296 - <tr>
1297 - <td align=\"center\">
1298 - <input type=\"button\" value=\"" . wfMsg( 'fanbox-remove' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}'); showAddRemoveMessageUserPage(2, {$fanbox["fantag_id"]}, 'show-addremove-message-half')\" />
1299 - <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" />
1300 - </td>
1301 - </tr>
1302 - </table>
1303 - </div>";
1304 - }
1305 - }
1306 -
1307 - if ( $wgUser->getID() == 0 ) {
1308 - $login = SpecialPage::getTitleFor( 'Userlogin' );
 1399+ } else {
13091400 $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox" . $fanbox['fantag_id'] . "\">
13101401 <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
13111402 <tr>
1312 - <td style=\"font-size:10px\">" . wfMsg( 'fanbox-add-fanbox-login' ) . "<a href=\"{$login->getFullURL()}\">" . wfMsg( 'fanbox-login' ) . "</a></td>
 1403+ <td style=\"font-size:10px\">" . wfMsg( 'fanbox-remove-fanbox' ) . "</td>
13131404 </tr>
13141405 <tr>
13151406 <td align=\"center\">
1316 - <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" />
 1407+ <input type=\"button\" value=\"" . wfMsg( 'fanbox-remove' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}'); showAddRemoveMessageUserPage(2, {$fanbox['fantag_id']}, 'show-addremove-message-half')\" />
 1408+ <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}')\" />
13171409 </td>
13181410 </tr>
13191411 </table>
13201412 </div>";
13211413 }
 1414+ }
13221415
 1416+ if ( $wgUser->getID() == 0 ) {
 1417+ $login = SpecialPage::getTitleFor( 'Userlogin' );
 1418+ $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox" . $fanbox['fantag_id'] . "\">
 1419+ <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
 1420+ <tr>
 1421+ <td style=\"font-size:10px\">" .
 1422+ wfMsg( 'fanbox-add-fanbox-login' ) .
 1423+ "<a href=\"{$login->getFullURL()}\">" .
 1424+ wfMsg( 'fanbox-login' ) . "</a></td>
 1425+ </tr>
 1426+ <tr>
 1427+ <td align=\"center\">
 1428+ <input type=\"button\" value=\"" . wfMsg( 'cancel' ) . "\" size=\"10\" onclick=\"closeFanboxAdd('fanboxPopUpBox{$fanbox['fantag_id']}', 'individualFanbox{$fanbox['fantag_id']}')\" />
 1429+ </td>
 1430+ </tr>
 1431+ </table>
 1432+ </div>";
 1433+ }
 1434+
13231435 $output .= '</div>';
13241436
13251437 $x++;
@@ -1328,4 +1440,5 @@
13291441
13301442 return $output;
13311443 }
 1444+
13321445 }

Status & tagging log