<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>madfellas - FarCry</title>
			<link>http://www.madfellas.com/blog/index.cfm</link>
			<description></description>
			<language>en-us</language>
			<pubDate>Wed, 08 Sep 2010 18:34:32 -0700</pubDate>
			<lastBuildDate>Fri, 05 Oct 2007 21:58:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>justin.w.carter@gmail.com</managingEditor>
			<webMaster>justin.w.carter@gmail.com</webMaster>
			
			<item>
				<title>Custom FarCry 4 Rule: Recently Updated Pages</title>
				<link>http://www.madfellas.com/blog/index.cfm/2007/10/5/Custom-FarCry-4-Rule-Recently-Updated-Pages</link>
				<description>
				
				&lt;p&gt;Rules in FarCry are cool. Rules let you easily add dynamic content to a page, such as News or Events, simply by placing rules into a Container when you are viewing the site in Design Mode.&lt;/p&gt;&lt;p&gt;This example is very simple and makes use of FarCry 4&apos;s &quot;Form Tools&quot;. The two cfproperty tags are all we need for FarCry to be able to deploy the appropriate table and fields to the database and to display and save the form when the user is editing the rule. Nice :) The only other required pieces of code are for the component to extend &lt;tt&gt;farcry.core.packages.rules.rules&lt;/tt&gt; (or another rule that has already extended that component), and to implement a public function called &lt;tt&gt;execute()&lt;/tt&gt; so that we can display something.&lt;/p&gt;&lt;p&gt;My &lt;tt&gt;ruleRecentlyUpdated.cfc&lt;/tt&gt; rule simply does a query for dmHTML records whose status match the allowed options in &lt;tt&gt;request.mode.lValidStatus&lt;/tt&gt; - i.e. if you are logged in and are in Draft Mode then Drafts will be included, otherwise it defaults to Approved page only - and sorts them in descending order using the &lt;tt&gt;datetimelastupdated&lt;/tt&gt; field. It also makes use of a display method so that you can choose which display teaser you would like to use for output. See the sample code below...&lt;/p&gt;&lt;p&gt;ruleRecentlyUpdated.cfc (in /farcry/projectname/packages/rules)&lt;/p&gt;&lt;p&gt;&lt;textarea name=&quot;code&quot; class=&quot;xml&quot; cols=&quot;60&quot; rows=&quot;15&quot;&gt;
&lt;!--- 
$Developer: Justin Carter $
---&gt;
&lt;cfcomponent displayname=&quot;HTML Pages: Recently Updated&quot; extends=&quot;farcry.core.packages.rules.rules&quot; 
	hint=&quot;Display the most recently updated HTML Pages&quot;&gt;
 
