r49394 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49393‎ | r49394 | r49395 >
Date:10:49, 11 April 2009
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: fix E_NOTICE + minor cleanup + removed some unused globals
Modified paths:
  • /trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserProfile/UserProfilePage.php
@@ -112,7 +112,7 @@
113113 }
114114
115115 function getUserStats( $user_id, $user_name ) {
116 - global $wgUser, $IP, $wgUserProfileDisplay;
 116+ global $wgUser, $wgUserProfileDisplay;
117117
118118 // Load messages, we're gonna need 'em
119119 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -191,7 +191,7 @@
192192 }
193193
194194 function getPersonalInfo( $user_id, $user_name ) {
195 - global $IP, $wgUser, $wgMemc, $wgUserProfileDisplay;
 195+ global $wgUser, $wgMemc, $wgUserProfileDisplay;
196196
197197 // Load messages, we're gonna need 'em
198198 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -280,7 +280,7 @@
281281 }
282282
283283 function getCustomInfo( $user_name ) {
284 - global $IP, $wgUser, $wgMemc, $wgUserProfileDisplay;
 284+ global $wgUser, $wgMemc, $wgUserProfileDisplay;
285285
286286 if( $wgUserProfileDisplay['custom'] == false ) {
287287 return '';
@@ -341,7 +341,7 @@
342342 }
343343
344344 function getInterests( $user_name ) {
345 - global $IP, $wgUser, $wgMemc, $wgUserProfileDisplay;
 345+ global $wgUser, $wgMemc, $wgUserProfileDisplay;
346346
347347 // Load messages, we're gonna need 'em
348348 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -407,7 +407,7 @@
408408 }
409409
410410 function getProfileTop( $user_id, $user_name ) {
411 - global $IP, $wgTitle, $wgUser, $wgMemc, $wgUploadPath, $wgLang;
 411+ global $wgTitle, $wgUser, $wgMemc, $wgUploadPath, $wgLang;
412412
413413 // Load messages, we're gonna need 'em
414414 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -561,7 +561,7 @@
562562 }
563563
564564 function getRelationships( $user_name, $rel_type ){
565 - global $IP, $wgMemc, $wgUser, $wgUserProfileDisplay, $wgUploadPath;
 565+ global $wgMemc, $wgUser, $wgUserProfileDisplay, $wgUploadPath;
566566
567567 // Load messages, we're gonna need 'em
568568 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -654,7 +654,7 @@
655655 }
656656
657657 function getGifts( $user_name ){
658 - global $IP, $wgUser, $wgMemc, $wgUserProfileDisplay, $wgUploadPath;
 658+ global $wgUser, $wgMemc, $wgUserProfileDisplay, $wgUploadPath;
659659
660660 // Load messages, we're gonna need 'em
661661 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -738,7 +738,7 @@
739739 }
740740
741741 function getAwards( $user_name ){
742 - global $IP, $wgUser, $wgMemc, $wgUserProfileDisplay, $wgUploadPath;
 742+ global $wgUser, $wgMemc, $wgUserProfileDisplay, $wgUploadPath;
743743
744744 // Load messages, we're gonna need 'em
745745 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -821,7 +821,7 @@
822822 }
823823
824824 function getUserBoard( $user_id, $user_name ){
825 - global $IP, $wgMemc, $wgUser, $wgOut, $wgUserProfileDisplay, $wgUserProfileScripts;
 825+ global $wgMemc, $wgUser, $wgOut, $wgUserProfileDisplay, $wgUserProfileScripts;
826826
827827 // Load messages, we're gonna need 'em
828828 wfLoadExtensionMessages( 'SocialProfileUserProfile' );
@@ -908,18 +908,19 @@
909909 * and FanBoxes extension is installed.
910910 */
911911 function getFanBoxes( $user_name ){
912 - global $wgOut, $IP, $wgUser, $wgTitle, $wgMemc, $wgUserProfileDisplay, $wgFanBoxScripts, $wgFanBoxDirectory, $wgEnableUserBoxes;
 912+ global $wgOut, $wgUser, $wgTitle, $wgMemc, $wgUserProfileDisplay, $wgFanBoxScripts, $wgFanBoxDirectory, $wgEnableUserBoxes;
913913
914914 if ( !$wgEnableUserBoxes || $wgUserProfileDisplay['userboxes'] == false ) {
915915 return '';
916916 }
917917
918 - $wgOut->addScript("<script type=\"text/javascript\" src=\"{$wgFanBoxScripts}/FanBoxes.js\"></script>\n");
919 - $wgOut->addScript("<link rel='stylesheet' type='text/css' href=\"{$wgFanBoxScripts}/FanBoxes.css\"/>\n");
 918+ $wgOut->addScriptFile( $wgFanBoxScripts . '/FanBoxes.js' );
 919+ $wgOut->addStyle( '../..' . $wgFanBoxScripts . '/FanBoxes.css' );
920920
921 - wfLoadExtensionMessages('FanBox');
 921+ wfLoadExtensionMessages( 'FanBox' );
922922
923 - $f = new UserFanBoxes($user_name);
 923+ $output = '';
 924+ $f = new UserFanBoxes( $user_name );
924925 $user_safe = ($user_name);
925926
926927 // Try cache
@@ -935,9 +936,9 @@
936937 // $fanboxes = $data;
937938 //}
938939
939 - $fanboxes = $f->getUserFanboxes(0, 10);
 940+ $fanboxes = $f->getUserFanboxes( 0, 10 );
940941
941 - $fanbox_count = $f->getFanBoxCountByUsername($user_name);
 942+ $fanbox_count = $f->getFanBoxCountByUsername( $user_name );
942943 $fanbox_link = SpecialPage::getTitleFor( 'ViewUserBoxes' );
943944 $per_row = 1;
944945
@@ -945,17 +946,19 @@
946947
947948 $output .= '<div class="user-section-heading">
948949 <div class="user-section-title">
949 - '.wfMsg('user-fanbox-title').'
 950+ ' . wfMsg( 'user-fanbox-title' ) . '
950951 </div>
951952 <div class="user-section-actions">
952953 <div class="action-right">';
953 - if( $fanbox_count > 10 ) $output .= '<a href="'.$fanbox_link->escapeFullURL('user='.$user_safe).'" rel="nofollow">'.wfMsg('user-view-all').'</a>';
 954+ if( $fanbox_count > 10 ){
 955+ $output .= '<a href="' . $fanbox_link->escapeFullURL( 'user=' . $user_safe ) . '" rel="nofollow">' . wfMsg( 'user-view-all' ) . '</a>';
 956+ }
954957 $output .= '</div>
955958 <div class="action-left">';
956959 if( $fanbox_count > 10 ) {
957 - $output .= wfMsg('user-count-separator', "10", $fanbox_count );
 960+ $output .= wfMsg( 'user-count-separator', '10', $fanbox_count );
958961 } else {
959 - $output .= wfMsg( 'user-count-separator',$fanbox_count, $fanbox_count);
 962+ $output .= wfMsg( 'user-count-separator', $fanbox_count, $fanbox_count );
960963 }
961964 $output .= '</div>
962965 <div class="cleared"></div>
@@ -970,14 +973,14 @@
971974 $tagParser = new Parser();
972975 foreach( $fanboxes as $fanbox ) {
973976
974 - $check_user_fanbox = $f->checkIfUserHasFanbox($fanbox['fantag_id']);
 977+ $check_user_fanbox = $f->checkIfUserHasFanbox( $fanbox['fantag_id'] );
975978
976979 if( $fanbox['fantag_image_name'] ){
977980 $fantag_image_width = 45;
978981 $fantag_image_height = 53;
979982 $fantag_image = wfFindFile( $fanbox['fantag_image_name'] );
980 - $fantag_image_url = $fantag_image->createThumb($fantag_image_width, $fantag_image_height);
981 - $fantag_image_tag = '<img alt="" src="' . $fantag_image_url . '"/>';
 983+ $fantag_image_url = $fantag_image->createThumb( $fantag_image_width, $fantag_image_height );
 984+ $fantag_image_tag = '<img alt="" src="' . $fantag_image_url . '" />';
982985 };
983986
984987 if ( $fanbox['fantag_left_text'] == '' ){
@@ -1015,7 +1018,7 @@
10161019 <div class=\"individual-fanbox\" id=\"individualFanbox".$fanbox['fantag_id']."\">
10171020 <div class=\"show-message-container-profile\" id=\"show-message-container".$fanbox['fantag_id']."\">
10181021 <a class=\"perma\" style=\"font-size:8px; color:".$fanbox['fantag_right_textcolor']."\" href=\"".$fantag_title->escapeFullURL()."\" title=\"{$fanbox["fantag_title"]}\">".wfMsg('fanbox-perma')."</a>
1019 - <table class=\"fanBoxTableProfile\" onclick=\"javascript:openFanBoxPopup('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" >
 1022+ <table class=\"fanBoxTableProfile\" onclick=\"javascript:openFanBoxPopup('fanboxPopUpBox{$fanbox["fantag_id"]}', 'individualFanbox{$fanbox["fantag_id"]}')\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
10201023 <tr>
10211024 <td id=\"fanBoxLeftSideOutputProfile\" style=\"color:".$fanbox['fantag_left_textcolor']."; font-size:$leftfontsize\" bgcolor=\"".$fanbox['fantag_left_bgcolor']."\">".$fantag_leftside."</td>
10221025 <td id=\"fanBoxRightSideOutputProfile\" style=\"color:".$fanbox['fantag_right_textcolor']."; font-size:$rightfontsize\" bgcolor=\"".$fanbox['fantag_right_bgcolor']."\">".$right_text."</td>
@@ -1057,7 +1060,7 @@
10581061 }
10591062
10601063 if( $wgUser->getID() == 0 ) {
1061 - $login = SpecialPage::getTitleFor( 'UserLogin' );
 1064+ $login = SpecialPage::getTitleFor( 'Userlogin' );
10621065 $output .= "<div class=\"fanbox-pop-up-box-profile\" id=\"fanboxPopUpBox".$fanbox['fantag_id']."\">
10631066 <table cellpadding=\"0\" cellspacing=\"0\" align=\"center\">
10641067 <tr>

Status & tagging log