_rsvp_get_rsvps

Definition

_rsvp_get_rsvps($nid = NULL, $uid = NULL, $tablesort = ' ORDER BY nid')
rsvp/rsvp.module, line 1429

Description

  • Returns the rsvps that a user is the owner of.
*
  • *

Parameters

$uid The uid of the user.

  • @return dbresultset of rsvps.

Code

<?php
function _rsvp_get_rsvps($nid = NULL, $uid = NULL, $tablesort = ' ORDER BY nid') {
  if (!$uid) {
    global $user;
    $uid = $user->uid;
  }
  $query = 'SELECT r.*, n.title FROM {rsvp} r INNER JOIN {node} n ON r.nid = n.nid WHERE r.uid = %d';
  if (!is_null($nid)) {
    if (is_array($nid)) {
      $query .= ' AND r.nid IN (%s)';
      $nid = implode(', ', $nid);
    }
    elseif (is_numeric($nid)) {
      $query .= ' AND r.nid = %d';
    }
  }
  $query .= $tablesort;
  return db_query($query, $uid, $nid);
}
?>