r10031 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10030‎ | r10031 | r10032 >
Date:16:59, 9 July 2005
Author:avar
Status:old
Tags:
Comment:
* Added a new function, edits(), for counting contributions.
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -226,6 +226,23 @@
227227 }
228228
229229 /**
 230+ * Count the number of edits of a user
 231+ *
 232+ * @param int $uid The user ID to check
 233+ * @return int
 234+ */
 235+ function edits( $uid ) {
 236+ $fname = 'User::editCount';
 237+
 238+ $dbr =& wfGetDB( DB_SLAVE );
 239+ return $dbr->selectField(
 240+ 'revision', 'count(*)',
 241+ array( 'rev_user' => $uid ),
 242+ $fname
 243+ );
 244+ }
 245+
 246+ /**
230247 * probably return a random password
231248 * @return string probably a random password
232249 * @static

Status & tagging log