r12875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12874‎ | r12875 | r12876 >
Date:18:07, 26 January 2006
Author:robchurch
Status:old
Tags:
Comment:
Include deleted edits in the CountEdits support function; will affect removeUnusedAccounts script
Modified paths:
  • /trunk/phase3/maintenance/userFunctions.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/userFunctions.inc
@@ -17,9 +17,16 @@
1818 */
1919 function CountEdits( $user, $slave = true ) {
2020 $dbw =& wfGetDB( $slave ? DB_SLAVE: DB_MASTER );
 21+ # Count current edits
2122 $res = $dbw->select( 'revision', 'COUNT(rev_id) AS count', array( 'rev_user' => $user ) );
2223 $row = $dbw->fetchObject( $res );
23 - return( $row->count );
 24+ $count = $row->count;
 25+ # Count deleted edits
 26+ $res = $dbw->select( 'archive', 'COUNT(*) AS count', array( 'ar_user' => $user ) );
 27+ $row = $dbw->fetchObject( $res );
 28+ $count += $row->count;
 29+ # Done
 30+ return( $count );
2431 }
2532
2633 /**

Status & tagging log