Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -553,7 +553,8 @@ |
554 | 554 | 'fields' => array( |
555 | 555 | 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', |
556 | 556 | 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', |
557 | | - 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted' |
| 557 | + 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted', |
| 558 | + 'rc_old_len', 'rc_new_len' |
558 | 559 | ), |
559 | 560 | 'conds' => $conds, |
560 | 561 | 'options' => array( 'USE INDEX' => array('revision' => $index) ), |
— | — | @@ -572,21 +573,23 @@ |
573 | 574 | wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) ); |
574 | 575 | return $queryInfo; |
575 | 576 | } |
576 | | - |
577 | | - function getUserCond() { |
| 577 | + |
| 578 | + function getUserCond() { |
578 | 579 | $condition = array(); |
579 | 580 | $join_conds = array(); |
580 | 581 | if( $this->target == 'newbies' ) { |
581 | | - $tables = array( 'user_groups', 'page', 'revision' ); |
| 582 | + $tables = array( 'recentchanges', 'user_groups', 'page', 'revision' ); |
582 | 583 | $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ ); |
583 | 584 | $condition[] = 'rev_user >' . (int)($max - $max / 100); |
584 | 585 | $condition[] = 'ug_group IS NULL'; |
585 | 586 | $index = 'user_timestamp'; |
586 | 587 | # FIXME: other groups may have 'bot' rights |
587 | 588 | $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" ); |
| 589 | + $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" ); |
588 | 590 | } else { |
589 | | - $tables = array( 'page', 'revision' ); |
| 591 | + $tables = array( 'recentchanges', 'page', 'revision' ); |
590 | 592 | $condition['rev_user_text'] = $this->target; |
| 593 | + $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" ); |
591 | 594 | $index = 'usertext_timestamp'; |
592 | 595 | } |
593 | 596 | if( $this->deletedOnly ) { |
— | — | @@ -731,8 +734,19 @@ |
732 | 735 | } |
733 | 736 | |
734 | 737 | $diffHistLinks = '(' . $difftext . $this->messages['pipe-separator'] . $histlink . ')'; |
735 | | - $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$userlink} {$comment} {$topmarktext}"; |
| 738 | + |
| 739 | + $calculatedSize = $row->rc_new_len - $row->rc_old_len; |
| 740 | + $diffOut = ' . . '; |
| 741 | + if ( $calculatedSize === 0 ) { |
| 742 | + $diffOut .= "<span class='mw-plusminus-null'>($calculatedSize)</span>"; |
| 743 | + } elseif ( $calculatedSize > 0 ) { |
| 744 | + $diffOut .= "<span class='mw-plusminus-pos'>(+$calculatedSize)</span>"; |
| 745 | + } else { |
| 746 | + $diffOut .= "<span class='mw-plusminus-neg'>($calculatedSize)</span>"; |
| 747 | + } |
736 | 748 | |
| 749 | + $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$diffOut}{$userlink} {$comment} {$topmarktext}"; |
| 750 | + |
737 | 751 | # Denote if username is redacted for this edit |
738 | 752 | if( $rev->isDeleted( Revision::DELETED_USER ) ) { |
739 | 753 | $ret .= " <strong>" . wfMsgHtml('rev-deleted-user-contribs') . "</strong>"; |