Turn BlogCFC into a photo blog
<cfif len(enclosure) AND reFind("gif|jpg", listLast(getFileFromPath(enclosure)))>
<p><img src="enclosures/#urlEncodedFormat(getFileFromPath(enclosure))#" /></p>
</cfif>
<p><img src="enclosures/#urlEncodedFormat(getFileFromPath(enclosure))#" /></p>
</cfif>
This has been updated to the following. I've updated the listLast function to use the "." as a deliminator
<cfif len(enclosure) AND reFind("gif|jpg", listLast(getFileFromPath(enclosure), "."))>
\n <p><img src="enclosures/#urlEncodedFormat(getFileFromPath(enclosure))#" /></p>
\n</cfif>
This checks the enclosures extention and if a .gif or .jpg then displays it. Thats it. You can see it in action for a blog i'm in the middle of updating for a friend at iPicture.it/mike.Obviously there are some other bits you might want to do:\n <p><img src="enclosures/#urlEncodedFormat(getFileFromPath(enclosure))#" /></p>
\n</cfif>
- On the upload resize the image
- Create thumbnails