I'm tring to transfer points between 2 users, the following is my step:
1. Enable 2 modules, "userpoints" and "User to User Points".
2. Use User management -> Points -> add to add points to user 1
3. Use give points function to send some points to user 2

But I found the points of the 2 users are still the same, any idea ?

CommentFileSizeAuthor
#3 user2userpoints.module_0.txt2.63 KBerwinova

Comments

debsjenkins’s picture

I'm having the same problem
Debs

dennys’s picture

I tried to modify user2userpoints.module and I can transfer points now.

line 63
old:

//return $form;

new:

return user2userpoints_submit($form);

line 91-100
old:

function user2userpoints_submit($form_id, $form_values) {
  global $user;

  $points = $form_values['amount'];
  $to = user_load(array('name' => $form_values['to']));

  userpoints_userpointsapi('points', $points, $to->uid, 'From: ' . $user->name);
  userpoints_userpointsapi('points', -$points, $user->uid, 'To: ' . $to->name);
}

new:

function user2userpoints_submit($form_values) {
  global $user;
  $points = (int)$form_values['amount'];
  $to = user_load(array('uid' => $form_values['to']));

  userpoints_userpointsapi('points', $points, $to->uid, 'From: ', $user->name);
  userpoints_userpointsapi('points', $points * -1, $user->uid, 'To: ' . $to->name);
}
erwinova’s picture

StatusFileSize
new2.63 KB

or replace user2userpoints.module with this attached file.

dennys’s picture

Status: Active » Needs review

Thanks, please use erwinova's patch, my patch still have problems.

jredding’s picture

Project: User Points » User Points Contributed modules
Version: 5.x-2.14 » 5.x-2.0
nainainai’s picture

Status: Closed (fixed) » Needs review

Sorry, but none of them are working for me. Any idea?

EDIT: sorry if i open this again. I am using 5.x-3.3 for userpoints.

jredding’s picture

Status: Needs review » Closed (fixed)

you are using incorrect versions. Please read the frontpage of both projects regarding versions.

nainainai’s picture

Status: Needs review » Closed (fixed)

Problem solved, thanks for the fast reply