Visit the ColdFusionProNews Directory
Beginners
Installation, Coding Techniques, Data Structures...
CF Powered Sites
Stores, Directories, Universities...
Developers
Developers, Designers, Experts...
E-commerce
Shoes, Food, Music...
Education
Books, Online Resource, Languages...
Expert
LiveChat , CFX XMLParser , User Defined Function Library...
Hosting
Dedicated Servers, Virtual Server, Multi-user...
Intermediate
AutoResize , DataSource Encryption, Guestbook...

Submit your site for FREE

Archive for August, 2007

FeedBurner CFC

Monday, August 27th, 2007

I’ve been using FeedBurner for quite sometime now to host my RSS feeds, and when they bought Blogbeat, I was even happier since Blogbeat was a great blog-stats tool.

Now I get both feed and general item stats all from one source. FeedBurner has an API to retrieve information about your stats so I decided to wrap up some of the API into a nice little CFC. FeedBurner.cfc supports getting both general feed data as well as item data. For example:

<cfset fb = createObject("component", "feedburner")>
<cfdump var="#fb.getFeedData('RaymondCamdensColdFusionBlog')#" label="No date, will be yesterday">

This will retrieve the most current stats from the API, which will be yesterday. To get a week of data:

<cfset date = dateAdd("d", -8, now())>
<cfset last7 = fb.getFeedData(uri='RaymondCamdensColdFusionBlog',
dateBegin=date)>
<cfdump var="#last7#" label="7 Days of Info">

And finally last month:

<cfset date = dateAdd("m", -1, now())>
<cfset dateBegin = createDate(year(date), month(date), 1)>
<cfset dateEnd = createDate(year(date), month(date), daysInMonth(date))>


<cfset lastm = fb.getFeedData(uri='RaymondCamdensColdFusionBlog',
dateBegin=dateBegin,dateEnd=dateEnd)>
<cfdump var="#lastm#" label="Last Month">

This data then can easily be dumped into a chart:


(more…)

Getting Space Available On A Hard Drive (partition)

Wednesday, August 22nd, 2007

I’m working on a tutorial for a client involving file uploads (which I’ll be sharing on the blog). In the tutorial I talk a bit about monitoring the number of uploads and how much space they are taking.

I was curious what methods exist for finding out how much space is being used on a drive and how much space is available.

Finding out the space used by a directory is possible with CFDIRECTORY and query of query:
(more…)

Preselecting A Tab Via The URL In ColdFusion 8

Wednesday, August 8th, 2007

A quick and simple tip - ColdFusion 8 lets you set a default selected tab by using selected=”true” in the tab.

Here is a simple example:

<cflayout type="tab">

   <cflayoutarea title=”Tab 1″>

   <p>
   This is the first tab.
   </p>
   </cflayoutarea>

   <cflayoutarea title=”Tab 2″ selected=”true”>
   <p>
   This is the second tab.
   </p>
   </cflayoutarea>

</cflayout>

In this example, the second tab will be selected when the page loads, as opposed to the first one which is the default. But what if you wanted more control over the selected tab? Here is a way to do it so that you can control the selected tab in the URL itself.
(more…)