Hey Everyone.. ive made a mod to the code that grabs an event from the calendar and posts it.. here is the code i took from the main board php page to add to my vbindex code.. it works now but i just want to know how to do 1 thing... basically now all i have to do is call $upcomingevents and it puts the title and link to the calendar event but it includes the date which i do not want added.. ive searched through the code quite a bit but i cant figure out where its picking up the date.
example:
what it does....
Blah In The Mix Live - 04-05-2005
what i want it to do
Blah In The Mix Live
All help is very appreciated!
PHP Code:
// ### TODAY'S EVENTS #################################################
if ($vboptions['showevents'])
{
require_once('./includes/functions_calendar.php');
$future = gmdate('n-j-Y' , TIMENOW + 43200 + (86400 * ($vboptions['showevents'] - 1)));
$eventstore = unserialize($datastore['eventcache']);
if (!is_array($eventstore) OR $future != $eventstore['date'])
{
// Need to update!
require_once('./includes/functions_databuild.php');
$eventstore = build_events();
DEVDEBUG('Updated Events');
}
unset($eventstore['date']);
$events = array();
$eventcount = 0;
foreach ($eventstore AS $eventid => $eventinfo)
{
$offset = iif (!$eventinfo['utc'], $bbuserinfo['tzoffset'], $bbuserinfo['timezoneoffset']);
$eventinfo['dateline_from_user'] = $eventinfo['dateline_from'] + $offset * 3600;
$eventinfo['dateline_to_user'] = $eventinfo['dateline_to'] + $offset * 3600;
$gettime = TIMENOW - $vboptions['hourdiff'];
$iterations = 0;
if ($bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWCALENDAR OR ($eventinfo['holidayid'] AND $vboptions['showholidays']))
{
if ($eventinfo['userid'] == $bbuserinfo['userid'] OR $bbuserinfo['calendarpermissions']["$eventinfo[calendarid]"] & CANVIEWOTHERSEVENT OR ($eventinfo['holidayid'] AND $vboptions['showholidays']))
{
while ($iterations < $vboptions['showevents'])
{
$addcache = false;
$todaydate = getdate($gettime);
if ($eventinfo['holidayid'] AND $eventinfo['recurring'] == 6)
{
if ($eventinfo['recuroption'] == "$todaydate[mon]|$todaydate[mday]")
{
$addcache = true;
}
}
else if (cache_event_info($eventinfo, $todaydate['mon'], $todaydate['mday'], $todaydate['year']))
{
$addcache = true;
}
if ($addcache)
{
if (!$vboptions['showeventtype'])
{
$events["$eventinfo[eventid]"][] = $gettime;
}
else
{
$events["$gettime"][] = $eventinfo['eventid'];
}
$eventcount++;
}
$iterations++;
$gettime += 86400;
}
}
}
}
if (!empty($events))
{
ksort($events, SORT_NUMERIC);
foreach($events AS $index => $value)
{
$pastevent = 0;
$pastcount = 0;
unset($eventdates, $comma, $daysevents);
if (!$vboptions['showeventtype'])
{ // Group by Event // $index = $eventid
unset($day);
foreach($value AS $key => $dateline)
{
if (($dateline - 86400) == $pastevent AND !$eventinfo['holidayid'])
{
$pastevent = $dateline;
$pastcount++;
continue;
}
else
{
if ($pastcount)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $eventdates, vbdate($vboptions['dateformat'], $pastevent, false, true, false));
}
$pastcount = 0;
$pastevent = $dateline;
}
if (!$day)
{
$day = vbdate('Y-n-j', $dateline, false, false, false);
}
$eventdates .= $comma . vbdate($vboptions['dateformat'], $dateline, false, true, false);
$comma = ', ';
$eventinfo = $eventstore["$index"];
}
if ($pastcount)
{
$eventdates = construct_phrase($vbphrase['event_x_to_y'], $eventdates, vbdate($vboptions['dateformat'], $pastevent, false, true, false));
}
if ($eventinfo['holidayid'])
{
$callink = "<a href=\"calendar.php?$session[sessionurl]do=getinfo&day=$day\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$callink = "<a href=\"calendar.php?$session[sessionurl]do=getinfo&day=$day&e=$eventinfo[eventid]&c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
}
else
{ // Group by Date
$eventdate = vbdate($vboptions['dateformat'], $index, false, true, false);
$day = vbdate('Y-n-j', $index, false, false);
foreach($value AS $key => $eventid)
{
$eventinfo = $eventstore["$eventid"];
if ($eventinfo['holidayid'])
{
$daysevents .= $comma . "<a href=\"calendar.php?$session[sessionurl]do=getinfo&day=$day\">" . $vbphrase['holiday_title_' . $eventinfo['varname']] . "</a>";
}
else
{
$daysevents .= $comma . "<a href=\"calendar.php?$session[sessionurl]do=getinfo&day=$day&e=$eventinfo[eventid]&c=$eventinfo[calendarid]\">$eventinfo[title]</a>";
}
$comma = ', ';
}
}
eval('$upcomingevents .= "' . fetch_template('forumhome_event') . '";');
}
// memory saving
unset($events, $eventstore);
}
$show['upcomingevents'] = iif ($upcomingevents, true, false);
$show['todaysevents'] = iif ($vboptions['showevents'] == 1, true, false);
}
else
{
$show['upcomingevents'] = false;
}