karatekid36 Posted December 19, 2007 Share Posted December 19, 2007 howdy everyone, So I am trying to generate an event calendar for my organization as our calendar. I have built calendars in the past, but I am having a hard time taking those applications and marrying them into my new need. My prior calendars where strictly dates. I could construct this by hand, setting variables for each day and month, but with the power of PHP there has to be a better way. Obviously I need to generate dynamically a calendar, but with in the day, be it in the <td> tags or however it is constructed, I would like it to fill it with events that I have in table. The dates are stored as yyyy-mm-dd in the table so they should be easy enough, but I really just do not have a solid idea of how I can get it to echo the event's title and location in each day where the date on the cal matches the date on the event. Also, shifting to prior and next months would be killer too. If anyone has any ideas as to where I should start on this, please let me know. Thanks and have a great day. Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/ Share on other sites More sharing options...
p2grace Posted December 19, 2007 Share Posted December 19, 2007 I've written a calendar that does what you're asking for. Basically you first generate the calendar table. Afterwards add the code that queries a table for all events whose beginning timestamp and ending timestamp contain the date currently being generated. Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/#findComment-418910 Share on other sites More sharing options...
revraz Posted December 19, 2007 Share Posted December 19, 2007 Here is a decent start to building the calendar http://php.about.com/od/finishedphp1/ss/php_calendar.htm Once you do that, what I did was build an array for the month with all the events, the first index being the day, and just looped through the events for the day and printed them in the TD field. I can show you the result if you like. Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/#findComment-418917 Share on other sites More sharing options...
karatekid36 Posted December 19, 2007 Author Share Posted December 19, 2007 I would def like to see the finished product because your solution sounds like it could work for my needs. Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/#findComment-419028 Share on other sites More sharing options...
revraz Posted December 20, 2007 Share Posted December 20, 2007 PM Sent Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/#findComment-419103 Share on other sites More sharing options...
karatekid36 Posted December 20, 2007 Author Share Posted December 20, 2007 This is exactly what I am looking for. I would be very interested in seeing how you get the events in the code. Quote Link to comment https://forums.phpfreaks.com/topic/82393-generating-an-event-calendar/#findComment-419123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.