You are here

function invite_load in Invite 6.2

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

Load an invite record for a tracking code.

Parameters

$code: A registration code to load the invite record for.

Return value

An invite record.

4 calls to invite_load()
invite_form_alter in ./invite.module
Implementation of hook_form_alter().
invite_load_from_session in ./invite.module
Returns an invite record from an invite code stored in the user's session.
invite_user in ./invite.module
Implementation of hook_user().
invite_user_register_access in ./invite.module
Access callback; determine access to user registration form.

File

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

Code

function invite_load($code) {
  $result = db_query("SELECT * FROM {invite} WHERE reg_code = '%s' AND canceled = 0", $code);
  if ($invite = db_fetch_object($result)) {
    $invite->inviter = user_load(array(
      'uid' => $invite->uid,
    ));
    $invite->data = (array) unserialize($invite->data);
  }
  return $invite;
}