Index: trunk/extensions/SocialProfile/UserActivity/UserActivityClass.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | ORDER BY rc_id DESC LIMIT 0," . $this->item_max; |
85 | 85 | $res = $dbr->query( $sql, __METHOD__ ); |
86 | 86 | |
87 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 87 | + foreach ( $res as $row ) { |
88 | 88 | // Special pages aren't editable, so ignore them |
89 | 89 | if ( $row->rc_namespace == NS_SPECIAL ) { |
90 | 90 | continue; |
— | — | @@ -145,7 +145,7 @@ |
146 | 146 | {$rel_sql} {$user_sql} |
147 | 147 | ORDER BY vote_date DESC LIMIT 0," . $this->item_max; |
148 | 148 | $res = $dbr->query( $sql, __METHOD__ ); |
149 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 149 | + foreach ( $res as $row ) { |
150 | 150 | $username = $row->username; |
151 | 151 | $this->items[] = array( |
152 | 152 | 'id' => 0, |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | ORDER BY comment_date DESC LIMIT 0," . $this->item_max; |
192 | 192 | |
193 | 193 | $res = $dbr->query( $sql, __METHOD__ ); |
194 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 194 | + foreach ( $res as $row ) { |
195 | 195 | $show_comment = true; |
196 | 196 | |
197 | 197 | global $wgFilterComments; |
— | — | @@ -255,7 +255,7 @@ |
256 | 256 | {$rel_sql} {$user_sql} |
257 | 257 | ORDER BY ug_id DESC LIMIT 0,{$this->item_max}"; |
258 | 258 | $res = $dbr->query( $sql, __METHOD__ ); |
259 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 259 | + foreach ( $res as $row ) { |
260 | 260 | $this->items[] = array( |
261 | 261 | 'id' => $row->ug_id, |
262 | 262 | 'type' => 'gift-sent', |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | {$rel_sql} {$user_sql} |
294 | 294 | ORDER BY ug_id DESC LIMIT 0,{$this->item_max}"; |
295 | 295 | $res = $dbr->query( $sql, __METHOD__ ); |
296 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 296 | + foreach ( $res as $row ) { |
297 | 297 | global $wgUploadPath; |
298 | 298 | $user_title = Title::makeTitle( NS_USER, $row->ug_user_name_to ); |
299 | 299 | $user_title_from = Title::makeTitle( NS_USER, $row->ug_user_name_from ); |
— | — | @@ -352,7 +352,7 @@ |
353 | 353 | {$rel_sql} {$user_sql} |
354 | 354 | ORDER BY sg_id DESC LIMIT 0,{$this->item_max}"; |
355 | 355 | $res = $dbr->query( $sql, __METHOD__ ); |
356 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 356 | + foreach ( $res as $row ) { |
357 | 357 | global $wgUploadPath; |
358 | 358 | $user_title = Title::makeTitle( NS_USER, $row->sg_user_name ); |
359 | 359 | $system_gift_image = '<img src="' . $wgUploadPath . '/awards/' . SystemGifts::getGiftImage( $row->gift_id, 'm' ) . '" border="0" alt="" />'; |
— | — | @@ -405,7 +405,7 @@ |
406 | 406 | ORDER BY r_id DESC LIMIT 0,{$this->item_max}"; |
407 | 407 | $res = $dbr->query( $sql, __METHOD__ ); |
408 | 408 | |
409 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 409 | + foreach ( $res as $row ) { |
410 | 410 | if ( $row->r_type == 1 ) { |
411 | 411 | $r_type = 'friend'; |
412 | 412 | } else { |
— | — | @@ -469,7 +469,7 @@ |
470 | 470 | ORDER BY ub_id DESC LIMIT 0,{$this->item_max}"; |
471 | 471 | |
472 | 472 | $res = $dbr->query( $sql, __METHOD__ ); |
473 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 473 | + foreach ( $res as $row ) { |
474 | 474 | // Ignore nonexistent (for example, renamed) users |
475 | 475 | $uid = User::idFromName( $row->ub_user_name ); |
476 | 476 | if ( !$uid ) { |
— | — | @@ -525,7 +525,7 @@ |
526 | 526 | {$rel_sql} {$user_sql} |
527 | 527 | ORDER BY um_id DESC LIMIT 0,{$this->item_max}"; |
528 | 528 | $res = $dbr->query( $sql, __METHOD__ ); |
529 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 529 | + foreach ( $res as $row ) { |
530 | 530 | $user_title = Title::makeTitle( NS_USER, $row->um_user_name ); |
531 | 531 | $user_name_short = substr( $row->um_user_name, 0, 15 ); |
532 | 532 | if ( $row->um_user_name != $user_name_short ) { |