Living on the blogcfc bleeding edge

Well i couldnt resist the upgrade so this is my first post using the Beta BlogCFC and though the upgrade was not a smooth ride the bumps were small. So heres a few tips for moving along the bleeding edge without getting too badly cut.1. First off remember the probably most golden rule of SES - relative URL's our and absolute URL's in this is because the backslash screw up the directory location. Its not nice and as i learnt last night and this morning its very very frustrating.2. To update all your entries to SES URL's you can use the following MySQL script (i don't know if this will work on MSSQL etc if someone could let me know that would be great)
UPDATE: This code won't work, as it won't replace special characters. There is a method called MakeTitle in the blogCFC to do this - thanks Ray.
UPDATE `tblblogentries`
   SET alias = REPLACE(title,' ', '-')
Update: Changed from SQL to CF to do the update utilising one of Rays methods already in place. Because of this you have to run this from withing the BlogCFC folder - or make the necessary changes
\n<!--- Get the titles --->
\n<cfquery datasource="'dsn')#" name="t">
\n   SELECT id, title FROM tblblogentries t

\n<!--- Update the alias's --->
\n<cfloop query="t">
\n   <cfquery datasource="'dsn')#">
\n      UPDATE `tblblogentries`
\n      SET alias = <cfqueryparam cfsqltype="cf_sql_varchar" value="" />
\n      WHERE id = <cfqueryparam cfsqltype="cf_sql_varchar" value="" />
\n   </cfquery>

\n<cfcatch><cfdump var="#cfcatch#"><cfabort></cfcatch>
This will also replace all your old alias's. Soif you don't want the script to do that you will need to add a WHERE to that SQL call.Thats it really. I had a little bit of trouble with the skin mainly because my index.cfm is a little different to that in the BlogCFC code so i always need to do a compare and check everything new is added, but apart from that it went well.
comments powered by Disqus