Here you go. Open source rules! All I ask is that you keep the tag comments
in tact. Make your mods/comments and pass it along to someone else (me too)
that may need it.

Phil Hulsey

BTW - you need to create a file named "wordFilter_words.txt" in a text file
and place it in the same directory (custom tag or local) as this tag for
default functionality. (sure you could have figured that one out on your
own.)


<!--- BEGIN CODE --->

<cfsetting enablecfoutputonly="Yes">
<!--- 
Have a heart...leave these comments in here :)
Phil Hulsey 8/4/2000
[EMAIL PROTECTED]

params:
        help - displays help info.
        rc - (optional) return code defaults to rc_wordFilter
        text - text to search and replace
        wordsFile - (optional) absolute path to file with words to search
for. 
                        defaults to standard "dirty word" filter file
(wordFilter_words.txt) in the same directory as this file.
                        format is words seperated by "|" (i.e.
word1|word2|word3|word4)
        wordsList - (optional) overrides wordFile attribute. list of words
seperated by "|" to search for.
 --->

 <!--- help --->
<cfif parameterexists(attributes.help)>
        <cfoutput>
        <pre>
  Phil Hulsey 8/4/2000
  [EMAIL PROTECTED]
        
  params:
    help - displays help info.
    rc - (optional) return code defaults to rc_wordFilter
    text - text to search and replace
    wordsFile - (optional) absolute path to file with words to search for. 
        defaults to standard "dirty word" filter file (wordFilter_words.txt)

                                in the same directory as this file.
        format is words seperated by "|" (i.e. word1|word2|word3|word4)
    wordsList - (optional) overrides wordFile attribute. list of words 
                    seperated by "|" to search for.
                </pre>
        </cfoutput>
        <cfabort>
</cfif>

<!--- security --->
<cfif not parameterexists(attributes.text)>
        <cfoutput>wordFilter error! text attributes is required. this tag
must be called from within a .cfm file. 
        use the "help" attribute with this tag for more
information.</cfoutput>
        <cfabort>
</cfif>

<!--- filters out any words...usually bad ones :) --->
<!--- get the words --->
<cfparam name="attributes.wordsFile"
default="#getdirectoryfrompath(getcurrenttemplatepath())#wordFilter_words.tx
t">

<!--- check to see if word list designated --->
<cfif not parameterexists(attributes.wordsList)>
        <cffile action="READ" variable="attributes.wordsList"
file="#attributes.wordsFile#">
</cfif>

<!--- run the filter --->
<cfset attributes.myFilteredString =
ReReplaceNoCase(attributes.text,attributes.wordsList,"[filtered]","ALL")>

<!--- return the filtered string --->
<cfparam name="attributes.rc" default="rc_wordFilter">
        <cfoutput>
        setting caller.#attributes.rc# to #attributes.myFilteredString#.<br>
        </cfoutput>
<cfset "caller.#attributes.rc#" = attributes.myFilteredString>

<cfsetting enablecfoutputonly="No">
<!--- END CODE --->



-----Original Message-----
From: Nathan Shaw [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 04, 2000 12:22 PM
To: [EMAIL PROTECTED]
Subject: OT: Sailor/Toilet Tag


Thanks everyone for the comments/feedback.

Yeah, the tag is said to be free, but it is encrypted. You pay $20 to get it
decrypted.

The Sailor tag does not really do what I want so, I will probably write one
myself, but wanted to see if I could save myself the time and/or $20. I now
have a good start on it. Thanks.
-----------------------------------------------
Nathan Shaw
Web Designer/Developer





_______________________________________________________
Say Bye to Slow Internet!
http://www.home.com/xinbox/signup.html

----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to