I tried search the thread, but I wasn't able to find anything. I'm trying to let my members RSVP to an event from outside the calendar. I figrued I would just insert the fields into the database myself, but I'm having a little trouble figuring out what "ocdate" is exactly. I was able to find this part in the XML script and I found that that the ocdate field is inserted into the db by the $rsvpdate variable.
PHP Code:
// If the parameter wasn't passed, and this is recurring, get next event from today.
if ($eventinfo['recurring'] AND !$rsvpdate) {
DEVDEBUG('Fetching date from next event date');
$gettime = TIMENOW - $vbulletin->options['hourdiff'];
// find next occurence within one year.
while ($iterations < 365)
{
$addcache = false;
$todaydate = getdate($gettime);
if (cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year'], 1, false))
{
$rsvpdate = gmmktime(0, 0, 0, $todaydate['mon'], $todaydate['mday'], $todaydate['year']);
$iterations = 999999;
DEVDEBUG('Fetched - '.$rsvpdate);
}
$iterations++;
$gettime += 86400;
} // end while loop
}
I figured that the $gettime is the time and the hour difference, the getdate function puts the unix time into an array and is then converted using gmmktime. What I don't understand is the if statement
PHP Code:
if (cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year'], 1, false))
and how you're able to find out the next event date (if that matters at all or has anything to do with the "ocdate").
Thanks for the great mod!