Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php |
— | — | @@ -778,7 +778,7 @@ |
779 | 779 | * @param $user_name String: user name |
780 | 780 | */ |
781 | 781 | function getProfileTop( $user_id, $user_name ) { |
782 | | - global $wgTitle, $wgUser, $wgUploadPath, $wgLang; |
| 782 | + global $wgTitle, $wgUser, $wgLang; |
783 | 783 | global $wgUserLevels, $wgEnableUserStatus; |
784 | 784 | |
785 | 785 | $stats = new UserStats( $user_id, $user_name ); |
— | — | @@ -834,10 +834,8 @@ |
835 | 835 | </div>'; |
836 | 836 | } |
837 | 837 | |
838 | | - $output .= '<div id="profile-image"> |
839 | | - <img src="' . $wgUploadPath . '/avatars/' . |
840 | | - $avatar->getAvatarImage() . '" alt="" border="0" /> |
841 | | - </div>'; |
| 838 | + $output .= '<div id="profile-image">' . $avatar->getAvatarURL() . |
| 839 | + '</div>'; |
842 | 840 | |
843 | 841 | $output .= '<div id="profile-right">'; |
844 | 842 | |
— | — | @@ -939,7 +937,7 @@ |
940 | 938 | * @return String: HTML |
941 | 939 | */ |
942 | 940 | function getProfileImage( $user_name ) { |
943 | | - global $wgUser, $wgUploadPath; |
| 941 | + global $wgUser; |
944 | 942 | |
945 | 943 | $avatar = new wAvatar( $this->user_id, 'l' ); |
946 | 944 | $avatarTitle = SpecialPage::getTitleFor( 'UploadAvatar' ); |
— | — | @@ -951,14 +949,12 @@ |
952 | 950 | } else { |
953 | 951 | $caption = 'new image'; |
954 | 952 | } |
955 | | - $output .= '<a href="' . $avatarTitle->escapeFullURL() . '" rel="nofollow"> |
956 | | - <img src="' . $wgUploadPath . '/avatars/' . |
957 | | - $avatar->getAvatarImage() . '" alt="" border="0" /><br /> |
| 953 | + $output .= '<a href="' . $avatarTitle->escapeFullURL() . '" rel="nofollow">' . |
| 954 | + $avatar->getAvatarURL() . '<br /> |
958 | 955 | (' . $caption . ') |
959 | 956 | </a>'; |
960 | 957 | } else { |
961 | | - $output .= '<img src="' . $wgUploadPath . '/avatars/' . |
962 | | - $avatar->getAvatarImage() . '" alt="" border="0" />'; |
| 958 | + $output .= $avatar->getAvatarURL(); |
963 | 959 | } |
964 | 960 | $output .= '</div>'; |
965 | 961 | |
— | — | @@ -974,7 +970,7 @@ |
975 | 971 | * foes |
976 | 972 | */ |
977 | 973 | function getRelationships( $user_name, $rel_type ) { |
978 | | - global $wgMemc, $wgUser, $wgUserProfileDisplay, $wgUploadPath; |
| 974 | + global $wgMemc, $wgUser, $wgUserProfileDisplay, $wgLang; |
979 | 975 | |
980 | 976 | // If not enabled in site settings, don't display |
981 | 977 | if ( $rel_type == 1 ) { |
— | — | @@ -1044,17 +1040,12 @@ |
1045 | 1041 | foreach ( $friends as $friend ) { |
1046 | 1042 | $user = Title::makeTitle( NS_USER, $friend['user_name'] ); |
1047 | 1043 | $avatar = new wAvatar( $friend['user_id'], 'ml' ); |
1048 | | - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . |
1049 | | - $avatar->getAvatarImage() . '" alt="" border="0" />'; |
1050 | 1044 | |
1051 | 1045 | // Chop down username that gets displayed |
1052 | | - $user_name = mb_substr( $friend['user_name'], 0, 9 ); |
1053 | | - if ( $user_name != $friend['user_name'] ) { |
1054 | | - $user_name .= '..'; |
1055 | | - } |
| 1046 | + $user_name = $wgLang->truncate( $friend['user_name'], 9, '..' ); |
1056 | 1047 | |
1057 | 1048 | $output .= "<a href=\"" . $user->escapeFullURL() . "\" title=\"{$friend['user_name']}\" rel=\"nofollow\"> |
1058 | | - {$avatar_img}<br /> |
| 1049 | + {$avatar->getAvatarURL()}<br /> |
1059 | 1050 | {$user_name} |
1060 | 1051 | </a>"; |
1061 | 1052 | |
— | — | @@ -1801,18 +1792,18 @@ |
1802 | 1793 | } else { |
1803 | 1794 | $buf = $user_status_array['us_status']; |
1804 | 1795 | } |
1805 | | - |
| 1796 | + |
1806 | 1797 | // Only owners of the page can change statuses |
1807 | 1798 | if ( $wgUser->getId() == $userId ) { |
1808 | 1799 | if ( $wgUser->isBlocked() ) { |
1809 | | - return wfMsg('userstatus-blocked'); |
| 1800 | + return wfMsg( 'userstatus-blocked' ); |
1810 | 1801 | } |
1811 | 1802 | |
1812 | 1803 | // Database operations require write mode |
1813 | 1804 | if ( wfReadOnly() ) { |
1814 | | - return wfMsg('userstatus-readonly'); |
| 1805 | + return wfMsg( 'userstatus-readonly' ); |
1815 | 1806 | } |
1816 | | - |
| 1807 | + |
1817 | 1808 | return "<script>UserStatus.toShowMode('$buf','$userId');</script>"; |
1818 | 1809 | } else { |
1819 | 1810 | return $buf; |