Ability to "buy access" if user already has enough userpoints. This should automatically deduct the points, and then entitle the user to limited or unlimited viewing of node.

I guess this may involve integration with userpoints_node_action module or not?

Comments

zeezhao’s picture

Category: feature » bug

Looking at userpoints_nodeaccess.module, code is there but not working. So appears to be a bug.

edit:
Did some debugging, and could only get it to work by first calling: upaccess/node_id

where node_id is id of node.

So something to do with this being called automatically, but could not figure it out, as new to the code...

@betz - please help out there. Thanks

/**
* @see userpoints_nodeaccess_buy_access_form()
*/
function userpoints_nodeaccess_buy_access_form_submit($form, &$form_state) {
drupal_goto('upaccess/'.$form_state['values']['nid']);
}