CF meeting Caledar pod code
I've made available below the code to my CF Meeting Calendar Pod. Its very rough and uses inline CSS. It also uses uses Ray Camdens iCal CFC which you can get from his "My Tools" pod. You will need to put this in your /includes/pod/ folder along with the pod code.
1<cfsetting enablecfoutputonly=true>
2<cfprocessingdirective pageencoding="utf-8">
3<!---
4 Name : pod.cfmeetings.cfm
5 Author : Andy Jarrett
6 Created : May 26, 2006
7 Last Updated : May 30, 2006
8 History :
9 Purpose : Displays a list of event from a iCal calendar. This uses Ray Camdens iCal CFC
10 which you can get from http://ray.camdenfamily.com/ "My Tools" pod. You will
11 need to put this in your /includes/pod/ folder.
12 Todo : Remove inline CSS
13--->
14
15<!--- This links to the blog entry with details about the blog calendar --->
16<cfset title = '<a class="ical" href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">CFEvents Dairy</a>' />
17
18<cfmodule template="../../tags/podlayout.cfm" title="#title#">
19
20<cfoutput>
21
22 <!--- Get the calendar --->
23 <cfhttp URL="http://www.google.com/calendar/ical/i5bekb7bdf56ubf67bqa711un8@group.calendar.google.com/public/basic"
24 method="get">
25 <cfset data = cfhttp.filecontent />
26
27 <!--- Call Ray Camdens iCal get this from http://ray.camdenfamily.com/ "My Tools" pod --->
28 <cfset ical = createObject("component","ical").init(data)>
29
30 <cfset results = ical.getEvents()>
31
32 <div style="width:175px;height:150px;overflow:auto;font-family:sans-serif;font-size:10px;">
33 <!--- Time Zone Converter --->
34 <a href="http://www.timezoneconverter.com/" target="_blank">Timezone Converter</a><br/>
35
36 <cfloop index="x" from="1" to="#arraylen(results)#">
37 <cfset eventData = results[x]>
38 <cfset startDate = ical.icalParseDateTime(eventData.dtstart.data)>
39 <cfif structKeyExists(eventData,"dtend")>
40 <cfset endDate = ical.icalParseDateTime(eventData.dtend.data)>
41 <cfelseif structKeyExists(eventData,"duration") and eventData.duration.data is not "P1D">
42 <cfset endDate = ical.icalParseDuration(eventData.duration.data,startdate)>
43 <cfelse>
44 <cfset enddate = startdate>
45 </cfif>
46 <div style="text-align:left;background-color:3F3F3F; border:1px solid CCC; border-width:0 0 1px 0; font-weight:bold; text-align:right; width:155px;">
47 #dateFormat(startDate,"dd-mmm-yy")# #timeFormat(startDate,'HH:MM')#<cfif dateFormat(startDate,"mm/dd/yy") neq dateFormat(endDate,"mm/dd/yy")> - #dateFormat(endDate,"mm/dd/yy")#</cfif> GMT
48 </div>
49 <div style="text-align:left;padding:0 0 10px 0;">
50 #eventData.summary.data#<br/>
51 <cfif structKeyExists(eventData,"location")>
52 Where: <a href="javascript:alert('#eventData.location.data#')">click here</a></cfif>
53 </div>
54 </cfloop>
55 </div>
56 <a href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">Learn more CFEvents</a>
57
58</cfoutput>
2<cfprocessingdirective pageencoding="utf-8">
3<!---
4 Name : pod.cfmeetings.cfm
5 Author : Andy Jarrett
6 Created : May 26, 2006
7 Last Updated : May 30, 2006
8 History :
9 Purpose : Displays a list of event from a iCal calendar. This uses Ray Camdens iCal CFC
10 which you can get from http://ray.camdenfamily.com/ "My Tools" pod. You will
11 need to put this in your /includes/pod/ folder.
12 Todo : Remove inline CSS
13--->
14
15<!--- This links to the blog entry with details about the blog calendar --->
16<cfset title = '<a class="ical" href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">CFEvents Dairy</a>' />
17
18<cfmodule template="../../tags/podlayout.cfm" title="#title#">
19
20<cfoutput>
21
22 <!--- Get the calendar --->
23 <cfhttp URL="http://www.google.com/calendar/ical/i5bekb7bdf56ubf67bqa711un8@group.calendar.google.com/public/basic"
24 method="get">
25 <cfset data = cfhttp.filecontent />
26
27 <!--- Call Ray Camdens iCal get this from http://ray.camdenfamily.com/ "My Tools" pod --->
28 <cfset ical = createObject("component","ical").init(data)>
29
30 <cfset results = ical.getEvents()>
31
32 <div style="width:175px;height:150px;overflow:auto;font-family:sans-serif;font-size:10px;">
33 <!--- Time Zone Converter --->
34 <a href="http://www.timezoneconverter.com/" target="_blank">Timezone Converter</a><br/>
35
36 <cfloop index="x" from="1" to="#arraylen(results)#">
37 <cfset eventData = results[x]>
38 <cfset startDate = ical.icalParseDateTime(eventData.dtstart.data)>
39 <cfif structKeyExists(eventData,"dtend")>
40 <cfset endDate = ical.icalParseDateTime(eventData.dtend.data)>
41 <cfelseif structKeyExists(eventData,"duration") and eventData.duration.data is not "P1D">
42 <cfset endDate = ical.icalParseDuration(eventData.duration.data,startdate)>
43 <cfelse>
44 <cfset enddate = startdate>
45 </cfif>
46 <div style="text-align:left;background-color:3F3F3F; border:1px solid CCC; border-width:0 0 1px 0; font-weight:bold; text-align:right; width:155px;">
47 #dateFormat(startDate,"dd-mmm-yy")# #timeFormat(startDate,'HH:MM')#<cfif dateFormat(startDate,"mm/dd/yy") neq dateFormat(endDate,"mm/dd/yy")> - #dateFormat(endDate,"mm/dd/yy")#</cfif> GMT
48 </div>
49 <div style="text-align:left;padding:0 0 10px 0;">
50 #eventData.summary.data#<br/>
51 <cfif structKeyExists(eventData,"location")>
52 Where: <a href="javascript:alert('#eventData.location.data#')">click here</a></cfif>
53 </div>
54 </cfloop>
55 </div>
56 <a href="http://www.andyjarrett.co.uk/andy/blog/index.cfm/2006/4/27/ColdFusion-Meeting-Calendar">Learn more CFEvents</a>
57
58</cfoutput>
| Tweet |
| If you like what you see on the website and/or this post has helped you out in some way please consider donating to help keep me in beer vodka. The donations are made through Paypal, which accepts almost any credit card or eCheck. |