Hi all,

I posted this a few days ago, and was directed towards some custom tags, but
none of them seem to work exactly how I want them, and I would like to come
up with something myself.

I have a Access db table which contains a list of badwords, and 3 ratings
for each. The administrator sets the profanity rating, with 1 being the most
strict and 3 the least. Assuming it is set to 1, the badwords should be
replaced with corresponding number of *.

So, I run a query, selecting all the badwords and their corresponding
'cleaned up' versions. Then I need to loop over a form field, checking each
word in it to see if it matches a badword, and replacing it with it's
'cleaned up' version if it does.


<!--- Pull out all the bad words from the database --->

<cfquery name="getprofanities" datasource="#APPLICATION.chatdsn#">
        SELECT ID, badword, rate1
        FROM tbl_profanity
</cfquery>

<!--- Loop over the profanity list and compare with words in the
bodytext --->


<cfloop query="getprofanities">

        <cfset newlist = ReplaceNoCase(bodytext, "getprofanities.badword",
"getprofanities.rate1", "ALL")>

</cfloop>

This code doesn't seem to work, and to be honest I'm not surprised, but my
head seems to be somewhere else today and I just can't get it!!! Any help
anyone......please?? :)

TIA

Will


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to