&lt;cfproperty ftseq=&quot;1&quot; ftfieldset=&quot;General Details&quot; name=&quot;displayMethod&quot; type=&quot;string&quot; hint=&quot;Display method to render.&quot; required=&quot;yes&quot; default=&quot;displayTeaser&quot; fttype=&quot;webskin&quot; fttypename=&quot;dmHTML&quot; ftprefix=&quot;displayTeaser&quot; ftlabel=&quot;Display Method&quot; /&gt;
&lt;cfproperty ftSeq=&quot;2&quot; ftFieldSet=&quot;General Details&quot; name=&quot;numItems&quot; type=&quot;numeric&quot; hint=&quot;&quot; ftLabel=&quot;Number of items&quot; /&gt;
 
 
	&lt;cffunction access=&quot;public&quot; name=&quot;execute&quot; output=&quot;true&quot;&gt;
		&lt;cfargument name=&quot;objectID&quot; required=&quot;Yes&quot; type=&quot;uuid&quot; default=&quot;&quot;&gt;
		&lt;cfargument name=&quot;dsn&quot; required=&quot;false&quot; type=&quot;string&quot; default=&quot;#application.dsn#&quot;&gt;
		&lt;cfparam name=&quot;request.mode.lValidStatus&quot; default=&quot;approved&quot;&gt;
 
		&lt;cfset stObj = this.getData(arguments.objectid)&gt; 
 
		&lt;cfquery datasource=&quot;#arguments.dsn#&quot; name=&quot;qGetPages&quot; maxrows=&quot;#stObj.numItems#&quot;&gt;
			SELECT *
			FROM #application.dbowner#dmHTML 
			WHERE status IN (&apos;#ListChangeDelims(request.mode.lValidStatus,&quot;&apos;,&apos;&quot;,&quot;,&quot;)#&apos;)		
			ORDER BY datetimelastupdated DESC
		&lt;/cfquery&gt;
 
		&lt;cfif qGetPages.recordcount&gt;
 
			&lt;cfset arrayAppend(request.aInvocations,&quot;&lt;ul&gt;&quot;)&gt;
 
			&lt;!--- loop over display methods ---&gt;
			&lt;cfloop query=&quot;qGetPages&quot;&gt;
				&lt;cfscript&gt;
				 	stInvoke = structNew();
					stInvoke.objectID = qGetPages.objectID;
					stInvoke.typename = application.types.dmHTML.typePath;
					stInvoke.method = stObj.displayMethod;
					arrayAppend(request.aInvocations,stInvoke);
				&lt;/cfscript&gt;
			&lt;/cfloop&gt;
 
			&lt;cfset arrayAppend(request.aInvocations,&quot;&lt;/ul&gt;&quot;)&gt;
 
		&lt;/cfif&gt;					
		
	&lt;/cffunction&gt; 		
 
&lt;/cfcomponent&gt;
&lt;/textarea&gt;&lt;/p&gt;&lt;p&gt;
displayTeaserRecentlyUpdated.cfm (in /farcry/projectname/webskin/dmHTML)&lt;/p&gt;&lt;p&gt;&lt;textarea name=&quot;code&quot; class=&quot;xml&quot; cols=&quot;60&quot; rows=&quot;10&quot;&gt;
&lt;cfsetting enablecfoutputonly=&quot;yes&quot;&gt;
&lt;!--- @@displayname: Recently Updated Pages (list) ---&gt;
&lt;!--- @@author: Justin Carter ---&gt;
 
&lt;cfimport taglib=&quot;/farcry/core/tags/webskin&quot; prefix=&quot;skin&quot;&gt;
 
&lt;cfoutput&gt;
&lt;li&gt;
	&lt;/cfoutput&gt;
	&lt;skin:buildLink objectid=&quot;#stObj.objectid#&quot;&gt;&lt;cfoutput&gt;#stObj.title#&lt;/cfoutput&gt;&lt;/skin:buildLink&gt;
	&lt;cfoutput&gt;
	&lt;span&gt;#LSDateFormat(stObj.datetimelastupdated, &quot;long&quot;)#&lt;/span&gt;
&lt;/li&gt;
&lt;/cfoutput&gt;
 
&lt;cfsetting enablecfoutputonly=&quot;no&quot;&gt;
&lt;/textarea&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;* Note that I have only tested this with MS SQL, though I assume it will work with most other DB servers. Use this code at your own risk ;)&lt;/p&gt;&lt;p&gt;For my use case this was simply all I needed, however you could make a number of improvements to the functionality of this rule, such as:
&lt;ul&gt;
&lt;li&gt;add a property to make the unordered list HTML tag optional&lt;/li&gt;
&lt;li&gt;select or exclude pages that are children of a particular navigation node&lt;/li&gt;
&lt;li&gt;select pages that belong to particular categories&lt;/li&gt;
&lt;li&gt;check pages that may be part of a members area that requires a login and include/exclude them as appropriate&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;&lt;p&gt;If you want to look at rules, form tools and other stuff in more depth check out the &lt;a href=&quot;http://docs.farcrycms.org:8080/confluence/display/FCDEV40/Home&quot;&gt;FarCry 4 Developers Guide&lt;/a&gt;.&lt;/p&gt; 
				</description>
				
				<category>FarCry</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Fri, 05 Oct 2007 21:58:00 -0700</pubDate>
				<guid>http://www.madfellas.com/blog/index.cfm/2007/10/5/Custom-FarCry-4-Rule-Recently-Updated-Pages</guid>
				
			</item>
			
			<item>
				<title>Extending richtext.cfc in FarCry 4</title>
				<link>http://www.madfellas.com/blog/index.cfm/2007/10/2/Extending-richtextcfc-in-FarCry-4</link>
				<description>
				
				&lt;p&gt;I&apos;ve been a &lt;em&gt;really&lt;/em&gt; hopeless blogger lately so I thought I&apos;d kick things back into gear with some &lt;a href=&quot;http://www.farcrycms.org/&quot;&gt;FarCry 4&lt;/a&gt; goodness. FarCry 4 now uses TinyMCE for it&apos;s rich text editor and any customisations or editor replacements are done by extending &lt;tt&gt;richtext.cfc&lt;/tt&gt;. This quick example just shows you how to change the configuration options of TinyMCE.&lt;/p&gt;&lt;p&gt;I wanted to specifically make changes to the HTML formatting output, HTML editor window, and default table attributes, but there is a whole lot more you can do with TinyMCE too - check out the &lt;a href=&quot;http://wiki.moxiecode.com/index.php/TinyMCE:Index&quot;&gt;TinyMCE Wiki&lt;/a&gt; for a full reference of configuration, button and plugin options.&lt;/p&gt;&lt;p&gt;In your project you will need to create a &lt;tt&gt;formtools&lt;/tt&gt; folder inside &lt;tt&gt;/farcry/yourproject/packages&lt;/tt&gt;, and create a file called richtext.cfc. This new component will extend &lt;tt&gt;farcry.core.packages.formtools.richtext&lt;/tt&gt; and will override the &lt;tt&gt;getConfig()&lt;/tt&gt; function - pretty straight forward really :)&lt;/p&gt;&lt;p&gt;Below is my sample richtext.cfc (use at your own peril, comments are welcome!)&lt;/p&gt;&lt;p&gt;&lt;textarea name=&quot;code&quot; class=&quot;xml&quot; cols=&quot;60&quot; rows=&quot;15&quot;&gt;
