Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | |
13 | 13 | /* Static Functions */ |
14 | 14 | public static function schema() { |
15 | | - global $wgExtNewTables, $wgExtNewFields; |
| 15 | + global $wgExtNewTables; |
16 | 16 | |
17 | 17 | $wgExtNewTables[] = array( |
18 | 18 | 'click_tracking', |
— | — | @@ -29,26 +29,23 @@ |
30 | 30 | * @param $contribs contributions the user has made (or NULL if user not logged in) |
31 | 31 | * @return true if the event was stored in the DB |
32 | 32 | */ |
33 | | - public static function trackEvent($is_logged_in, $namespace, $event_id, $contribs=-1){ |
| 33 | + public static function trackEvent($is_logged_in, $namespace, $event_id, $contribs=0){ |
34 | 34 | |
35 | 35 | $dbw = wfGetDB( DB_MASTER ); |
36 | | - if ($contribs < 0) { //meaning the user is not logged in |
37 | | - $contribs = "NULL"; |
38 | | - } |
39 | | - |
| 36 | + |
40 | 37 | $dbw->begin(); |
41 | 38 | // Builds insert information |
| 39 | + |
42 | 40 | $data = array( |
43 | | - 'is_logged_in' => $is_logged_in, |
| 41 | + 'is_logged_in' => (bool) $is_logged_in, |
44 | 42 | 'namespace' => (int) $namespace, |
45 | 43 | 'event_id' => (int) $event_id, |
46 | | - 'user_contribs' => $contribs |
| 44 | + 'user_contribs' => ($is_logged_in?$contribs:null) |
47 | 45 | ); |
48 | 46 | |
49 | 47 | $db_status = $dbw->insert('click_tracking', $data, __METHOD__); |
50 | 48 | $dbw->commit(); |
51 | 49 | return $db_status; |
52 | 50 | } |
53 | | - |
54 | | - |
| 51 | + |
55 | 52 | } |
\ No newline at end of file |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php |
— | — | @@ -18,8 +18,6 @@ |
19 | 19 | |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | | -$wgClickTrackStyleVersion = 1; |
23 | | - |
24 | 22 | //functions should check if this is set before logging clicktrack events |
25 | 23 | $wgClickTrackEnabled = true; |
26 | 24 | |
— | — | @@ -29,8 +27,7 @@ |
30 | 28 | 'name' => 'Click Tracking', |
31 | 29 | 'author' => 'Nimish Gautam', |
32 | 30 | 'version' => '0.1.1', |
33 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative', |
34 | | - 'descriptionmsg' => 'clicktracking-desc', |
| 31 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:UsabilityInitiative' |
35 | 32 | ); |
36 | 33 | |
37 | 34 | // Includes parent extension |
— | — | @@ -41,4 +38,3 @@ |
42 | 39 | dirname( __FILE__ ) . '/ClickTracking.hooks.php'; |
43 | 40 | |
44 | 41 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ClickTrackingHooks::schema'; |
45 | | - |