I’m in the process of creating a snippet to handle a Calendar on my website. I’ve taken a look at the few that are available (DittoCal, CALx, Kalendar etc) and although CALx was the closest to what I wanted I was unable to successfully grep the code to make it do what I want. French comments not withstanding it seemed that it used flatfiles to store info?
Using
PHP calendar I’ve managed to knock together something that displays a calendar that you can navigate forwards and backward with. In about 120 lines as opposed to CALx’s 1600.
I’ve come to the stage where I want to get a list of events for a month. I need to get a list of the children of a document that have an event date between startdate and enddate. The function getChildrenTemplateVars() gets me a list of the childrens TVs i’m interested in (startdate, enddate). I could then use PHP to go through all the returned values and pick the ones the fall in the right date range. But I don’t want to do that. I want a function that will do all this via SQL not as PHP.
Surely theres a way to return what I need using an SQL statement as opposed to a number of embedded PHP loops.
After this issue’s solved I need to create a method of templating the list of events for a certain month/day. I envisage something similar to ditto whereby each event gets output using placeholders into an event entry template. Pointers?
Or am I going about this the completely wrong way? Take a look at
modx.devonshireavebaptist.org to see where I am so far.
Regards from a 4 day newb.
Adam