Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -57,6 +57,8 @@ |
58 | 58 | if( $request->getVal( 'contribs' ) == 'newbie' ) { |
59 | 59 | $target = 'newbies'; |
60 | 60 | $this->opts['contribs'] = 'newbie'; |
| 61 | + } else { |
| 62 | + $this->opts['contribs'] = 'user'; |
61 | 63 | } |
62 | 64 | |
63 | 65 | $this->opts['deletedOnly'] = $request->getBool( 'deletedOnly' ); |
— | — | @@ -79,7 +81,7 @@ |
80 | 82 | } |
81 | 83 | $id = User::idFromName( $nt->getText() ); |
82 | 84 | |
83 | | - if( $target != 'newbies' ) { |
| 85 | + if( $this->opts['contribs'] != 'newbie' ) { |
84 | 86 | $target = $nt->getText(); |
85 | 87 | $out->setSubtitle( $this->contributionsSub( $nt, $id ) ); |
86 | 88 | $out->setHTMLTitle( wfMsg( 'pagetitle', wfMsgExt( 'contributions-title', array( 'parsemag' ),$target ) ) ); |
— | — | @@ -159,6 +161,7 @@ |
160 | 162 | |
161 | 163 | $pager = new ContribsPager( array( |
162 | 164 | 'target' => $target, |
| 165 | + 'contribs' => $this->opts['contribs'], |
163 | 166 | 'namespace' => $this->opts['namespace'], |
164 | 167 | 'year' => $this->opts['year'], |
165 | 168 | 'month' => $this->opts['month'], |
— | — | @@ -182,7 +185,7 @@ |
183 | 186 | $out->preventClickjacking( $pager->getPreventClickjacking() ); |
184 | 187 | |
185 | 188 | # Show the appropriate "footer" message - WHOIS tools, etc. |
186 | | - if( $target != 'newbies' ) { |
| 189 | + if( $this->opts['contribs'] != 'newbie' ) { |
187 | 190 | $message = 'sp-contributions-footer'; |
188 | 191 | if ( IP::isIPAddress( $target ) ) { |
189 | 192 | $message = 'sp-contributions-footer-anon'; |
— | — | @@ -439,6 +442,7 @@ |
440 | 443 | } |
441 | 444 | |
442 | 445 | $this->target = isset( $options['target'] ) ? $options['target'] : ''; |
| 446 | + $this->contribs = isset( $options['contribs'] ) ? $options['contribs'] : 'users'; |
443 | 447 | $this->namespace = isset( $options['namespace'] ) ? $options['namespace'] : ''; |
444 | 448 | $this->tagFilter = isset( $options['tagFilter'] ) ? $options['tagFilter'] : false; |
445 | 449 | |
— | — | @@ -506,7 +510,7 @@ |
507 | 511 | $condition = array(); |
508 | 512 | $join_conds = array(); |
509 | 513 | $tables = array( 'revision', 'page', 'user' ); |
510 | | - if( $this->target == 'newbies' ) { |
| 514 | + if( $this->contribs == 'newbie' ) { |
511 | 515 | $tables[] = 'user_groups'; |
512 | 516 | $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ ); |
513 | 517 | $condition[] = 'rev_user >' . (int)($max - $max / 100); |
— | — | @@ -544,6 +548,21 @@ |
545 | 549 | return 'rev_timestamp'; |
546 | 550 | } |
547 | 551 | |
| 552 | + function doBatchLookups() { |
| 553 | + if ( $this->contribs === 'newbie' ) { // multiple users |
| 554 | + # Do a link batch query |
| 555 | + $this->mResult->seek( 0 ); |
| 556 | + $batch = new LinkBatch(); |
| 557 | + # Give some pointers to make (last) links |
| 558 | + foreach ( $this->mResult as $row ) { |
| 559 | + $batch->addObj( Title::makeTitleSafe( NS_USER, $row->rev_user_name ) ); |
| 560 | + $batch->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->rev_user_name ) ); |
| 561 | + } |
| 562 | + $batch->execute(); |
| 563 | + $this->mResult->seek( 0 ); |
| 564 | + } |
| 565 | + } |
| 566 | + |
548 | 567 | function getStartBody() { |
549 | 568 | return "<ul>\n"; |
550 | 569 | } |
— | — | @@ -672,7 +691,7 @@ |
673 | 692 | |
674 | 693 | # Show user names for /newbies as there may be different users. |
675 | 694 | # Note that we already excluded rows with hidden user names. |
676 | | - if( $this->target == 'newbies' ) { |
| 695 | + if( $this->contribs == 'newbie' ) { |
677 | 696 | $userlink = ' . . ' . Linker::userLink( $rev->getUser(), $rev->getUserText() ); |
678 | 697 | $userlink .= ' ' . wfMsg( 'parentheses', |
679 | 698 | Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) ) . ' '; |