I still need some help with this. I managed to finally get it posting only upcoming events, and not events which have already past. However, now I'm getting the wrong dates displaying on the events. If an event is in the calendar for Feb 30, it displays on the non-vb page as being on Feb 29. All events are dated one day early.
Here's what I currently have.
PHP Code:
<?php
chdir("/home/vettehea/public_html/forums");
include('./global.php');
$events = $DB_site->query ("SELECT UNIX_TIMESTAMP( ) AS dateline, dateline_from, eventid, title
FROM event
WHERE calendarid = 1 AND dateline_from > UNIX_TIMESTAMP( )
ORDER BY dateline_from
LIMIT 10");
$vh_upcomingevents = "";
if ($DB_site->num_rows($events)) {
while ($event = $DB_site->fetch_array($events)) {
$timestring=$event['dateline_from'];
$dateevent=date("M j, Y",$timestring);
$vh_upcomingevents .= "$dateevent: <a href=\"/forums/calendar.php?$session[sessionurl]do=getinfo&day=$day&e=$event[eventid]&c=$event[calendarid]\">$event[title]</a><br />";
}
} else {
$vh_upcomingevents .= " -- no events currently listed -- ";
}
?>
I'd greatly appreciate any help clearing up this last issue to this for me.
I used your code and it works for me, plus the dates are all just fine. It isn't picking up all the events, however.. don't know why some are just missing. Could it be a timezone issue with your server maybe? (just grasping for straws) - maybe you could compensate by adding or subtracting one day... ?
One thing I have a problem with is how far out its reaching. It gets the next X number of events, regardless of the dates. I'd like to only display X number of events X days ahead. Currently my test board has 2 events next week and one Oct. of this year and its showing that one.... thats a bit too far out to be reminding people I think