You are here

function contribute_contribution in Contribute 6

1 call to contribute_contribution()
contribute_form_submit in ./contribute.module

File

./contribute.module, line 382
Lets users contribute to projects

Code

function contribute_contribution($uid, $nid, $amount) {
  $needed = contribute_get_node_balance($nid);
  contribute_update_user_balance($uid, $amount * -1);
  contribute_update_node_balance($nid, $amount);
  contribute_add_contribution_to_db($uid, $nid, $amount);
  if ($needed <= $amount) {
    drupal_set_message("uid - {$uid}, nid = {$nid}, amount = {$amount}");
    module_invoke_all('contribute_budget_reached', $nid);
  }
}