Home Tutorials/How to Links Blog Photos

Coldfusion 8.0.1

Adobe released Coldfusion 8.0.1. I am a little late on this one as I was flying back from Chicago on the day it was released and missed it. I just updated my box and it seems to be working great. If you are going to run this update make sure you get the new extensions for Dreamweaver or Eclipse, as they have introduced a lot of new tag attributes, like an alt attribute for cfimage.

Filemaker ODBC/JDBC to Coldfusion

I have successfully got coldfusion talking to a Filemaker 9 database. It turned out to be pretty simple really.

I enabled ODBC/JDBC in Filemaker server. Installed the latest SequeLink on the coldfusion server. Setup a System DNS and pointed to it in the coldfusion admin. The only odd thing I ran into is in Filemaker field names can have spaces so when I do an insert into a field I have to put double quotes on the field name.

Previous and Next in Coldfusion

I have done this before when the data was clean and when I only needed to worry about one ID by just adding or subtracting one from the ID value. On my photo album pages I wanted to create a way to view my photos without lytebox. I have 2 IDs photo album and photo. Also my data is not the cleanest for example in my Denver photos I do not have a photo 1. I came up with a solution, not the most elegant I will admit. My work around for this problem includes looping the query to set the row number to a variable than instead of displaying against the photo ID I display against the row number. To create the next and previous I just add or subtract 1 from the row number. I also had to put a cfif to check to make sure my previous row variable was not -1. The code is below. You can see it in action here.

<cfloop query="QPhotos">
<cfif QPhotos.Photo_ID eq URL.PHOTO>
<cfset displayrow = QPhotos.currentrow>
</cfif> </cfloop>
<cfset nextrow = displayrow+1>
<cfset previousrow = displayrow-1>
...
<cfif previousrow GT 0><cfoutput query="QPhotos" startrow="#previousrow#" maxrows="1">
...
<cfoutput query="QPhotos" startrow="#displayrow#" maxrows="1">
...
<cfoutput query="QPhotos" startrow="#nextrow#" maxrows="1">

RSS Feeds

I started out playing with cffeed in Coldfusion 8 about a week ago. I decided to build a RSS feed of each of my photo albums in an attempt to learn more about the tag. After scratching my head for a while and a lot of help from http://validator.w3.org/feed/ I now have an rss feed for each of my photo albums. Check them out at http://www.damonledet.com/photos

Using CFIMAGE to create a watermark

Continuing my week off playing around with cfimage, I am thinking this is fast becoming my favorite new feature in Coldfusion 8. This morning I was thinking it would be cool if Coldfusion could watermark images for me. After about 30mins playing around I came up with this.

<cfimage source="img_2566.jpg" name="image">
<cfimage source="watermark.png" name="watermark">
<cfset ImagePaste(image, watermark, 0, 0)>
<cfimage source="#image#" action="writeToBrowser" format="jpg">
First 2 lines I basically give both images a name. The reason the watermark is a png is I want to have the ability to use alpha channels. Next line I paste the watermark onto the image at 0x and 0y. I cheated and created the images the same size, but you could easily read the image info get the size then calculate where you want the watermark to be. The last line writes the image to the browser in the format of a jpeg. You can check it out in action at my CFwatermark page.

Using cfimage to create thumbnails

I have been playing around with the new cfimage tag in coldfusion 8. I am very impressed with the resize capability. Coldfusion 8 seemed to do a great job resizing my images into thumbnails. I created a tutorial here.

Here is a little bit of code to create thumbnails.

<cfimage action="info" structname="imagetemp" source="Path to your image">
<cfset x=min(150/imagetemp.width, 113/imagetemp.height)>
<cfset newwidth = x*imagetemp.width>
<cfset newheight = x*imagetemp.height>
<cfimage action="resize" source="#Path to your image#" width="#newwidth#" height="#newheight#" destination="#thumbnail destination#">

Update: My Using CFIMAGE to Generate Thumbnails tutorial was published at learncf.com

Blog stats after 4 weeks on BlogCFC

Well I have been running blogcfc for four weeks now, and I am still very pleased. I think I got everything configured how I like it now; but a website is always a work in progress in my opinion you are never really done. Now that I have been running it a month I am amazed at how many visits my individual post get. I run google analytics on my site but I never drilled down to the number of visitors per post. I would never have guessed that a post I wrote in February of 2006 would still get over 400 views in 4 weeks. Check out the blog stats page, one of my favorite features of blogcfc.

Export Categories in Blogcfc Google Sitemap

Not anything really fancy but add this little bit of code to your blogcfc googlesitemap.cfm to have google also learn about your categories. The way I figure it you can never tell google too much about your site :)

<cfset cats = application.blog.getCategories()>
<cfoutput query="cats">
<url>
<loc>#application.blog.makeCategoryLink(categoryid)#</loc>
<priority>0.3</priority>
<changefreq>weekly</changefreq>
</url>
</cfoutput>

Great info on Coldfusion 8

I found a great article on why you should check out Coldfusion 8. http://blogs.techrepublic.com.com/programming-and-development/?p=536

Moved to BlogCFC

I have been running BlogCFM for sometime now, and it has served me well. I was discouraged when I found out it was "abandonware". I was on a mission to find a new blog engine for blog.damonledet.com. I played with Mango Blog, Machblog, AVBlog, and BlogCFC. I decided on BlogCFC. It seems to be the most mature of the engines and has most of the features I was after.

I ported all my data over from BlogCFM and setup a few 301 redirect (do not want to lose all that google love) and am now happily on BlogCFC. Thanks so much Ray for a wonderful Coldfusion blog engine. You Rock!

More Entries