From: Ævar Arnfjörð Bjarmason Date: Sat, 9 Jul 2005 16:59:00 +0000 (+0000) Subject: * Added a new function, edits(), for counting contributions. X-Git-Tag: 1.5.0beta4~187 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=503cdc10803495ef188b8f92c6bcd865ef97864b;p=lhc%2Fweb%2Fwiklou.git * Added a new function, edits(), for counting contributions. --- diff --git a/includes/User.php b/includes/User.php index 58118b5b40..42a6a89970 100644 --- a/includes/User.php +++ b/includes/User.php @@ -225,6 +225,23 @@ class User { (false !== strpos( $addr, '@' ) ); } + /** + * Count the number of edits of a user + * + * @param int $uid The user ID to check + * @return int + */ + function edits( $uid ) { + $fname = 'User::editCount'; + + $dbr =& wfGetDB( DB_SLAVE ); + return $dbr->selectField( + 'revision', 'count(*)', + array( 'rev_user' => $uid ), + $fname + ); + } + /** * probably return a random password * @return string probably a random password