| View previous topic :: View next topic |
| Author |
Message |
sartzsche
Joined: 11 Sep 2007 Posts: 7
|
Posted: Mon Sep 10, 2007 10:29 pm Post subject: Display Past Events |
|
|
I'm want a web page to display past events, in a list view. I have the display working correctly for current and future events, but can't seem to figure out how to modify the code to display past events.
Here is a webpage to show the list view:
http://www.clickpoprecords.com/calendar/test/moreinfo.php
Here is the code I'm using for the current display:
| Code: |
// get event list
$events = $cal->get_event_list("year");
for($i = 0; $i < 365; $i++)
{
// if we don't have any events today move on
if(!count($events[$i])) {
continue;
}
// step through each event
foreach($events[$i] as $e)
{
echo("\n");
$e = $cal->get_event($e['id'], $e['instance']);
if($e->start < getlocaltime()){
continue;
}
echo("" . $cal->format_date("m.d", $e->start) ."\n --- ");
echo("url . "'>".$e->location." [" . "addr_st . " " . $e->addr_ci . "'>map]\n");
echo("". $e->addr_ci ."\n");
echo("". $e->notes ."\n");
echo("\n");
}
echo("\n\n");
}
|
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Tue Sep 11, 2007 3:05 am Post subject: |
|
|
Hi,
It looks like if you change this:
if($e->start < getlocaltime()){
to this:
if($e->start > getlocaltime()){
you should be set. |
|
| Back to top |
|
 |
sartzsche
Joined: 11 Sep 2007 Posts: 7
|
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Tue Sep 11, 2007 12:16 pm Post subject: |
|
|
Changing this:
for($i = 0; $i < 365; $i++)
to this ..
for($i = 364; $i >= 0; $i--)
should do it. |
|
| Back to top |
|
 |
sartzsche
Joined: 11 Sep 2007 Posts: 7
|
Posted: Tue Sep 11, 2007 6:18 pm Post subject: |
|
|
that did it.
Thank you, very much! |
|
| Back to top |
|
 |
|