&lt;cfcomponent extends=&quot;farcry.core.packages.formtools.richtext&quot; name=&quot;richtext&quot; displayname=&quot;Rich Text Editor&quot; hint=&quot;Used to liase with longchar type fields&quot;&gt;
	
	&lt;cffunction name=&quot;getConfig&quot; access=&quot;public&quot; output=&quot;false&quot; returntype=&quot;string&quot; hint=&quot;This will return the configuration that will be used by the richtext field&quot;&gt;
	
		&lt;cfset var configJS = &quot;&quot; /&gt;
		
		&lt;cfsavecontent variable=&quot;configJS&quot;&gt;
			&lt;cfoutput&gt;			
				theme : &quot;advanced&quot;,
				plugins : &quot;table,advhr,farcrycontenttemplates,advimage,advlink,preview,zoom,searchreplace,print,contextmenu,paste,directionality,fullscreen,spellchecker&quot;,
				theme_advanced_buttons1_add : &quot;pasteword,pastetext,separator,search,replace,spellchecker,separator,fullscreen&quot;,
				theme_advanced_buttons2_add : &quot;separator,farcrycontenttemplates&quot;,
				theme_advanced_buttons3_add_before : &quot;tablecontrols,separator&quot;,			
				theme_advanced_toolbar_location : &quot;top&quot;,
				theme_advanced_toolbar_align : &quot;left&quot;,
				theme_advanced_path_location : &quot;bottom&quot;,
				theme_advanced_resize_horizontal : true,
				theme_advanced_resizing : true,
				extended_valid_elements: &quot;code,colgroup,col,thead,tfoot,tbody,abbr,blockquote,cite,button,textarea[name|class|cols|rows],script[type],img[style|class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]&quot;,
				remove_linebreaks : false,
				relative_urls : false,
				
				&lt;!--- customisations ---&gt;
				content_css : &quot;/css/tinymce-content.css&quot;,
				apply_source_formatting : true,
				fix_table_elements : true,
				remove_trailing_nbsp : true,
				theme_advanced_source_editor_width : &quot;900&quot;,
				theme_advanced_source_editor_height : &quot;700&quot;,
				
				&lt;!--- customisations: table plugin ---&gt;
				table_default_border: 0,
				table_default_cellpadding: 0,
				table_default_cellspacing: 1,
		
				verify_html : false
		
			&lt;/cfoutput&gt;
		&lt;/cfsavecontent&gt;
		
		&lt;cfreturn configJS /&gt;
	&lt;/cffunction&gt;
		
