In function invvoucher_validate:
For some i have empty results with with $r = mysql_fetch_array

I had to change to db_fetch_array. This works for me

function invvoucher_validate($code) {
  $r = db_fetch_array(db_query("SELECT * FROM {invvoucher} WHERE code = '%s'", $code));
  if (!empty($r)) {
    if ($r['date_exp'] < time()) {// exp_date
      form_set_error('invvoucher_response', t('The code you entered has expired.'));
      return 0;
    }
    if ($r['reg_count'] == 0) { //quantity
      form_set_error('invvoucher_response', t('The code you entered can be used no more.'));
      return 0;
    }
    if ($r['code'] == $code) {
      return 1;
    }
  }
  form_set_error('invvoucher_response', t('The code you entered is incorrect.'));
  return 0;
}

Comments

dear_anton’s picture

Nice!
I'll check it as soon as possible :)

Great thanks!

duaelfr’s picture

Status: Active » Closed (won't fix)

This version of Invitation Voucher is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.