Coldfish test

This is a test of Coldfish in BlogCFC on Bludragon JX 7.0x.

--UPDATE-- I never did get Coldfish working with BlueDragon. However the code below may be useful to someone. It might even be a hidden cf_gem.

<cffunction name="stripTags" access="public" output="false" returntype="string" hint="Remove all HTML tags from string">
   <cfargument name="string" type="any" required="true" hint="String to clean"/>
   <cfset var pattern = "<[^>]*>">
   <cfreturn REReplaceNoCase(arguments.string, pattern, "" , "ALL")>
</cffunction>

<!--- ##################################################################
# PCASE #
# receive a string of data in any case and return the string #
# in proper case format #
# return data string #
######################################################################## --->

<cffunction name="PCase" access="public" output="false" returntype="String" hint="receive a string of data in any case and return the string in proper case format">
   <cfargument name="string" default="" required="true" hint="string to alter">
   <cfscript>
      var listlen = listlen(arguments.string," ");
      var return_string = '';
      var pos = 0;
      for (pos=1;pos lte listlen;pos=pos+1) {
         if (len(ListGetAt(arguments.string,pos," ")) gt "1") {
            return_string = return_string & Ucase(left(ListGetAt(arguments.string,pos," "), 1)) & LCase(right(ListGetAt(arguments.string,pos," "), len(ListGetAt(arguments.string,pos," "))-1)) & " ";
         } else {
            return_string = return_string & Ucase(left(ListGetAt(arguments.string,pos," "), 1)) & " ";
         }
      }
      return Trim(return_string);
   </cfscript>   
</cffunction>

Comments