You are here

function invite_create in Invite 7.2

Creates an empty invite object.

Return value

The invite object.

5 calls to invite_create()
example_create_invite in ./invite.api.php
Create an invite.
example_send_invite_email in ./invite.api.php
Send an invitation email.
invite_form_submit in ./invite.module
Forms API callback; process submitted form data.
invite_token_data in ./invite.module
Provide token data for use in invite message replacements.
invite_user_form_submit in ./invite.module
Implements the submit function associated with user_profile_form.

File

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

Code

function invite_create() {
  global $user;
  $inviter = $user;
  if ($inviter->uid == 0) {
    $inviter->name = t('Anonymous');
  }
  $invite = array(
    'reg_code' => invite_generate_code(),
    'email' => '',
    'uid' => $inviter->uid,
    'inviter' => $inviter,
    'invitee' => 0,
    'created' => REQUEST_TIME,
    'expiry' => REQUEST_TIME + variable_get('invite_expiry', 30) * 60 * 60 * 24,
    'joined' => 0,
    'canceled' => 0,
    'resent' => 0,
    'data' => array(
      'subject' => NULL,
      'message' => NULL,
    ),
  );
  return (object) $invite;
}