>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

Running on BlogCFC 5.1 Alpha

Ray Camden has already made changes to his open source blog software - blogCFC.com.

Blog Pages

One of the main new features is 'blog pages'. What blog pages allow you todo is add custom pages to your blog from within the admin area.

Why would you use it?
If you want to write a page about yourself this is where you can do just that. It will slot your newly created page right into your site design. You then just copy the SES URL (it creates that for you if you desire) to you links pod (or what ever) and bang - new content on your site. With this feature you do need to create a new table for this - for MSSQL users here's the script:

CREATE TABLE [dbo].[tblBlogPages] (
   [id] [nvarchar] (35) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
   [title] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
   [alias] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
   [body] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
   [blog] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

Subscribes

One of the other features is that subscribes now have to verify their subscription. This should hopefully cut down on spammers try to get our email address from our mail outs. You can also email your subscribers directly from the admin area. You need to add a 'verified' field to the tblBlogSubscribers table for this to work.

Ray got some more features read to go into this release, but the ones he's already made are worth the upgrade - thanks Ray.

To view more on the release view blogCFC.com.

dynamic configuration of blogCFC

Have you ever wanted to create blogs for your users dynamcialy? Ray Camdens blogCFC will allow you to do just that.

Check out Rays post and find out how you can do this.

succor.co.uk running on blogCFC 5b

So this evening I decided to change my live blog to the new blogCFC from Ray Camden. After a few problems (mainly down to me) and some quick replies from the Galleon forum i got this puppy up and running. Take a look and please let me know what you think:

One of the errors that I got was Search Engine Safe (SES) URLs on Jrun. By default in the web.xml file SES mapping settings are commented out since not all application servers support the wildcard mappings. click here for more detials.

Here is a SQL script for updating to DB for MSSQL:

Alter table [dbo].[tblBlogEntries]
Add
views int,
released bit,
mailed bit

GO
Alter table [dbo].[tblUsers]
Add
name nvarchar(50)

GO
Alter table [dbo].[tblblogcategories]
Add
categoryalias nvarchar(50)

GO
create table [dbo].[tblBlogEntriesRelated]
(
entryid nvarchar(35),
relatedid nvarchar(35)
)
GO
update [dbo].[tblBlogEntries] set views = 0
GO
update [dbo].[tblBlogEntries] set released = 1
GO
update [dbo].[tblBlogEntries] set mailed = 1
GO
update [dbo].[tblUsers] set name = 'YOUR NAME' --where username = "YOUR USERNAME" -- if running more than one blog
GO

Some of the enhancements on the site are:

  • An admin. No more stinking design mode.
  • Send to Friend. Send blog entries to a friend. Or to an enemy. Whomever.
  • Preview mode on articles.
  • Category SES URLs.
  • Related Entries (Thanks to Jeff Coughlin and Charlie Griefer).
  • Hey look, a pure CSS layout! Not here of course, but you can see it over at the BlogCFC blog. The admin is NOT pure CSS. I may ask Scott to take a look once I feel the admin is done. The CSS work was all done by Scott Stroz, so please thank him and visit his wish list. (His wish list, and Jeff and CJ's can be found in the word doc/pdf in the install folder. PLEASE thank them before me. I've been thanked!)
  • New "Orange Crush" visual theme. Hmmmm. Orangy!
  • More cow bell.
  • Admin lets you quickly delete comments, trackbacks. You can also edit settings (although this is a bit dangerous). This is a nice way to update your spam list.
  • Draft mode. It's not really called draft, but you can write an entry and leave the Released flag to false.
  • Delayed entries really work now. Seriously, I mean it. It works.
  • If you searched for poo, and clicked More Entries, it registered as a new search hit. It won't anymore. I still register a search hit if you follow it from the stats page.
  • If you use an image as an enclosure, it will automatically be placed in the entry, top left. This was a user-submitted idea.
I'll think you find it's another great piece of great work from Ray.

Update: I've now updated to run on beta 2

Framework MATRIX - which one to use?

As we all know quite often clients/projects require a verity of approaches to archive the end objective.  So here’s my idea.  What if a user can answer a list of questions and get presented with a chart showing them which frameworks would best fit there project, i.e.

User interface

(note: click on images to make them larger - these are just examples, it may very well change.)

Sound like a good idea?  Here’s where I need your help.  First of all we need a list of questions that we should ask the end user (please post them in comments here or email me).

What we then need to do is build a marking matrix.   Keeping things simple for my little brain I think we should mark each framework against each question (yes/no) and sum the totals at the end. 
As there are vast numbers of frameworks popping up I need users/experts to rate frameworks against these questions i.e.:

Expert Interface

Once I have this information I can create the system to allow the users to answer the questions; we can present them with a screen like this (once answers are complete).   Its then up to them to decide which one they want to use, but this should help.

End result

To summarise how I need your help:

  • Please post any questions that you think I should ask.  (As part of the question process it would be great to give the user some information/guidance regarding the question (in hint format).  If you have time please add a short hint for the question)
  • Once all questions have been entered I will build the marking matrix; it would be great if you could complete this.

Any thoughts and suggestion would be MORE than welcome.

NB: Please excuse me if I’ve not used your frameworks in these examples:

last.fm listings with amazon intergration via coldfusion

So I have to admit that i've become a bit of a last.fm addict.  It's a great application and the personal radio is just great.  Now for some reason I like the whole thing about people being able to see what music ones been listening to.  I have an affliate account with amazon and thougth hey - would it be cool to intergrate with amazon from my song listings, so this is what i came up with to intergrate with Rays BlogCFC.  Just remove the cfmodule tag to make it stand alone. (Please remember this is the 1st draft)

<!--- n.tong@talkwebsolutions.co.uk |
/**
* Get xml datafeeds for last.fm and links the artists from the page to you amazon account
*
* @param AmazonTagID     Your amazonID, you can get this from vreating a link in the amazon affiliate area.(Required)
* @author Nick Tong (n.tong@talkwebsolutions.co.uk)
* @version 0.1, April 3, 2006
* IF USED PLEASE CREDIT ME :)
*/
--->

<cfsetting enablecfoutputonly=true>

<cfoutput>
   <cfsavecontent variable="request.JSHeader">
      <script type="text/javascript" src="includes/javascript/tipster.js"></script>
      <style type="text/css">
       .musictable{
           width:100%;
         }
       th{
       text-align:left;
          font:12px;
       }
       tr.even{
          padding-top: 2px;
          padding-bottom: 2px;
          border-right: 1px solid ##000000;
          padding-left: 3px;
          padding-right: 3px;
          background-color: ##E0DFCB;
       }
       tr.odd{
          padding-top: 2px;
          padding-bottom: 2px;
          border-right: 1px solid ##000000;
          padding-left: 3px;
          padding-right: 3px;
          background-color: ##FFFFF;
       }
      </style>
   </cfsavecontent>
   <cfhtmlhead text="#request.JSHeader#">
</cfoutput>

<cfif structKEyExists(url,"clearList")>
   <cfset tmp = structdelete(application,"recent")>
   <cfset tmp = structdelete(application,"lastfetch")>
</cfif>

<cfmodule template="tags/layout.cfm" title="My Last.FM Listing">
<!--- lets not run the page on every request - lets load the page into the application scope and reload it every 10 mins (this can be changed) --->
<cftry>
<!---Make sure we have data in the cache for the key--->
<cfparam name="application.recent" default="">
<cfparam name="application.lastFetch" default="#now()#">

<!---Get the expiration date for the data, in mins--->
<cfset maxDate = DateAdd("n",10,application.lastFetch)>

<!---Does the key contain content and is the expiration date greater than the current date, if not lets get the data again--->
<cfif len(application.recent) AND DateCompare(maxDate,Now()) EQ 1>
   <cfoutput>
      #application.recent#
   </cfoutput>
<cfelse>
<!--- n.tong@talkwebsolutions.co.uk | get the feeds --->
   <cfhttp url="http://ws.audioscrobbler.com/1.0/user/quiksilv/recenttracks.xml" method="get"></cfhttp>
   <cfset recenttracks = XmlParse(cfhttp.FileContent) />
   <cfset recenttracksDetail = XmlSearch(recenttracks, "/recenttracks/track") />
   <cfset recenttracksShowCount = ArrayLen(recenttracksDetail)>
   
   <cfhttp url="http://ws.audioscrobbler.com/1.0/user/quiksilv/topartists.xml" method="get"></cfhttp>
   <cfset topartists = XmlParse(cfhttp.FileContent) />
   <cfset topArtistNames = XmlSearch(topartists, "/topartists/artist") />
   <cfset topArtistShowCount = 20> <!--- ArrayLen(topArtistNames) --->
   
   <cfhttp url="http://ws.audioscrobbler.com/1.0/user/quiksilv/topalbums.xml" method="get"></cfhttp>
   <cfset topAlbums = XmlParse(cfhttp.FileContent) />
   <cfset topAlbumsNames = XmlSearch(topalbums, "/topalbums/album") />
   <cfset topAlbumsShowCount = ArrayLen(topAlbumsNames)>
   
   <cfhttp url="http://ws.audioscrobbler.com/1.0/user/quiksilv/toptracks.xml" method="get"></cfhttp>
   <cfset toptracks = XmlParse(cfhttp.FileContent) />
   <cfset toptracksNames = XmlSearch(toptracks, "/toptracks/track") />
   <cfset toptracksShowCount = ArrayLen(toptracksNames)>
   
<!--- n.tong@talkwebsolutions.co.uk | set the amazonTagID --->   
   <cfset request.amazonTagID = "YOUR-AMAZON-TAG-HERE" />
   <cfoutput>
      
      <cfsavecontent variable="application.Recent">
      <script type="text/javascript"><!--
      
         // First, create a new tip object, and pass it its own name so it can reference itself.          var docTips = new TipObj('docTips');
         with (docTips)
         {
          template = '%3%';
         
            <cfloop index="z" from="1" to="#topAlbumsShowCount#">
               <cfif len(topalbumsNames[z].mbid.XmlText)>
                  tips.#rereplace(topalbumsNames[z].mbid.XmlText,"[^a-z]","","all")# = new Array(5, 5, 150, '<img src=#topalbumsNames[z].image.small.XmlText#>');   
               </cfif>   
            </cfloop>
         }
      
      //--></script>       <div id="docTipsLayer" style="position: absolute; z-index: 10000; visibility: hidden;
    left: 0px; top: 0px; width: 10px"
>
&nbsp;</div>
    <h2>Recent Tracks</h2>
      <table title="My Recent Tracks" summary="Check out my most recent songs and artisits." class="musictable">
         <tr>
            <th>Played</th>
            <th>Track</th>
            <th>Artist</th>
         </tr>
         <cfloop index="z" from="1" to="#recenttracksShowCount#">
            <tr class="<cfif z mod 2>even<cfelse>odd</cfif>">
               <td>      
                  #recenttracksDetail[z].date.XmlText#
               </td>
               <td>
                  #recenttracksDetail[z].name.XmlText#
               </td>
               <td>
                  <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=#request.amazonTagID#&camp=1634&creative=6738&path=external-search%3Fsearch-type=ss%26index=blended%26keyword=#recenttracksDetail[z].artist.XmlText#" target="_blank">#recenttracksDetail[z].artist.XmlText#</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=#request.amazonTagID#&amp;l=ur2&amp;o=2" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
               </td>
            </tr>
         </cfloop>
         </table>
          <h2>Top Artists</h2>
         <table title="My Top Artists" summary="Check out my most recent songs and artisits." class="musictable">
         <tr>
            <th>Rank</th>
            <th>Artists</th>
            <th>PlayCount</th>
         </tr>
         <cfloop index="z" from="1" to="#topArtistShowCount#">
         <tr class="<cfif z mod 2>even<cfelse>odd</cfif>">
            <td valign="top">
               #topArtistNames[z].rank.XmlText#
            </td>
            <td valign="top">
               <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=#request.amazonTagID#&camp=1634&creative=6738&path=external-search%3Fsearch-type=ss%26index=blended%26keyword=#topArtistNames[z].name.XmlText#" target="_blank">#topArtistNames[z].name.XmlText#</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=#request.amazonTagID#&amp;l=ur2&amp;o=2" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
            </td>
            <td valign="top">
               #topArtistNames[z].playcount.XmlText#
            </td>
         </tr>
         </cfloop>
         </table>
          <h2>Top Albums</h2>
         <table title="My Tops Albums" summary="Check out my most recent songs and artisits." class="musictable">
         <tr>
            <th>Rank</th>
            <th>Album</th>
            <th>Artist</th>
            <th>PlayCount</th>
         </tr>
         <cfloop index="z" from="1" to="#topAlbumsShowCount#">
         <tr class="<cfif z mod 2>even<cfelse>odd</cfif>">
            <td valign="top">
               #topalbumsNames[z].rank.XmlText#
            </td>
            <td valign="top" onmouseover="docTips.show('#rereplace(topalbumsNames[z].mbid.XmlText,"[^a-z]","","all")#')"
    onmouseout="docTips.hide()" >

               #topalbumsNames[z].name.XmlText#
            </td>
            <td valign="top">
               <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=#request.amazonTagID#&camp=1634&creative=6738&path=external-search%3Fsearch-type=ss%26index=blended%26keyword=#topalbumsNames[z].artist.XmlText#" target="_blank">#topalbumsNames[z].artist.XmlText#</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=#request.amazonTagID#&amp;l=ur2&amp;o=2" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
            </td>
            <td valign="top">
               #topalbumsNames[z].playcount.XmlText#   
            </td>
         </tr>
         </cfloop>
      </table>
      <h2>Top Tracks</h2>
      <table title="Top Tracks" summary="Check out my most recent songs and artisits." class="musictable">
         <tr>
            <th>Rank</th>
            <th>Track</th>
            <th>Artist</th>
            <th>PlayCount</th>
         </tr>
         <cfloop index="z" from="1" to="#toptracksShowCount#">
         <tr class="<cfif z mod 2>even<cfelse>odd</cfif>">
            <td valign="top">
               #toptracksNames[z].rank.XmlText#
            </td>
            <td valign="top">
               #toptracksNames[z].name.XmlText#
            </td>
            <td valign="top">
               <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=#request.amazonTagID#&camp=1634&creative=6738&path=external-search%3Fsearch-type=ss%26index=blended%26keyword=#toptracksNames[z].artist.XmlText#" target="_blank">#toptracksNames[z].artist.XmlText#</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=#request.amazonTagID#&amp;l=ur2&amp;o=2" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
            </td>
            <td valign="top">
               #toptracksNames[z].playcount.XmlText#
            </td>
         </tr>
         </cfloop>
      </table>
      </cfsavecontent>
      <!--- output the content --->
      #application.recent#
   </cfoutput>

</cfif>
<cfcatch>
<cfoutput>Service Unavailable</cfoutput>
</cfcatch>
</cftry>
</cfmodule>

<cfsetting enablecfoutputonly=false>

Thats massively to audioscrobbler for providing the xml files. Let me know what you think. You can view the result here http://www.succor.co.uk/lastfm.cfm.

Configuring Multiple BlogCFC Installs

Ray Camden has a great post on how to install multiple instances of blogCFC - you can also check out the blogCFC forum for more information.

Error establishing socket. Connection refused

So recently i've been trying to run the blogCFC locally on my laptop so I can update it when i'm not online and then synchronise it with my live machine when I hook back up with the WWW.  I had quite a major time with this as the coldfusion administrator couldn't see the SQL Database.

First of all I kept getting timeout errors connecting to the SQL server locally - I disabled norton firewall locally which relived me of that issue. 

I then ran into a classic issue:

java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Error establishing socket. Connection refused

So what's this all about.. I tried connecting the blog through ODBC like i have done with some other datasources in the past to see if this would work but BlogCFC doesn't support ODBC connections (not to my knowledge anyhow). 

So after searching the net for hours (this appears to be a big issue) I decided to see what service pack I had in SQL server, as i was sure it was not CF related.  To find this out I simple went into query analyser and typed

select @@version Go


This showed me that I had SP2 installed.  After downloading and installing  service pack 4 CF connected fine.  So I suggest if you're having this problem upgrade now... if fact - just upgrade.

BlogCFC Coldfusion code output

So for a couple of days i've been thinking ;How cn i get the code to output nicely on screen' and so i asked Ray Camden to see how he does it only to find out that it is a render method in BlogCFC.

Nice one Ray.

Here is my test:

<cffunction name="insertCat" access="public" output="false" returntype="numeric" displayname="i add an category" hint="i upload an category to the cats table"> <cfargument name="datasourceName" required="yes" type="string" hint="datasource name"> <cfargument name="catName" required="yes" type="string" hint="categoryName"> <cfset var="" qinsertcategory=""> <cfset var="" errormsg=""> <cftransaction action="begin"> <cftry> <cfquery name="qInsertCategory" datasource="#arguments.datasourceName#"> insert INTO tblCats ( catName ) values ( '#arguments.catName#' ) select @@Identity AS CatID<br /><br /></cfquery><cfcatch type="any"><cftransaction action="rollback"><cfsavecontent variable="ErrorMsg"><cfdump var="#cfcatch#"></cfdump><cfmodule template="../ErrorTemplate.cfm" errortitle="Error inserting category" debug="&lt;p&gt;#ErrorMsg#&lt;/p&gt;" errormessage="Error&lt;P&gt;Diagnostics:&lt;br&gt;#cfcatch.message#&lt;br&gt;#cfcatch.detail#&lt;/P&gt;&lt;p&gt;#ErrorMsg#&lt;/p&gt;" sendmail="1"><cfabort></cfabort></cfmodule><cftransaction action="commit"></cftransaction><cfreturn qinsertcategory.catid=""></cfreturn></cfsavecontent></cftransaction></cfcatch></cftry></cftransaction></cfset></cfset></cfargument></cfargument></cffunction>

it's worth noting that if you (like me) are using a WYSIWYG editor (check out this post) then you will need to code into the source view to add the <code> </code> tags.

Adding a WYSIWYG Editor to BlogCFC

Matt Waddell has a good post of intergrating the opensource FCKEditor into BlogCFC.

Check out his post http://www.mattwaddell.com/ and watch out for more colourful posts ;)

BlogCFC 4.0.1 update

Shorty after releasing his update to the very sucessful blog Ray Camden has updated his blog with not only a few bug fixs but some enancements as well. Check out his post here:

BlogCFC 4.0.1 update

Good work Ray

BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.