Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | global $wgUser; |
67 | 67 | |
68 | 68 | // convert to just the day |
69 | | - $time = gmdate( 'Ymd', wfTimestamp( TS_UNIX, $ts ) ); |
| 69 | + $time = gmdate( 'Y-m-d', wfTimestamp( TS_UNIX, $ts ) ); |
70 | 70 | |
71 | 71 | $dbr = wfGetDB( DB_SLAVE ); |
72 | 72 | |
— | — | @@ -74,7 +74,7 @@ |
75 | 75 | 'SUM(contribs)', |
76 | 76 | array( |
77 | 77 | 'user_id' => $wgUser->getId(), |
78 | | - "day < '$time'" |
| 78 | + "day >= '$time'" |
79 | 79 | ), |
80 | 80 | __METHOD__ |
81 | 81 | ); |
— | — | @@ -98,6 +98,7 @@ |
99 | 99 | $sql = |
100 | 100 | "INSERT INTO user_daily_contribs (user_id,day,contribs) VALUES ({$wgUser->getId()},$today,1) ON DUPLICATE KEY UPDATE contribs=contribs+1;"; |
101 | 101 | $dbw->query($sql, __METHOD__); |
| 102 | + |
102 | 103 | return true; |
103 | 104 | } |
104 | 105 | |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php |
— | — | @@ -5,6 +5,7 @@ |
6 | 6 | * @file |
7 | 7 | * @ingroup API |
8 | 8 | */ |
| 9 | + |
9 | 10 | class ApiClickTracking extends ApiBase { |
10 | 11 | |
11 | 12 | /** |
— | — | @@ -12,7 +13,7 @@ |
13 | 14 | * @see includes/api/ApiBase#execute() |
14 | 15 | */ |
15 | 16 | public function execute(){ |
16 | | - global $wgUser, $wgTitle; |
| 17 | + global $wgUser, $wgTitle, $wgClickTrackContribTimeValue; |
17 | 18 | |
18 | 19 | $params = $this->extractRequestParams(); |
19 | 20 | $this->validateParams( $params ); |