Index: maintenance/archives/patch-rc_patrolled_by.sql =================================================================== --- maintenance/archives/patch-rc_patrolled_by.sql (revision 0) +++ maintenance/archives/patch-rc_patrolled_by.sql (revision 0) @@ -0,0 +1,9 @@ +-- +-- patch-rc-patrolled_by.sql +-- Adds two colloms to recentchanges for recording who patrolled the change +-- 2007-01-16 +-- + +ALTER TABLE /*$wgDBprefix*/recentchanges + ADD `rc_patrolled_by` INT( 10 ) UNSIGNED NULL AFTER `rc_patrolled` , + ADD `rc_patrolled_by_text` VARCHAR( 255 ) binary NULL AFTER `rc_patrolled_by` ; Index: maintenance/updaters.inc =================================================================== --- maintenance/updaters.inc (revision 19335) +++ maintenance/updaters.inc (working copy) @@ -48,6 +48,7 @@ array( 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ), array( 'recentchanges', 'rc_id', 'patch-rc_id.sql' ), array( 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ), + array( 'recentchanges', 'rc_patrolled_by', 'patch-rc_patrolled_by.sql' ), array( 'recentchanges', 'rc_old_len', 'patch-rc_len.sql' ), array( 'user', 'user_real_name', 'patch-user-realname.sql' ), array( 'user', 'user_token', 'patch-user_token.sql' ), Index: maintenance/tables.sql =================================================================== --- maintenance/tables.sql (revision 19335) +++ maintenance/tables.sql (working copy) @@ -805,6 +805,8 @@ -- remove a warning flag on the RC list. -- A value of 1 indicates the page has been reviewed. rc_patrolled tinyint(3) unsigned NOT NULL default '0', + rc_patrolled_by int(10) unsigned NULL, + rc_patrolled_by_text varchar(255) binary NULL, -- Recorded IP address the edit was made from, if the -- $wgPutIPinRC option is enabled. Index: includes/Article.php =================================================================== --- includes/Article.php (revision 19335) +++ includes/Article.php (working copy) @@ -1347,7 +1347,7 @@ # Mark as patrolled if the user can do so if( $wgUser->isAllowed( 'autopatrol' ) ) { - RecentChange::markPatrolled( $rcid ); + RecentChange::markPatrolled( $rcid, $wgUser ); } } $wgUser->incEditCount(); @@ -1408,7 +1408,7 @@ '', strlen( $text ), $revisionId ); # Mark as patrolled if the user can if( $wgUser->isAllowed( 'autopatrol' ) ) { - RecentChange::markPatrolled( $rcid ); + RecentChange::markPatrolled( $rcid, $wgUser ); } } $wgUser->incEditCount(); @@ -1513,7 +1513,7 @@ } # Mark the edit as patrolled - RecentChange::markPatrolled( $rcid ); + RecentChange::markPatrolled( $rcid, $wgUser ); wfRunHooks( 'MarkPatrolledComplete', array( &$rcid, &$wgUser, false ) ); # Inform the user @@ -2167,6 +2167,8 @@ if ( $wgUseRCPatrol ) { # Mark all reverted edits as patrolled $set['rc_patrolled'] = 1; + $set['rc_patrolled_by'] = $wgUser->getID(); + $set['rc_patrolled_by_text'] = $wgUser->getName(); } if ( $set ) { Index: includes/RecentChange.php =================================================================== --- includes/RecentChange.php (revision 19335) +++ includes/RecentChange.php (working copy) @@ -211,8 +211,12 @@ wfRunHooks( 'RecentChange_save', array( &$this ) ); } - # Marks a certain row as patrolled - function markPatrolled( $rcid ) + /// Marks a certain row as patrolled + /** + * @param $rcid int RecentChange id + * @param $user User Patrolled by... + */ + public static function markPatrolled( $rcid, &$user ) { $fname = 'RecentChange::markPatrolled'; @@ -220,7 +224,9 @@ $dbw->update( 'recentchanges', array( /* SET */ - 'rc_patrolled' => 1 + 'rc_patrolled' => 1, + 'rc_patrolled_by' => $user->getID(), + 'rc_patrolled_by_text' => $user->getName(), ), array( /* WHERE */ 'rc_id' => $rcid ), $fname @@ -263,6 +269,8 @@ 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => 0, + 'rc_patrolled_by' => NULL, + 'rc_patrolled_by_text' => NULL, 'rc_new' => 0, # obsolete 'rc_old_len' => $oldSize, 'rc_new_len' => $newSize @@ -317,6 +325,8 @@ 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => 0, + 'rc_patrolled_by' => NULL, + 'rc_patrolled_by_text' => NULL, 'rc_new' => 1, # obsolete 'rc_old_len' => 0, 'rc_new_len' => $size @@ -362,6 +372,8 @@ 'rc_ip' => $ip, 'rc_new' => 0, # obsolete 'rc_patrolled' => 1, + 'rc_patrolled_by' => $user->getID(), + 'rc_patrolled_by_text' => $user->getName(), 'rc_old_len' => NULL, 'rc_new_len' => NULL, ); @@ -413,6 +425,8 @@ 'rc_moved_to_title' => '', 'rc_ip' => $ip, 'rc_patrolled' => 1, + 'rc_patrolled_by' => $user->getID(), + 'rc_patrolled_by_text' => $user->getName(), 'rc_new' => 0, # obsolete 'rc_old_len' => NULL, 'rc_new_len' => NULL, @@ -459,6 +473,8 @@ 'rc_ip' => '', 'rc_id' => $row->rc_id, 'rc_patrolled' => $row->rc_patrolled, + 'rc_patrolled_by' => NULL, + 'rc_patrolled_by_text' => NULL, 'rc_new' => $row->page_is_new, # obsolete 'rc_old_len' => $row->rc_old_len, 'rc_new_len' => $row->rc_new_len, Index: includes/SpecialPage.php =================================================================== --- includes/SpecialPage.php (revision 19335) +++ includes/SpecialPage.php (working copy) @@ -156,7 +156,7 @@ */ static function initList() { global $wgSpecialPages; - global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication; + global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication, $wgUseRCPatrol; if ( self::$mListInitialised ) { return; @@ -178,6 +178,10 @@ self::$mList['Confirmemail'] = array( 'UnlistedSpecialPage', 'Confirmemail' ); } + if( $wgUseRCPatrol ) { + self::$mList['PatrolledChanges'] = array( 'SpecialPage', 'PatrolledChanges' ); + } + # Add extension special pages self::$mList = array_merge( self::$mList, $wgSpecialPages ); Index: includes/SpecialPatrolledChanges.php =================================================================== --- includes/SpecialPatrolledChanges.php (revision 0) +++ includes/SpecialPatrolledChanges.php (revision 0) @@ -0,0 +1,195 @@ +getInt( 'days' ); + $target = isset($par) ? $par : $wgRequest->getText( 'target' ); + $hideminor = $wgRequest->getBool( 'hideminor' ) ? 1 : 0; + + $wgOut->setPagetitle( wfMsg( 'patrolledchanges' ) ); + $sk = $wgUser->getSkin(); + + $form = '
'; + + $wgOut->addHTML( $form ); + + if( !$target ) { + return; + } + + # Validate the title + $nt = Title::newFromURL( $target ); + if( !is_object( $nt ) || !$nt->exists() ) { + $wgOut->addHTML( '' . wfMsgHtml( 'patrolledchanges-notfound' ) . '
' ); + return; + } + + $id = $nt->getArticleId(); + + $wgOut->setSubtitle( wfMsgHTML( 'patrolledchanges-subtitle', $sk->makeKnownLinkObj( $nt, "", "redirect=no" ) ) ); + + if ( !$days ) { + $days = (int)$wgUser->getOption( 'rcdays', 7 ); + } + list( $limit, /* offset */ ) = wfCheckLimits( 100, 'rclimit' ); + + $dbr =& wfGetDB( DB_SLAVE ); + $cutoff = $dbr->timestamp( time() - ( $days * 86400 ) ); + + $hideminor = ($hideminor ? 1 : 0); + if ( $hideminor ) { + $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'PatrolledChanges' ), + wfMsg( 'show' ), 'target=' . htmlspecialchars( $nt->getPrefixedURL() ) . + "&days={$days}&limit={$limit}&hideminor=0" ); + } else { + $mlink = $sk->makeKnownLink( $wgContLang->specialPage( 'PatrolledChanges' ), + wfMsg( "hide" ), "target=" . htmlspecialchars( $nt->getPrefixedURL() ) . + "&days={$days}&limit={$limit}&hideminor=1" ); + } + if ( $hideminor ) { + $cmq = 'AND rc_minor = 0'; + } else { + $cmq = ''; + } + + $recentchanges = $dbr->tableName( 'recentchanges' ); + + $sql = "SELECT * + FROM $recentchanges + WHERE rc_cur_id = $id + AND rc_timestamp > '{$cutoff}' + {$cmq} + ORDER BY rc_timestamp DESC + LIMIT {$limit}"; + + $res = $dbr->query( $sql, $fname ); + + $note = wfMsg( "rcnote", $limit, $days, $wgLang->timeAndDate( wfTimestampNow(), true ) ); + $wgOut->addHTML( "