PDA

View Full Version : "Coming Events" Calendar Hack


memobug
08-11-2003, 07:42 AM
I have cobbled together a different version of calendar.php that will print an arbitrary number of events in list form, which I am using on my home page. http://www.bonsaitalk.com

It looks ahead up to two months to find up to a specific number of events and displays them in a simple list.

You can see the result in the left margin of http://www.bonsaiTALK.com, just under the weather

I'm not sure something like this would be of interest? Comments on the idea or the printout would be appreciated.

Some notes on the implementation:

1. Installation: I created a standalone "smallcal.php" with essential code from calendar.php, together with minor modifications, and two new templates for the calendar and event.

2. Template mods: Because the relative links for my subdomain paths are different, I had to make minor modifications on two other calendar templates to refer to the events by absolute address.

3. smallcal.php contains a variable $maxevents that can be set to an arbitrary number (5 - 10, 20) and the calendar list will be limited to that number of events. It can look at the next two months to get them, not beyond. Also, if the final event occurs on a day with other events, those events will also be printed, even if it takes the total over $maxevents. This could probably be corrected, but I don't mind it.

4. I don't print birthdays, but it can print public/private events.

Regards,

Matt

PBC
08-11-2003, 11:43 PM
This is almost exactly what I'm looking for, but I want to be able to add a location (City, State) to the listing as well.

memobug
08-12-2003, 01:22 AM
I think VB3 is supposed to have some additional fields, but maybe I am dreaming??

am planning on adding several new fields eventually -

City, State, Zip, Country, Building, Street Address, I even want start AND end dates, hours and a contact email, phone, fax, webpage, etc., for each event.

I think I can pull that off as a hack, but making it easy for others to do is another story.

PBC
08-13-2003, 11:33 PM
Yeah...

VB3's calendar interface allows you to add custom fields to the calendar(s) that you create.