r55446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55445‎ | r55446 | r55447 >
Date:21:39, 21 August 2009
Author:nimishg
Status:deferred
Tags:
Comment:
Make the user_daily_contribs table behave properly
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php
@@ -65,7 +65,7 @@
6666 global $wgUser;
6767
6868 // convert to just the day
69 - $time = gmdate( 'Ymd', wfTimestamp( TS_UNIX, $ts ) );
 69+ $time = gmdate( 'Y-m-d', wfTimestamp( TS_UNIX, $ts ) );
7070
7171 $dbr = wfGetDB( DB_SLAVE );
7272
@@ -74,7 +74,7 @@
7575 'SUM(contribs)',
7676 array(
7777 'user_id' => $wgUser->getId(),
78 - "day < '$time'"
 78+ "day >= '$time'"
7979 ),
8080 __METHOD__
8181 );
@@ -98,6 +98,7 @@
9999 $sql =
100100 "INSERT INTO user_daily_contribs (user_id,day,contribs) VALUES ({$wgUser->getId()},$today,1) ON DUPLICATE KEY UPDATE contribs=contribs+1;";
101101 $dbw->query($sql, __METHOD__);
 102+
102103 return true;
103104 }
104105
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php
@@ -5,6 +5,7 @@
66 * @file
77 * @ingroup API
88 */
 9+
910 class ApiClickTracking extends ApiBase {
1011
1112 /**
@@ -12,7 +13,7 @@
1314 * @see includes/api/ApiBase#execute()
1415 */
1516 public function execute(){
16 - global $wgUser, $wgTitle;
 17+ global $wgUser, $wgTitle, $wgClickTrackContribTimeValue;
1718
1819 $params = $this->extractRequestParams();
1920 $this->validateParams( $params );

Status & tagging log