Steven Erat's Blog
 
 
Viewing By Entry
 
 

TalkingTree  Recent Comments Pod: New pod for BlogCFC 4.0

 

Attached is a zip of a new recentComments.cfm template to use as a pod for Ray Camden's new BlogCFC 4.0. This version uses his custom tag scopecache to cache the generated html from each pod, so here's how to add a pod that will display the last few comments in the side bar, and will be refreshed upon a new comment entry or comment deletion.

Step 1
Download the attachment and unzip recentComments.cfm into blog_root/includes/pods.

Step 2
Edit blog_root/tags/layout.cfm to add the Recent Comments pod among the other pods in the sidebar menu.

<cfinclude template="../includes/pods/recentComments.cfm">

Step 3
Edit blog_root/addComment.cfm to add the refresh logic for Recent Comments pod.

Find this:

<cfif isDefined("url.delete") and isUserInRole("admin")>
   <cfset application.blog.deleteComment(url.delete)>
   <cfset comments = application.blog.getComments(url.id)>
</cfif>

Change to this:

<cfif isDefined("url.delete") and isUserInRole("admin")>
<cfset application.blog.deleteComment(url.delete)>
<!--- reset the comments pod cache upon deleting comment --->
<cfmodule
      template="tags/scopecache.cfm"
      cachename="pod_recentcomments"
      scope="application"
      clear="true"/>

<cfset comments = application.blog.getComments(url.id)>
</cfif>

Step 4
Save files and browse to test. From now on, every chanage you make to the pod will require a blog refresh with the ?reinit=1 parameter.

Step 5
Edit the number of comments to display and the amount of text for each comment, found in recentComments.cfm. Edits to pod content require that you refresh the blog using the ?reinit=1 parameter while logged in.

<cfscript>
   maxRecentComments    = 3;
   maxRecentCommentLen   = 120;
</cfscript>

 


Comments

Nice. Would you mind posting this URL to the Pods forum at my blogcfc forums?


Nice pod addition, works well but I was getting an error on line 39 of recentComments.cfm where it tires to call replaceTags.I'm not sure what this is but I guess it's something along the lines of HTMLEditFormat which seems to work fine in it's place.


Thanks, Doug. I've uploaded a new version that fixes that problem. I was using a custom UDF in my own blog and left one call to that UDF in the generic version available for download. Try downloading the new version.


 

 

Calendar

 
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 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

Search This Site

 
This is an exact search only

About This Site

 
I live west of Boston and used to work at Adobe with ColdFusion and Flex, specializing in Unix & Linux. I recently graduated from CDIA in Pro Digital Photography. Curious about my banner image?

More about me

Recent Entries

 
Christmas Eve Service makes F..
How To Filter by File Type in..
Perspective on ColdFusion's B..
Power Mac G5: The lights are ..
My Application to CDIABU in R..

Recent Comments

 
Posted By Andy Allan:
Fantastic work Steve.

Posted By charlie arehart:
Oh wow, awesome to hear that the relative quiet was an imposed one, and that the gag order has been lifted. Now I'm really excited to hear what may co ...

Posted By Steven Erat:
Thanks for your encouragement Charlie. I have to say that even though I'm trying to be positive and use this time to improve my web skills, most of t ...

recently played

 
Snap Judgments
by WNYC, New York Public Radio
on On The Media
On The Media, WNYC, New York Public Radio

now playing, a plug-in for itunes

Categories

 
RSS Adobe (31)
RSS Bicycling (9)
RSS Blogging (37)
RSS Books (13)
RSS Breeze (12)
RSS CFMX Podcasts (10)
RSS ColdFusion (420)
RSS Computer Technology (50)
RSS Events (25)
RSS Flash (3)
RSS Flex (18)
RSS Gadgets (10)
RSS HiTech Industry (16)
RSS Java (25)
RSS Learning (57)
RSS Linux (70)
RSS Mac OS X (22)
RSS Macromedia (28)
RSS Meetup (34)
RSS New England (62)
RSS Odds & Ends (25)
RSS Outdoors (32)
RSS Personal (29)
RSS Photography (109)
RSS Photoshop (29)
RSS Podcasts (18)
RSS Rants (19)
RSS Restaurants (8)
RSS Science (34)
RSS Spain (16)
RSS Travel (42)
RSS Video (20)
RSS Webcam (3)
RSS Writing (10)

Blogs I Read

 
Scrum Sucks
Ben Forta
Ray Camden
Kinky Solutions
Gary Gilbert
Red Hat Blogs
O'Reilly Digital Media
O'Reilly Radar
John Nack
The Strobist
Scott Kelby
Matt Kloskowski
Joe McNally
Digital Photography School
Engadget
Science Blog

RSS

 


Add to Google
Add to My Yahoo!

Aggregated By

 


Consumed By Feed-Squirrel.com
Aggregated by ColdFusionBlogger.org

Credits and Stuff

 
BlogCFC - Free ColdFusion Powered Blog Software
CJM Group - ColdFusion Website Hosting


 
 
blog | photos | flickr | referers | webcam | stats | about | contact
 
Copyright © 2009 Steven Erat. All rights reserved.
This is a personal weblog. The opinions expressed here represent my own and not those of my employer