How do I make a feature so that users can donate their points to the admin. This would help alot as I dont want to use the ecommerence mod but I want the users to only be able to donate their points to the admin with some type of log for at lesat the admin... If this is possible some how PLEASE let me know as soon as possible thanks!

Comments

kbahey’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

Try something like this in a module called userpoints_donate.module. I have not tried it, but it should work.

function userpoints_donate_userpoints($op, $points = 0, &$uid = 0, $event = '') {
  switch($op) {
    case 'points before':
        $uid = 1;
  }
}

This will force all points to go to the admin.

Hara Kim’s picture

What do i need to do just install the mod and then make a donate button or link im not sure how to do that.. Can you tell me how to do that?

Hara Kim’s picture

i tried making a file and uploaded to the mod directory but it didnt seem to work. I am getting errors though so am I suppose to put it in the userpoints directory or where thanks for the help[

kbahey’s picture

You also need a .info file.

I assume that you know how to write a module, otherwise, read the Handbooks on drupal.org.

Please copy/paste the errors here.

Hara Kim’s picture

do you mean something like this

//This is my module

function userpoints_donate_userpoints($op, $points = 0, &$uid = 0, $event = '') {
  switch($op) {
    case 'points before':
        $uid = 1;
  }
}

What s a .info file?