if( $count > 0 && isset( $options['delete'] ) ) {
echo( "\nDeleting inactive accounts..." );
$dbw =& wfGetDB( DB_MASTER );
- #$set = implode( ',', $del );
$dbw->delete( 'user', array( 'user_id' => $del ), $fname );
echo( "done.\n" );
+ # Update the site_stats.ss_users field
+ $users = $dbw->selectField( 'user', 'COUNT(*)', array(), $fname );
+ $dbw->update( 'site_stats', array( 'ss_users' => $users ), array( 'ss_row_id' => 1 ), $fname );
} else {
if( $count > 0 )
echo( "\nRun the script again with --delete to remove them from the database.\n" );