Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -87,28 +87,6 @@ |
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | | - * Get the number of revisions a user has made since a given time |
92 | | - * |
93 | | - * @param $ts beginning timestamp |
94 | | - * @return number of revsions this user has made |
95 | | - */ |
96 | | - public static function getEditCountSince( $ts ) { |
97 | | - global $wgUser; |
98 | | - |
99 | | - // Convert to just the day |
100 | | - $time = gmdate( 'Y-m-d', wfTimestamp( TS_UNIX, $ts ) ); |
101 | | - $dbr = wfGetDB( DB_SLAVE ); |
102 | | - $edits = $dbr->selectField( |
103 | | - 'user_daily_contribs', |
104 | | - 'SUM(contribs)', |
105 | | - array( 'user_id' => $wgUser->getId(), 'day >= ' . $dbr->addQuotes( $time ) ), |
106 | | - __METHOD__ |
107 | | - ); |
108 | | - // User hasn't made any edits in whatever amount of time |
109 | | - return $edits == null ? 0 : $edits; |
110 | | - } |
111 | | - |
112 | | - /** |
113 | 91 | * Get event ID from name |
114 | 92 | * |
115 | 93 | * @param $event_name String: name of the event to get |
Index: trunk/extensions/ClickTracking/ApiClickTracking.php |
— | — | @@ -39,13 +39,13 @@ |
40 | 40 | $isLoggedIn = $wgUser->isLoggedIn(); |
41 | 41 | $now = time(); |
42 | 42 | $granularity1 = $isLoggedIn ? |
43 | | - ClickTrackingHooks::getEditCountSince( $now - $wgClickTrackContribGranularity1 ) : 0; |
| 43 | + getUserEditCountSince( $now - $wgClickTrackContribGranularity1 ) : 0; |
44 | 44 | |
45 | 45 | $granularity2 = $isLoggedIn ? |
46 | | - ClickTrackingHooks::getEditCountSince( $now - $wgClickTrackContribGranularity2 ) : 0; |
| 46 | + getUserEditCountSince( $now - $wgClickTrackContribGranularity2 ) : 0; |
47 | 47 | |
48 | 48 | $granularity3 = $isLoggedIn ? |
49 | | - ClickTrackingHooks::getEditCountSince( $now - $wgClickTrackContribGranularity3 ) : 0; |
| 49 | + getUserEditCountSince( $now - $wgClickTrackContribGranularity3 ) : 0; |
50 | 50 | |
51 | 51 | ClickTrackingHooks::trackEvent( |
52 | 52 | $sessionId, // randomly generated session ID |