Here's a demo of my cfTimeline custom tag. The code for the timeline is also listed below to demonstrate how easily this tag can be implemented.

Note: The ISODateToTS function used is available at cflib.

To learn more about the tag or download it see my project page or the project page at RIAForge.



cfTimeline.cfm

<cf_timeline id="myTimeline"
   timelineHeight="250"
   start="#now()#"
   xmlEvents="/blog/client/cfTimeline/feed.cfm?feed=mxna"
   labelWidth="250"
   creationComplete="center"
   style="font-size: 8pt; font-family: Trebuchet MS, Helvetica, Arial, sans serif; border: 1px solid ##aaa;">

   <cf_timelineband
      bandHeight="80"
      showEventText="true"
      dateUnit="hour"
      intervalWidth="400" />

   <cf_timelineband
      bandHeight="20"
      showEventText="false"
      dateUnit="day"
      intervalWidth="200"
      highlight="true"
      trackHeight="0.5"
      trackGap="0.2" />

</cf_timeline>
<div align="center">
<input type="button" name="first" value="Oldest Post" onclick="cfTimeline.scrollToCenter(myTimeline,0,cfTimeline.getEarliestDate(myTimeline,0));" style="width: 115px;">
<input type="button" name="loadMXNA" value="MXNA" onclick="cfTimeline.loadXML(myTimeline, '/blog/client/cfTimeline/feed.cfm?feed=mxna',center)" style="width: 115px;">
<input type="button" name="loadGoog" value="FullAsAGoog" onclick="cfTimeline.loadXML(myTimeline, '/blog/client/cfTimeline/feed.cfm?feed=goog',center)" style="width: 115px;">
<input type="button" name="last" value="Most Recent Post" onclick="cfTimeline.scrollToCenter(myTimeline,0,cfTimeline.getLatestDate(myTimeline,0));" style="width: 115px;">
</div>
<cfsavecontent variable="center">
<script type="text/javascript">
center = function(){
var dt = cfTimeline.getEarliestDate(myTimeline,0);
cfTimeline.scrollToCenter(myTimeline, 0, dt)
}
</script>
</cfsavecontent>
<cfhtmlhead text="#center#">
<br />


feed.cfm

<cfsetting showdebugoutput="false">
<cfparam name="url.feed" default="">

<cfscript>
/**
* Converts text string of ISO Date to datetime object; useful for parsing RSS and RDF.
*
* @param str     ISO datetime string to parse. (Required)
* @return Returns a date.
* @author James Edmunds (jamesedmunds@jamesedmunds.com)
* @version 1, September 21, 2004
*/
function ISODateToTS(str) {
   return ParseDateTime(ReplaceNoCase(left(str,16),"T"," ","ALL"));
}
</cfscript>

<cfswitch expression="#url.feed#">
   <cfcase value="goog">
      <cfset feedURL = "http://www.fullasagoog.com/xml/ColdFusionMX.xml">
      <cfset icon = "goog.png">
   </cfcase>
   <cfdefaultcase>
      <cfset feedURL = "http://weblogs.macromedia.com/mxna/xml/rss.cfm?query=bySmartCategory&languages=1&smartCategoryId=1&smartCategoryKey=D0382F3A-9D2B-69E8-C7BC317066FA1CC2">
      <cfset icon = "mxna.jpg">
   </cfdefaultcase>
</cfswitch>

<cfhttp url="#feedURL#" result="feed" />
<cfset feeds ="#xmlParse(feed.fileContent)#">

<cfcontent type="text/xml">
<?xml version="1.0" encoding="UTF-8"?>
<data>
<cfoutput>
   <cfloop from="1" to="#arrayLen(feeds["rdf:RDF"].item)#" index="item">
      <cfset thisPost = feeds["rdf:RDF"].item[item]>
      <cfset posted = dateformat(ISODateToTS(thisPost["dc:date"].XMLText), "mm/dd/yyyy") & " " & timeformat(ISODateToTS(thisPost["dc:date"].XMLText), "HH:mm:ss")>
      <event
         start="#posted#"
         title="#XMLFormat(thisPost.title.XMLText)#"
         link="#XMLFormat(thisPost.link.XMLText)#"
         icon="#XMLFormat(icon)#">

         #XMLFormat(thisPost.description.XMLText)#
      </event>
   </cfloop>
</cfoutput>
</data>

Calendar

Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff javascript misc model-glue off topic personal project learn slidesix sql

Recent Comments

Chinese Birth Calendar Accuracy Test
mama to be said: ok so i will be 2 months shy of 18 when i have my baby. this calendar does not technically work for ... [More]

Fixing 'User Profile Service Failed The Logon' on Vista
Mike said: That fix worked although all i did was remove .bak and reset state to 0. User was able to log in to... [More]

Chinese Birth Calendar Accuracy Test
Melissa said: Wrong for my daughter, which it predicted to be a boy... we'll see for #2. Predicts a girl (maybe, f... [More]

Adding Auto Generated Code Downloads to BlogCFC
fweerw said: http://www.ibiblio.org/st... http://www.cambodia.ait.a...... [More]

Check Out The New SlideSix
Todd Sharp said: Thanks for the feedback Ben & Rachel! I'll keep it all in mind as I tweak things over the next ... [More]

RSS


adobe community experts

coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com