Home · Links · Contact Us
Home arrow Forums
Home
Features
FAQ
Screen Shots
Modules
Themes
Demos
Documentation
Forums
Contact Us
Download
Purchase
Quotes

" ... I want to tell you that your thyme product is functional and valuable beyond words. I cannot imagine why any portal would be without it. It is the cornerstone of our new project ..."

" ... Thanks for such a complete project, its making my job much easier. ..."

" ... I have now deployed 4 different calendars and our users love them ... "

" ... Easy to install and use and a great look/design. ..."

" ... This has to be the easiest to use program I think I've had to deal with at all this year. ..."


  FAQFAQ    SearchSearch  RegisterRegister   Log inLog in 
Display Past Events

 
Post new topic   Reply to topic     Forum Index -> Web site integration
View previous topic :: View next topic  
Author Message
sartzsche



Joined: 11 Sep 2007
Posts: 7

PostPosted: Mon Sep 10, 2007 10:29 pm    Post subject: Display Past Events Reply with quote

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." &nbsp; [" . "addr_st . "&nbsp;" . $e->addr_ci . "'>map]\n");
         
         echo("". $e->addr_ci ."\n");
         
         echo("". $e->notes ."\n");
               
            echo("\n");

        }

        echo("\n\n");

     }
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Tue Sep 11, 2007 3:05 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
sartzsche



Joined: 11 Sep 2007
Posts: 7

PostPosted: Tue Sep 11, 2007 5:08 am    Post subject: Reply with quote

Perfect! Thank you very much.

Now is there a way to invert the list so that the most recent dates are at the top [descending order]?

http://clickpoprecords.com/calendar/test/moreinfo.php
Back to top
View user's profile Send private message
esoft_ian



Joined: 12 Sep 2005
Posts: 5275

PostPosted: Tue Sep 11, 2007 12:16 pm    Post subject: Reply with quote

Changing this:

for($i = 0; $i < 365; $i++)

to this ..

for($i = 364; $i >= 0; $i--)

should do it.
Back to top
View user's profile Send private message Visit poster's website
sartzsche



Joined: 11 Sep 2007
Posts: 7

PostPosted: Tue Sep 11, 2007 6:18 pm    Post subject: Reply with quote

that did it.

Thank you, very much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Web site integration All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2005 eXtrovert software unless otherwise noted. All rights reserved.
Portions © 2004 Ben Brown. All rights reserved.
Trademarks are property of their respective owners.