Forgive me for tooting my own horn (and there is a practical side to this entry as well), but HelloMetro.com went live with 550 new installs of BlogCFC. The installs are all virtual for their 550 city sites. More info at the press release.
So how was this done? Most people don’t know (maybe because I never documented it) that BlogCFC supports dynamic configuration as well as the more normal blog.ini.cfm file. So for example, to make one install of BlogCFC work for all 550 blogs, I simply added code like so to the Application.cfm file:
<cfset blogName = getCities.cityName>
<!— custom —> <cfset instance = structNew()> <cfset instance.dsn = “Blog”> <cfset instance.owneremail=”email@example.com”> <cfset instance.blogurl = “http://#cgi.server_name#/blog/index.cfm”> <cfset instance.blogtitle = “#blogName# Blog”> <cfset instance.blogdescription = “#blogname# Blog”> <cfset instance.blogDBType=”MSSQL”> <cfset instance.locale=”en_US”> <cfset instance.users = ““> <cfset instance.commentsFrom = ““> <cfset instance.mailServer = ““> <cfset instance.mailUsername = ““> <cfset instance.mailPassword = ““> <cfset instance.pingurls = ““> <cfset instance.offset = “0”> <cfset instance.allowtrackbacks = false> <cfset instance.trackbackspamlist=”phentermine,MORE STUFF DELETED”> <cfset instance.blogkeywords = ““> <cfset instance.ipblocklist = “22.214.171.124”> <cfset instance.maxentries = “10”> <cfset instance.usecaptcha = false> </code>
The value, getCities, is a query containing the current city based on the host name. I got this from cfincluding custom code, but you could replace this with any other code as well.
I then changed the component creation to this:
<cfset application.blog = createObject("component","org.camden.blog.blog").init(blogName, instance)>
Notice how I pass the instance struct to the init method. Anyway, that was it. I did do other mods to support their “Anyone can blog” functionality, and yes, I know the layout is broken in Firefox (they are working on that).