&lt;/cfcomponent&gt;
&lt;/textarea&gt;&lt;/p&gt;&lt;p&gt;After your new file is in place and has been saved you&apos;ll need to do an ?updateapp=1 for the new configuration to take effect. That should be all there is to it!&lt;/p&gt; 
				</description>
				
				<category>FarCry</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Tue, 02 Oct 2007 02:18:00 -0700</pubDate>
				<guid>http://www.madfellas.com/blog/index.cfm/2007/10/2/Extending-richtextcfc-in-FarCry-4</guid>
				
			</item>
			
			<item>
				<title>I&apos;m on the Goog!</title>
				<link>http://www.madfellas.com/blog/index.cfm/2007/7/1/Im-on-the-Goog</link>
				<description>
				
				&lt;p&gt;Last week I noticed that my posts are now aggregated on &lt;a href=&quot;http://www.fullasagoog.com&quot;&gt;&quot;the &apos;Goog&quot;&lt;/a&gt; so I thought I&apos;d give the site a bit of a brush up this weekend :)&lt;/p&gt;&lt;p&gt;I&apos;ve given the design a quick refresh, still sticking with the dark theme and adding a bit more of a Vista touch to it (yeah, I&apos;m a sucker for that glass effect). I&apos;ve also worked in some inline comments for BlogCFC using &lt;a href=&quot;http://www.danvega.org/blog/index.cfm/2007/6/27/Inline-comments-in-blogCFC&quot;&gt;Dan Vega&apos;s recent post&lt;/a&gt; as a guide. (Thanks Dan, it helped a lot!).&lt;/p&gt;&lt;p&gt;Since I don&apos;t have an About Me page I should introduce myself a little. I&apos;m a 26 year old Aussie and I&apos;ve been working with ColdFusion for the last couple of years. I&apos;m currently working on a couple of &lt;a href=&quot;http://www.farcrycms.org/&quot;&gt;FarCry&lt;/a&gt; sites and other internal apps for the government department I work for. I think CF is the most elegant language I&apos;ve had the pleasure of working with on the web and can&apos;t wait for ColdFusion 8 to make my job even easier (and more enjoyable!). I also created the &lt;a href=&quot;http://www.madfellas.com/blog/index.cfm/2007/3/4/webDU-2007-Countdown-gadget-for-Vista-Sidebar&quot;&gt;webDU 2007 countdown gadget&lt;/a&gt; earlier this year, which had about 150 downloads (not too shabby considering everyone loves Macs these days, haha).&lt;/p&gt;&lt;p&gt;I&apos;m also addicted to &lt;a href=&quot;http://www.guitarherogame.com/gh2/&quot;&gt;Guitar Hero II&lt;/a&gt; on the Xbox 360 :) I&apos;ll probably throw my gamer card up on the home page in the next few days (it&apos;s currently just a blank canvas).&lt;/p&gt;&lt;p&gt;In the near future I hope to cover some beginner aspects of FarCry 4.x, perhaps on Custom Types, Scaffolding, Custom Admin and Formtools. Armed with a small amount of knowledge you can build some pretty neat stuff in no time at all... Needless to say I think FarCry rocks!&lt;/p&gt;&lt;p&gt;Anyway, enough of my rambling. I look forward to having some new readers and hopefully I can contribute something back to the community.&lt;/p&gt;&lt;p&gt;Cheers.&lt;/p&gt; 
				</description>
				
				<category>General</category>				
				
				<category>FarCry</category>				
				
				<category>Xbox 360</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Sun, 01 Jul 2007 05:27:00 -0700</pubDate>
				<guid>http://www.madfellas.com/blog/index.cfm/2007/7/1/Im-on-the-Goog</guid>
				
			</item>
			</channel></rss>