_rsvp_is_invited

Definition

_rsvp_is_invited($nid, $uid = NULL)
rsvp/rsvp.module, line 1556

Description

  • Checks to see if a user has been invited to an event.
*
  • *

Parameters

$nid The node id of the event.

  • @param $uid The uid of the user. If null, it uses global $user->uid.
  • @return boolean. True if user has been invited to the event.

Code

<?php
function _rsvp_is_invited($nid, $uid = NULL) {
  if (!$uid) {
    global $user;
    if ($user->uid) {
      $uid = $user->uid;
    }
    else {
      return FALSE;
    }
    
  }

  if (db_num_rows(db_query('SELECT u.uid FROM {rsvp} r LEFT JOIN {rsvp_invite} u ON r.rid = u.rid WHERE r.nid = %d AND u.uid = %d', $nid, $uid)) > 0) {
    return TRUE;
  }
  return FALSE;
}
?>