Index: trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php |
— | — | @@ -193,6 +193,29 @@ |
194 | 194 | private function insertProperties( $revisionId, $user, $token, $params ) { |
195 | 195 | // Expertise is given as a list of one or more tags, such as profession, hobby, etc. |
196 | 196 | $this->insertProperty( $revisionId, $user, $token, 'expertise', $params['expertise'] ); |
| 197 | + // Capture edit counts as of right now for the past 1, 3 and 6 months as well as all time |
| 198 | + // - These time distances match the default configuration for the ClickTracking extension |
| 199 | + if ( $user->isLoggedIn() ) { |
| 200 | + $this->insertProperty( |
| 201 | + $revisionId, $user, $token, 'contribs-lifetime', (integer) $user->getEditCount() |
| 202 | + ); |
| 203 | + // Take advantage of the UserDailyContribs extension if it's present |
| 204 | + if ( function_exists( 'getUserEditCountSince' ) ) { |
| 205 | + $now = time(); |
| 206 | + $this->insertProperty( |
| 207 | + $revisionId, $user, $token, 'contribs-6-months', |
| 208 | + getUserEditCountSince( $now - ( 60 * 60 * 24 * 365 / 2 ) ) |
| 209 | + ); |
| 210 | + $this->insertProperty( |
| 211 | + $revisionId, $user, $token, 'contribs-3-months', |
| 212 | + getUserEditCountSince( $now - ( 60 * 60 * 24 * 365 / 4 ) ) |
| 213 | + ); |
| 214 | + $this->insertProperty( |
| 215 | + $revisionId, $user, $token, 'contribs-1-month', |
| 216 | + getUserEditCountSince( $now - ( 60 * 60 * 24 * 30 ) ) |
| 217 | + ); |
| 218 | + } |
| 219 | + } |
197 | 220 | } |
198 | 221 | |
199 | 222 | /** |