Index: trunk/phase3/includes/User.php |
— | — | @@ -226,6 +226,23 @@ |
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
| 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 | + /** |
230 | 247 | * probably return a random password |
231 | 248 | * @return string probably a random password |
232 | 249 | * @static |