r85538 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85537‎ | r85538 | r85539 >
Date:14:04, 6 April 2011
Author:ashley
Status:deferred
Tags:
Comment:
SocialProfile: in UserRelationship stuff, renamed some badly named variables, broke some long lines, removed unused variables and used $wgRequest->getInt() for int values instead of getVal()
Modified paths:
  • /trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php (modified) (history)
  • /trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationships.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SocialProfile/UserRelationship/SpecialAddRelationship.php
@@ -15,7 +15,7 @@
1616 class SpecialAddRelationship extends UnlistedSpecialPage {
1717
1818 /**
19 - * Constructor
 19+ * Constructor -- set up the new special page
2020 */
2121 public function __construct() {
2222 parent::__construct( 'AddRelationship' );
@@ -37,61 +37,61 @@
3838
3939 $wgOut->addExtensionStyle( $wgUserRelationshipScripts . '/UserRelationship.css' );
4040
41 - $usertitle = Title::newFromDBkey( $wgRequest->getVal( 'user' ) );
 41+ $userTitle = Title::newFromDBkey( $wgRequest->getVal( 'user' ) );
4242
43 - if ( !$usertitle ) {
 43+ if ( !$userTitle ) {
4444 $wgOut->setPageTitle( wfMsgHtml( 'ur-error-title' ) );
4545 $wgOut->addWikiText( wfMsgNoTrans( 'ur-add-no-user' ) );
4646 return false;
4747 }
4848
49 - $user = Title::makeTitle( NS_USER, $usertitle->getText() );
 49+ $user = Title::makeTitle( NS_USER, $userTitle->getText() );
5050
51 - $this->user_name_to = $usertitle->getText();
 51+ $this->user_name_to = $userTitle->getText();
5252 $this->user_id_to = User::idFromName( $this->user_name_to );
53 - $this->relationship_type = $wgRequest->getVal( 'rel_type' );
 53+ $this->relationship_type = $wgRequest->getInt( 'rel_type' );
5454 if ( !$this->relationship_type || !is_numeric( $this->relationship_type ) ) {
5555 $this->relationship_type = 1;
5656 }
5757
5858 if ( ( $wgUser->getID() == $this->user_id_to ) && ( $wgUser->getID() != 0 ) ) {
5959 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
60 - $out .= '<div class="relationship-error-message">'
61 - . wfMsg( 'ur-add-error-message-yourself' ) .
 60+ $out .= '<div class="relationship-error-message">' .
 61+ wfMsg( 'ur-add-error-message-yourself' ) .
6262 '</div>
6363 <div>
6464 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
65 - if ( $wgUser->isLoggedIn() ) {
66 - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
67 - }
 65+ if ( $wgUser->isLoggedIn() ) {
 66+ $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
 67+ }
6868 $out .= '</div>';
6969
7070 $wgOut->addHTML( $out );
7171
7272 } elseif ( $wgUser->isBlocked() ) {
7373 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
74 - $out .= '<div class="relationship-error-message">'
75 - . wfMsg( 'ur-add-error-message-blocked' ) .
 74+ $out .= '<div class="relationship-error-message">' .
 75+ wfMsg( 'ur-add-error-message-blocked' ) .
7676 '</div>
7777 <div>
7878 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
79 - if ( $wgUser->isLoggedIn() ) {
80 - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
81 - }
 79+ if ( $wgUser->isLoggedIn() ) {
 80+ $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
 81+ }
8282 $out .= '</div>';
8383
8484 $wgOut->addHTML( $out );
8585
8686 } elseif ( $this->user_id_to == 0 ) {
8787 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
88 - $out .= '<div class="relationship-error-message">'
89 - . wfMsg( 'ur-add-error-message-no-user' ) .
 88+ $out .= '<div class="relationship-error-message">' .
 89+ wfMsg( 'ur-add-error-message-no-user' ) .
9090 '</div>
9191 <div>
9292 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
93 - if ( $wgUser->isLoggedIn() ) {
94 - $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
95 - }
 93+ if ( $wgUser->isLoggedIn() ) {
 94+ $out .= '<input type="button" class="site-button" value="' . wfMsg( 'ur-your-profile' ) . '" size="20" onclick=\'window.location="' . $wgUser->getUserPage()->escapeFullURL() . '"\' />';
 95+ }
9696 $out .= '</div>';
9797
9898 $wgOut->addHTML( $out );
@@ -105,7 +105,8 @@
106106 }
107107
108108 $avatar = new wAvatar( $this->user_id_to, 'l' );
109 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 109+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 110+ $avatar->getAvatarImage() . '" alt="" border="0" />';
110111
111112 $out = '';
112113 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
@@ -131,7 +132,8 @@
132133 }
133134
134135 $avatar = new wAvatar( $this->user_id_to, 'l' );
135 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 136+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 137+ $avatar->getAvatarImage() . '" alt="" border="0" />';
136138
137139 $out = '';
138140 $wgOut->setPageTitle( wfMsg( 'ur-add-error-message-pending-request-title' ) );
@@ -177,7 +179,8 @@
178180 $rel = $rel->addRelationshipRequest( $this->user_name_to, $this->relationship_type, $wgRequest->getVal( 'message' ) );
179181
180182 $avatar = new wAvatar( $this->user_id_to, 'l' );
181 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 183+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 184+ $avatar->getAvatarImage() . '" alt="" border="0" />';
182185
183186 $out = '';
184187
@@ -214,8 +217,6 @@
215218 function displayForm() {
216219 global $wgOut, $wgUploadPath;
217220
218 - $form = '';
219 -
220221 if ( $this->relationship_type == 1 ) {
221222 $wgOut->setPageTitle( wfMsg( 'ur-add-title-friend', $this->user_name_to ) );
222223 $add = wfMsg( 'ur-add-message-friend', $this->user_name_to );
@@ -227,18 +228,17 @@
228229 }
229230
230231 $avatar = new wAvatar( $this->user_id_to, 'l' );
231 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="0" />';
 232+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 233+ $avatar->getAvatarImage() . '" alt="" border="0" />';
232234
233 - $user_link = Title::makeTitle( NS_USER, $this->user_name_to );
234 -
235 - $form .= "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\">
 235+ $form = "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\">
236236 <div class=\"relationship-action\">
237237 {$avatar_img}
238238 " . $add .
239239 '<div class="cleared"></div>
240240 </div>
241 - <div class="relationship-textbox-title">'
242 - . wfMsg( 'ur-add-personal-message' ) .
 241+ <div class="relationship-textbox-title">' .
 242+ wfMsg( 'ur-add-personal-message' ) .
243243 '</div>
244244 <textarea name="message" id="message" rows="3" cols="50"></textarea>
245245 <div class="relationship-buttons">
Index: trunk/extensions/SocialProfile/UserRelationship/SpecialRemoveRelationship.php
@@ -14,7 +14,7 @@
1515 class SpecialRemoveRelationship extends UnlistedSpecialPage {
1616
1717 /**
18 - * Constructor
 18+ * Constructor -- set up the new special page
1919 */
2020 public function __construct() {
2121 parent::__construct( 'RemoveRelationship' );
@@ -45,16 +45,19 @@
4646
4747 $this->user_name_to = $usertitle->getText();
4848 $this->user_id_to = User::idFromName( $this->user_name_to );
49 - $this->relationship_type = UserRelationship::getUserRelationshipByID( $this->user_id_to, $wgUser->getID() );
 49+ $this->relationship_type = UserRelationship::getUserRelationshipByID(
 50+ $this->user_id_to,
 51+ $wgUser->getID()
 52+ );
5053
5154 if ( $this->relationship_type == 1 ) {
52 - $confirmtitle = wfMsg( 'ur-remove-relationship-title-confirm-friend', $this->user_name_to );
53 - $confirmmsg = wfMsg( 'ur-remove-relationship-message-confirm-friend', $this->user_name_to );
 55+ $confirmTitle = wfMsg( 'ur-remove-relationship-title-confirm-friend', $this->user_name_to );
 56+ $confirmMsg = wfMsg( 'ur-remove-relationship-message-confirm-friend', $this->user_name_to );
5457 $error = wfMsg( 'ur-remove-error-not-loggedin-friend' );
5558 $pending = wfMsg( 'ur-remove-error-message-pending-friend-request', $this->user_name_to );
5659 } else {
57 - $confirmtitle = wfMsg( 'ur-remove-relationship-title-confirm-foe', $this->user_name_to );
58 - $confirmmsg = wfMsg( 'ur-remove-relationship-message-confirm-foe', $this->user_name_to );
 60+ $confirmTitle = wfMsg( 'ur-remove-relationship-title-confirm-foe', $this->user_name_to );
 61+ $confirmMsg = wfMsg( 'ur-remove-relationship-message-confirm-foe', $this->user_name_to );
5962 $error = wfMsg( 'ur-remove-error-not-loggedin-foe' );
6063 $pending = wfMsg( 'ur-remove-error-message-pending-foe-request', $this->user_name_to );
6164 }
@@ -75,8 +78,8 @@
7679 $wgOut->addHTML( $out );
7780 } elseif ( $this->relationship_type == false ) {
7881 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
79 - $out .= '<div class="relationship-error-message">'
80 - . wfMsg( 'ur-remove-error-message-no-relationship', $this->user_name_to ) .
 82+ $out .= '<div class="relationship-error-message">' .
 83+ wfMsg( 'ur-remove-error-message-no-relationship', $this->user_name_to ) .
8184 '</div>
8285 <div>
8386 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
@@ -88,9 +91,9 @@
8992 $wgOut->addHTML( $out );
9093 } elseif ( UserRelationship::userHasRequestByID( $this->user_id_to, $wgUser->getID() ) == true ) {
9194 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
92 - $out .= '<div class="relationship-error-message">
93 - ' . $pending . '
94 - </div>
 95+ $out .= '<div class="relationship-error-message">' .
 96+ $pending .
 97+ '</div>
9598 <div>
9699 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
97100 if ( $wgUser->isLoggedIn() ) {
@@ -101,8 +104,8 @@
102105 $wgOut->addHTML( $out );
103106 } elseif ( $wgUser->getID() == 0 ) {
104107 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
105 - $out .= '<div class="relationship-error-message">'
106 - . $error .
 108+ $out .= '<div class="relationship-error-message">' .
 109+ $error .
107110 '</div>
108111 <div>
109112 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" size="20" onclick=\'window.location="index.php?title="' . wfMsgForContent( 'mainpage' ) . '"\' />';
@@ -115,18 +118,25 @@
116119 } else {
117120 $rel = new UserRelationship( $wgUser->getName() );
118121 if ( $wgRequest->wasPosted() && $_SESSION['alreadysubmitted'] == false ) {
119 -
120122 $_SESSION['alreadysubmitted'] = true;
121 - $rel->removeRelationshipByUserID( $this->user_id_to, $wgUser->getID() );
122 - $rel->sendRelationshipRemoveEmail( $this->user_id_to, $wgUser->getName(), $this->relationship_type );
 123+ $rel->removeRelationshipByUserID(
 124+ $this->user_id_to,
 125+ $wgUser->getID()
 126+ );
 127+ $rel->sendRelationshipRemoveEmail(
 128+ $this->user_id_to,
 129+ $wgUser->getName(),
 130+ $this->relationship_type
 131+ );
123132 $avatar = new wAvatar( $this->user_id_to, 'l' );
124 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="" border="" />';
 133+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 134+ $avatar->getAvatarImage() . '" alt="" border="" />';
125135
126 - $wgOut->setPageTitle( $confirmtitle );
 136+ $wgOut->setPageTitle( $confirmTitle );
127137 $out .= "<div class=\"relationship-action\">
128 - {$avatar_img}
129 - " . $confirmmsg . "
130 - <div class=\"relationship-buttons\">
 138+ {$avatar_img}" .
 139+ $confirmMsg .
 140+ "<div class=\"relationship-buttons\">
131141 <input type=\"button\" class=\"site-button\" value=\"" . wfMsg( 'ur-main-page' ) . "\" size=\"20\" onclick=\"window.location='index.php?title=" . wfMsgForContent( 'mainpage' ) . "'\"/>
132142 <input type=\"button\" class=\"site-button\" value=\"" . wfMsg( 'ur-your-profile' ) . "\" size=\"20\" onclick=\"window.location='" . $wgUser->getUserPage()->escapeFullURL() . "'\"/>
133143 </div>
@@ -149,9 +159,9 @@
150160 function displayForm() {
151161 global $wgOut, $wgUploadPath;
152162
153 - $form = '';
154163 $avatar = new wAvatar( $this->user_id_to, 'l' );
155 - $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' . $avatar->getAvatarImage() . '" alt="avatar" />';
 164+ $avatar_img = '<img src="' . $wgUploadPath . '/avatars/' .
 165+ $avatar->getAvatarImage() . '" alt="avatar" />';
156166
157167 if ( $this->relationship_type == 1 ) {
158168 $title = wfMsg( 'ur-remove-relationship-title-friend', $this->user_name_to );
@@ -161,10 +171,11 @@
162172 $remove = wfMsg( 'ur-remove-relationship-message-foe', $this->user_name_to, wfMsg( 'ur-remove' ) );
163173 }
164174 $wgOut->setPageTitle( $title );
165 - $form .= "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\">
 175+
 176+ $form = "<form action=\"\" method=\"post\" enctype=\"multipart/form-data\" name=\"form1\">
166177 <div class=\"relationship-action\">
167 - {$avatar_img}
168 - " . $remove .
 178+ {$avatar_img}" .
 179+ $remove .
169180 '<div class="relationship-buttons">
170181 <input type="hidden" name="user" value="' . addslashes( $this->user_name_to ) . '" />
171182 <input type="button" class="site-button" value="' . wfMsg( 'ur-remove' ) . '" size="20" onclick="document.form1.submit()" />
@@ -173,7 +184,8 @@
174185 <div class="cleared"></div>
175186 </div>
176187
177 - </form>';
 188+ </form>';
 189+
178190 return $form;
179191 }
180192 }
Index: trunk/extensions/SocialProfile/UserRelationship/SpecialViewRelationships.php
@@ -14,7 +14,7 @@
1515 class SpecialViewRelationships extends SpecialPage {
1616
1717 /**
18 - * Constructor
 18+ * Constructor -- set up the new special page
1919 */
2020 public function __construct() {
2121 parent::__construct( 'ViewRelationships' );
@@ -33,11 +33,11 @@
3434 $output = '';
3535
3636 /**
37 - * Get querystring variables
 37+ * Get query string variables
3838 */
3939 $user_name = $wgRequest->getVal( 'user' );
40 - $rel_type = $wgRequest->getVal( 'rel_type' );
41 - $page = $wgRequest->getVal( 'page' );
 40+ $rel_type = $wgRequest->getInt( 'rel_type' );
 41+ $page = $wgRequest->getInt( 'page' );
4242
4343 /**
4444 * Redirect Non-logged in users to Login Page
@@ -76,8 +76,8 @@
7777 */
7878 if ( $user_id == 0 ) {
7979 $wgOut->setPageTitle( wfMsg( 'ur-error-title' ) );
80 - $out .= '<div class="relationship-error-message">'
81 - . wfMsg( 'ur-error-message-no-user' ) .
 80+ $out .= '<div class="relationship-error-message">' .
 81+ wfMsg( 'ur-error-message-no-user' ) .
8282 '</div>
8383 <div class="relationship-request-buttons">
8484 <input type="button" class="site-button" value="' . wfMsg( 'ur-main-page' ) . '" onclick=\'window.location="index.php?title=' . wfMsgForContent( 'mainpage' ) . '"\' />';
@@ -108,7 +108,9 @@
109109 $total = $friend_count;
110110 $rem = wfMsg( 'ur-remove-relationship-friend' );
111111 $output .= '<div class="back-links">
112 - <a href="' . $back_link->escapeFullURL() . '">' . wfMsg( 'ur-backlink', $rel->user_name ) . '</a>
 112+ <a href="' . $back_link->escapeFullURL() . '">' .
 113+ wfMsg( 'ur-backlink', $rel->user_name ) .
 114+ '</a>
113115 </div>
114116 <div class="relationship-count">' .
115117 wfMsgExt(
@@ -123,7 +125,9 @@
124126 $total = $foe_count;
125127 $rem = wfMsg( 'ur-remove-relationship-foe' );
126128 $output .= '<div class="back-links">
127 - <a href="' . $back_link->escapeFullURL() . '">' . wfMsg( 'ur-backlink', $rel->user_name ) . '</a>
 129+ <a href="' . $back_link->escapeFullURL() . '">' .
 130+ wfMsg( 'ur-backlink', $rel->user_name ) .
 131+ '</a>
128132 </div>
129133 <div class="relationship-count">'
130134 . wfMsgExt(
@@ -146,9 +150,9 @@
147151
148152 // Safe titles
149153 $user = Title::makeTitle( NS_USER, $relationship['user_name'] );
150 - $add_relationship_link = SpecialPage::getTitleFor( 'AddRelationship' );
151 - $remove_relationship_link = SpecialPage::getTitleFor( 'RemoveRelationship' );
152 - $give_gift_link = SpecialPage::getTitleFor( 'GiveGift' );
 154+ $addRelationshipLink = SpecialPage::getTitleFor( 'AddRelationship' );
 155+ $removeRelationshipLink = SpecialPage::getTitleFor( 'RemoveRelationship' );
 156+ $giveGiftLink = SpecialPage::getTitleFor( 'GiveGift' );
153157
154158 $avatar = new wAvatar( $relationship['user_id'], 'ml' );
155159
@@ -160,7 +164,8 @@
161165 $username_space = stripos( $relationship['user_name'], ' ' );
162166
163167 if ( ( $username_space == false || $username_space >= "30" ) && $username_length > 30 ) {
164 - $user_name_display = substr( $relationship['user_name'], 0, 30 ) . ' ' . substr( $relationship['user_name'], 30, 50 );
 168+ $user_name_display = substr( $relationship['user_name'], 0, 30 ) .
 169+ ' ' . substr( $relationship['user_name'], 30, 50 );
165170 } else {
166171 $user_name_display = $relationship['user_name'];
167172 }
@@ -174,15 +179,15 @@
175180 <div class=\"relationship-actions\">";
176181 if ( $indivRelationship == false ) {
177182 $output .= $wgLang->pipeList( array(
178 - '<a href="' . $add_relationship_link->escapeFullURL( 'user=' . $user_safe . '&rel_type=1' ) . '">' . wfMsg( 'ur-add-friend' ) . '</a>',
179 - '<a href="' . $add_relationship_link->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '">' . wfMsg( 'ur-add-foe' ) . '</a>',
 183+ '<a href="' . $addRelationshipLink->escapeFullURL( 'user=' . $user_safe . '&rel_type=1' ) . '">' . wfMsg( 'ur-add-friend' ) . '</a>',
 184+ '<a href="' . $addRelationshipLink->escapeFullURL( 'user=' . $user_safe . '&rel_type=2' ) . '">' . wfMsg( 'ur-add-foe' ) . '</a>',
180185 ''
181186 ) );
182187 } elseif ( $user_name == $wgUser->getName() ) {
183 - $output .= '<a href="' . $remove_relationship_link->escapeFullURL( 'user=' . $user_safe ) . '">' . $rem . '</a>';
 188+ $output .= '<a href="' . $removeRelationshipLink->escapeFullURL( 'user=' . $user_safe ) . '">' . $rem . '</a>';
184189 $output .= wfMsgExt( 'pipe-separator', 'escapenoentities' );
185190 }
186 - $output .= '<a href="' . $give_gift_link->escapeFullURL( 'user=' . $user_safe ) . '">' . wfMsg( 'ur-give-gift' ) . '</a>';
 191+ $output .= '<a href="' . $giveGiftLink->escapeFullURL( 'user=' . $user_safe ) . '">' . wfMsg( 'ur-give-gift' ) . '</a>';
187192
188193 $output .= '</div>
189194 <div class="cleared"></div>
@@ -202,12 +207,12 @@
203208 $total = intval( str_replace( ',', '', $total ) );
204209 $numofpages = $total / $per_page;
205210
206 - $page_link = SpecialPage::getTitleFor( 'ViewRelationships' );
 211+ $pageLink = SpecialPage::getTitleFor( 'ViewRelationships' );
207212
208213 if ( $numofpages > 1 ) {
209214 $output .= '<div class="page-nav">';
210215 if ( $page > 1 ) {
211 - $output .= '<a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page - 1 ) ) . '">' . wfMsg( 'ur-previous' ) . '</a> ';
 216+ $output .= '<a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page - 1 ) ) . '">' . wfMsg( 'ur-previous' ) . '</a> ';
212217 }
213218
214219 if ( ( $total % $per_page ) != 0 ) {
@@ -224,19 +229,16 @@
225230 if ( $i == $page ) {
226231 $output .= ( $i . ' ' );
227232 } else {
228 - $output .= '<a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . $i ) . "\">$i</a> ";
 233+ $output .= '<a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . $i ) . "\">$i</a> ";
229234 }
230235 }
231236
232237 if ( ( $total - ( $per_page * $page ) ) > 0 ) {
233 - $output .= ' <a href="' . $page_link->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page + 1 ) ) . '">' . wfMsg( 'ur-next' ) . '</a>';
 238+ $output .= ' <a href="' . $pageLink->escapeFullURL( 'user=' . $user_name . '&rel_type=' . $rel_type . '&page=' . ( $page + 1 ) ) . '">' . wfMsg( 'ur-next' ) . '</a>';
234239 }
235240 $output .= '</div>';
236241 }
237242
238 - /**
239 - * Build next/prev nav
240 - */
241243 $wgOut->addHTML( $output );
242244 }
243245 }

Status & tagging log