Based on my post from yesterday, here is my 5 minute ‘quick stat’ solution to the puzzle. Note, this is not thread safe and it will quickly destroy my server (most likely), but it works!
I added this to Application.cfm, at the bottom, before my last cfsetting.
<cffunction name="getCurrentURL" output="No" access="public" returnType="string">
<cfset var theURL = getPageContext().getRequest().GetRequestUrl().toString()>
<cfif len( CGI.query_string )><cfset theURL = theURL & "?" & CGI.query_string></cfif>
<cfset s = structGet("application.data")>
<cfset p = getCurrentURL()>
<cfif not structKeyExists(s, p)>
<cfset s[p] = 0>
The UDF comes from CFLib of course. It handles both query string and path_info CGI variables so it works well on the blog.
To display it, I wrote this script:
<cfset sorted = structSort(application.data,"numeric","desc")>
<table width="100%" border="1" cellpadding="5">
<cfloop index="a" array="#sorted#">
Nothing too complex here outside of the cool structSort function which works perfectly for this example. If you are bored, you can see this in action here.