cfxmlblog  

RE: Re[2]: [CFXML_Blog] Upgrading to 1.5beta2

Steven Erat
Thu, 14 Aug 2003 12:19:50 -0700

Oguz:

>> "- I want to add code blocks into blogs but with a standard installation I can not"

I do this with the <xmp> tag.  For example the text area in a blog entry might look 
like this:

--------------------------
Hi everyone, here is some new code:
<hr />
<xmp style="color:#880000;font-size:7pt;">
<cfset foo = 1>
<cfoutput>#foo#</cfoutput>
</xmp>
That's all!
--------------------------

The code shows up exactly as intended.  One note though, the CDataFormat() function 
seems to add ##&13 in place of line breaks, so I strip them out of the display with 
replace(blogtext,"##&13","","all").

I've also recently added to my blog a regex to strip html from the rss feeds so that 
the blog text doesn't have any html tags in it.  I've seen some blog aggregators 
(mxna) trim blog descriptions and cut tags in half, which disturbs the display for the 
remainder of the blog aggregator view.  Actually, I just run the rssfeed description 
text through this custom function:

<cffunction name="cleanRssFeed" access="public" returntype="string">
        <cfargument name="text" required="Yes" type="string">
                <cfset text = REReplace(text,"<[^>]*>","","All")>
                <cfset result = 
replace(replace(text,"&##13;","","all"),"&amp;","&","all")>                            
                                 
        <cfreturn result>
</cffunction>

-Steve