Common subdirectories: userpoints/po and userpoints.new/po Common subdirectories: userpoints/tests and userpoints.new/tests Common subdirectories: userpoints/translations and userpoints.new/translations diff -up userpoints/userpoints.info userpoints.new/userpoints.info --- userpoints/userpoints.info 2009-03-29 20:24:24.000000000 -0400 +++ userpoints.new/userpoints.info 2009-02-17 19:23:48.000000000 -0500 @@ -4,9 +4,9 @@ description = Users earn points as they package = Userpoints core = 6.x -; Information added by drupal.org packaging script on 2009-03-30 +; Information added by drupal.org packaging script on 2009-02-18 version = "6.x-1.x-dev" core = "6.x" project = "userpoints" -datestamp = "1238372664" +datestamp = "1234916628" diff -up userpoints/userpoints.install userpoints.new/userpoints.install --- userpoints/userpoints.install 2009-03-29 15:13:04.000000000 -0400 +++ userpoints.new/userpoints.install 2009-03-30 10:27:05.000000000 -0400 @@ -1,5 +1,5 @@ 'float', 'not null' => true, 'default' => 0)); + db_change_field($ret, 'userpoints', 'points', 'points', array('type' => 'float', 'not null' => true, 'default' => 0)); + db_change_field($ret, 'userpoints', 'max_points', 'max_points', array('type' => 'float', 'not null' => true, 'default' => 0)); + return $ret; +} + + + + + Only in userpoints.new/: userpoints.install~ diff -up userpoints/userpoints.module userpoints.new/userpoints.module --- userpoints/userpoints.module 2009-02-17 10:21:23.000000000 -0500 +++ userpoints.new/userpoints.module 2009-03-29 22:07:27.000000000 -0400 @@ -440,9 +440,9 @@ function userpoints_get_current_points($ $tid = userpoints_get_default_tid(); } elseif ($tid == 'all') { - return (int)db_result(db_query('SELECT SUM(points) FROM {userpoints} WHERE uid = %d', $uid)); + return (float)db_result(db_query('SELECT SUM(points) FROM {userpoints} WHERE uid = %d', $uid)); } - return (int)db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d AND tid = %d', $uid, $tid)); + return (float)db_result(db_query('SELECT SUM(points) FROM {userpoints} WHERE uid = %d AND tid = %d', $uid, $tid)); } /** @@ -459,9 +459,9 @@ function userpoints_get_max_points($uid $tid = userpoints_get_default_tid(); } elseif ($tid == 'all') { - return (int)db_result(db_query('SELECT SUM(max_points) FROM {userpoints} WHERE uid = %d', $uid)); + return (float)db_result(db_query('SELECT SUM(max_points) FROM {userpoints} WHERE uid = %d', $uid)); } - return (int)db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d AND tid = %d', $uid, $tid)); + return (float)db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d AND tid = %d', $uid, $tid)); } /** @@ -709,7 +709,7 @@ function _userpoints_transaction(&$param $ret = db_query("INSERT INTO {userpoints_txn} (uid, points, time_stamp, status, operation, description, reference, expirydate, expired, parent_txn_id, tid, entity_id, entity_type) - VALUES (%d, %d, %d, %d, '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s')", + VALUES (%d, %f, %d, %d, '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s')", $params['uid'], $params['points'], time(), @@ -744,19 +744,19 @@ function _userpoints_update_cache(&$para } // Calculate the current points based upon the tid - $current_points = (int)$params['points'] + userpoints_get_current_points($params['uid'], $params['tid']); + $current_points = (float)$params['points'] + userpoints_get_current_points($params['uid'], $params['tid']); //Grab the user's maximum points to preserve it $max_points = db_result(db_query('SELECT max_points FROM {userpoints} WHERE uid = %d AND tid = %d', $params['uid'], $params['tid'])); if ($params['points'] > 0) { //points are greater than zero, update their max_points - $max_points = (int)$params['points'] + (int)$max_points; + $max_points = (float)$params['points'] + (float)$max_points; } // insert or update the userpoints caching table with the user's current points if (_userpoints_user_exists($params['uid'], $params['tid'])) { db_query("UPDATE {userpoints} - SET points = %d, max_points = %d, last_update = %d + SET points = %f, max_points = %f, last_update = %d WHERE uid = %d AND tid = %d", $current_points, $max_points, @@ -768,7 +768,7 @@ function _userpoints_update_cache(&$para else { $result = db_query("INSERT INTO {userpoints} (uid, points, max_points, last_update, tid) - VALUES (%d, %d, %d, %d, %d )", + VALUES (%d, %f, %f, %d, %d )", $params['uid'], $current_points, $max_points, @@ -1474,7 +1474,7 @@ function userpoints_block($op = 'list', if ($delta == -1) { $title = t('@user\'s !points', array_merge(array('@user' => $user->name), userpoints_translation()));; if ($user->uid) { - $points = (int) db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $user->uid)); + $points = (float) db_result(db_query('SELECT points FROM {userpoints} WHERE uid = %d', $user->uid)); $show_points = format_plural($points, '!point', '!points', userpoints_translation()); $content = t('You have %p %c', array('%p' => $points, '%c' => $show_points)); } diff -up userpoints/userpoints_rules.info userpoints.new/userpoints_rules.info --- userpoints/userpoints_rules.info 2009-03-29 20:24:24.000000000 -0400 +++ userpoints.new/userpoints_rules.info 2009-02-17 19:23:48.000000000 -0500 @@ -6,9 +6,9 @@ dependencies[] = rules package = Userpoints core = 6.x -; Information added by drupal.org packaging script on 2009-03-30 +; Information added by drupal.org packaging script on 2009-02-18 version = "6.x-1.x-dev" core = "6.x" project = "userpoints" -datestamp = "1238372664" +datestamp = "1234916628" Only in userpoints: userpoints_service.info Only in userpoints: userpoints_service.module