Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Using GForum as a calendar

Quote Reply
Using GForum as a calendar
Yeah, this is one of those "You have GOT to be kidding" things - why go to the bother of outfitting GForum as a calendar when there are so many calendar scripts out there already? But one of my users suggested a calendar forum not just so people could see what's going on around here but so he and others could comment on those events, maybe even use the forum to arrange get-togethers at them. That is something you can't do with most other events scripts - they just let you post listings, with no way to comment.

http://www.wickedgood.info/.../gforum.cgi?forum=15 shows it in action (and the attachment shows an image of the event-submission page).

There's a fair amount of tinkering involved to make it look and work more like a calendar than a standard forum, but thanks to Gossamer Threads for the powerful templating system - it's all done through templates and some new database fields, so none of it was particularly hard. I didn't have to touch the core code at all (I especially like how I could make all the new fields sortable through some tags in the template). This is one reason I decided to try this rather than use the Events module in Drupal, which is a very powerful community platform I'm also running, but which can require a fair amount of mucking around with the underlying PHP code (another was to take advantage of the GForum registration system).

For the calendar search (which I haven't built yet), I wanted a bunch of new fields so users could, say, find all children's events in a particular city - so I added database fields such as post_eventaddress, post_eventcity, post_eventtype, etc. (another thing you could do with this is combine the address field and the city field in an anchor tag that calls up a Mapquest map; I'm not doing that because this is a Boston calendar and MapQuest just sucks at providing accurate directions in Boston).

To make the calendar sortable by date, I added two fields to the post table: post_eventmonth and post_eventdate, both as INT fields. In forum_view.html, I added columns for them, with the one in the top row looking like:

Code:
<a style="color: white;" href="gforum.cgi?do=<%this_do%>;
forum=<%forum_id%>;sb=post_eventdate;
so=<%if sb eq post_eventdate and so eq ASC%>DESC<%else%>
ASC<%endif%>;page=<%this_page%>;mh=<%mh%>;<%hidden_query%>">
<%if sb eq post_eventdate%><img src="<%image_url%>/<%if so eq DESC%>down
<%else%>up<%endif%>.gif" border="0" alt="Sort direction" width="14" height="11">
&nbsp;<%endif%>Date</a>

Oh, and they're bracketed by

Code:
<%if cat_id == 3%>

where 3 is the ID for my calendar forum, so they only show up there. There's a lot of similar coding in category_list.html, post_view_flat.html, post_view_threaded.html, post_write.html, include_post_common_write.html and include_post_html_common_write.html.

Two things I haven't figured out yet: What to do about events that span multiple days and how to bulk-delete expired events (that one would involve some SQL query, maybe some sort of global so I can do it through the forum interface, rather than via MySQLMan).
Quote Reply
Re: [agaffin] Using GForum as a calendar In reply to
Hello agaffin

Can you please send we an exact indruction to include the Calender into Gossamer Forum?


Many thank

greeting hoefti
linktobuy Web Directory
Ratgeber Recht