You are here

function invite_save in Invite 5

Same name and namespace in other branches
  1. 5.2 invite.module \invite_save()
  2. 6.2 invite.module \invite_save()
  3. 7.4 invite.module \invite_save()
  4. 7.2 invite.module \invite_save()

Save an invite to the database.

Parameters

$edit: Associative array of data to store.

Return value

The result of the database operation.

1 call to invite_save()
invite_form_submit in ./invite.module
Forms API callback; processes the incoming form data.

File

./invite.module, line 1047
Allows your users to send and track invitations to join your site.

Code

function invite_save($edit) {
  $edit = (array) $edit;
  $expiry = time() + variable_get('invite_expiry', 30) * 60 * 60 * 24;
  $data = serialize($edit['data']);
  return db_query("INSERT INTO {invite} (email, reg_code, uid, expiry, data) VALUES ('%s', '%s', %d, %d, '%s')", $edit['email'], $edit['code'], $edit['inviter']->uid, $expiry, $data);
}