473,394 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

deny works

Hi people,
Somebody knows where I can get a tutorial, or any help, to make "deny words"
in my forum?

thanks a lot
Jul 22 '05 #1
7 1304
"Eduardo Rosa" wrote...
Hi people,
Somebody knows where I can get a tutorial, or any help, to make "deny words" in my forum?


Hi,

Depends how you want to do it - I did something similar for 'ignore words'
for searches, in my case I loaded in some 390 common words from an excel
spreadsheet into SQL server, I then populate an array with these one the
relevant page, and then ignore them etc...

Not sure whether you'd want to do this upon submission of the post and then
replace them with say nothing, or **** them out or something, but the same
process would apply...a simplistic example could be:
<%
Dim aIgnoreWords(3)

aIgnoreWords(0) = "bottom"
aIgnoreWords(1) = "arse"
aIgnoreWords(2) = "bum"

strPostContent = "I have a really large bottom, my bum is huge, its the
largest arse I've ever seen!!!"

Response.Write "Before tidy up: " & strPostContent
Response.Write "<br><br>"

For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, aIgnoreWords(intLoop), "***")

Next intLoop

Response.Write "After tidy up: " & strPostContent
%>

I hope this helps, by the way it's untested but should give you a pointer in
the right direction, and perhaps a little smile :o)

Regards

Rob
Jul 22 '05 #2
> For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, aIgnoreWords(intLoop), "***")

Next intLoop

Just spotted this - sorry, remove the intLoop part from that last line - so
it reads:

For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, aIgnoreWords(intLoop), "***")

Next
Regards

Rob
Jul 22 '05 #3
thanks Rob

that's some like that, but I need a smarter code that don't replace words
like sit (sit down) from site (website).

thanks again

"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> escreveu na mensagem
news:UO******************@text.news.blueyonder.co. uk...
"Eduardo Rosa" wrote...
Hi people,
Somebody knows where I can get a tutorial, or any help, to make "deny

words"
in my forum?


Hi,

Depends how you want to do it - I did something similar for 'ignore words'
for searches, in my case I loaded in some 390 common words from an excel
spreadsheet into SQL server, I then populate an array with these one the
relevant page, and then ignore them etc...

Not sure whether you'd want to do this upon submission of the post and
then
replace them with say nothing, or **** them out or something, but the same
process would apply...a simplistic example could be:
<%
Dim aIgnoreWords(3)

aIgnoreWords(0) = "bottom"
aIgnoreWords(1) = "arse"
aIgnoreWords(2) = "bum"

strPostContent = "I have a really large bottom, my bum is huge, its the
largest arse I've ever seen!!!"

Response.Write "Before tidy up: " & strPostContent
Response.Write "<br><br>"

For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, aIgnoreWords(intLoop), "***")

Next intLoop

Response.Write "After tidy up: " & strPostContent
%>

I hope this helps, by the way it's untested but should give you a pointer
in
the right direction, and perhaps a little smile :o)

Regards

Rob

Jul 22 '05 #4
"Eduardo Rosa" wrote ...
that's some like that, but I need a smarter code that don't replace words
like sit (sit down) from site (website).


You'll need to stick a space on either end then to make it a seperate
word...

<%
Dim aIgnoreWords(3)

aIgnoreWords(0) = "bottom"
aIgnoreWords(1) = "arse"
aIgnoreWords(2) = "bu" ' NOTE - I've changed this so that it shouldn't
spot bum in the sentance

strPostContent = "I have a really large bottom, my bum is huge, its the
largest arse I've ever seen!!!"

Response.Write "Before tidy up: " & strPostContent
Response.Write "<br><br>"

For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, chr(32) & aIgnoreWords(intLoop)
& chr(32), "***")

Next

Response.Write "After tidy up: " & strPostContent
%>

The chr(32) & aIgnoreWords(intLoop) & chr(32) puts a space either end of the
word matching.

Note - when I did this for my searching I had to go down the road of all
punctuation also, ie. (_ = space in the following example),

_bum_
_bum!
_bum.
_bum?

and so on...

Thats for the end of a sentance, you could of course have the same at the
start of a sentance, thus...

_bum_
bum_
..bum_
?bum_
!bum_

you should also decide whether you are concerned about case sensitivity, ie

LCase / UCase to add to the above...

Hope this helps,

Rob

Jul 22 '05 #5
On Tue, 18 Jan 2005 15:52:35 -0200, "Eduardo Rosa"
<ed*****@clas.com.br> wrote:
Somebody knows where I can get a tutorial, or any help, to make "deny words"
in my forum?


It's rather simple, but depends on where you want to deny them, how
you want to deal with them if denied, etc. For example, instead of
"damn" you could either disallow the word and remove it, disallow the
word and force the user to change the post before it's accepted, or
accept the word but replace it with a different word such as "darn" or
asterisks such as "****".

Best tutorial would be to grab a few of the open source or freeware
forum scripts that exist and review the methods and coding they use.
You can learn a lot by looking at other people's code. Including the
wrong way to do things. :)

Jeff
Jul 22 '05 #6
Eduardo Rosa wrote:
thanks Rob

that's some like that, but I need a smarter code that don't replace
words like sit (sit down) from site (website).


Of course, that means you will have to filter both "frell" and "frelling"
(not to mention "frelled").

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #7
"Rob Meade" <ro********@NO-SPAM.kingswoodweb.net> wrote in message
news:zG*****************@text.news.blueyonder.co.u k...
"Eduardo Rosa" wrote ...
that's some like that, but I need a smarter code that don't replace words like sit (sit down) from site (website).
You'll need to stick a space on either end then to make it a seperate
word...

<%
Dim aIgnoreWords(3)

aIgnoreWords(0) = "bottom"
aIgnoreWords(1) = "arse"
aIgnoreWords(2) = "bu" ' NOTE - I've changed this so that it shouldn't
spot bum in the sentance

strPostContent = "I have a really large bottom, my bum is huge, its the
largest arse I've ever seen!!!"

Response.Write "Before tidy up: " & strPostContent
Response.Write "<br><br>"

For intLoop = 0 To (UBound(aIgnoreWords)-1)

strPostContent = Replace(strPostContent, chr(32) &

aIgnoreWords(intLoop) & chr(32), "***")

Next

Response.Write "After tidy up: " & strPostContent
%>

The chr(32) & aIgnoreWords(intLoop) & chr(32) puts a space either end of the word matching.

Note - when I did this for my searching I had to go down the road of all
punctuation also, ie. (_ = space in the following example),

_bum_
_bum!
_bum.
_bum?

and so on...

Thats for the end of a sentance, you could of course have the same at the
start of a sentance, thus...

_bum_
bum_
.bum_
?bum_
!bum_

you should also decide whether you are concerned about case sensitivity, ie
LCase / UCase to add to the above...

Hope this helps,

Rob


He's a solution using regular expressions, retooled from this article:
http://aspfaq.com/show.asp?id=2344

<%
CONST s = "arsenal,arse,_arse_,bellbottoms,bottom,!bottom!,b umper,bum,.bum."
Dim re : Set re = New RegExp
re.Pattern="(^|[^a-z])(arse|bottom|bum)([^a-z]|$)"
re.IgnoreCase=True
re.Global=True
Response.Write re.Replace(s,"$1***$3")
%>

HTH-
Chris Hohmann
Jul 22 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Carlos Marangon | last post by:
hello! Can anyone please tell me where can I find a script that deny access if password is wrong 3 times CM
2
by: spike | last post by:
I tried to upload a .htaccess-file to the directory that i wanted to protect. This is what I wrote in it: ------------------------------------------------ <Limit GET> order deny,allow deny from...
1
by: SteveS | last post by:
Hello. This problem is perplexing me. I have a asp:button which runs a javascript function when it is clicked. It returns a true or false depending if a postback is needed. This works great...
4
by: Dan | last post by:
hi ng. i have a strange behaviour when i want to control who can access a web application by setting web.config like: <authorization> <allow users="DOMAIN\ACCOUNT,..." /> <deny users="*" /> ...
2
by: bluewind44 | last post by:
Hello, Now I make the ASP.NET projects. I have one method of Webservice that it works fine on my computer. But on the others' computer when I called the method, ACCESS DENY error occurs. ...
2
by: Wiktor Zychla [C# MVP] | last post by:
Could anyone confirm/deny that following is a bug (or at least an "unexpected behaviour")? If this is not a bug, I would be glad for a short explanation or a workaround. Issue: A generic...
5
by: profdotnet | last post by:
Below is the code of web.config file: <configuration> <system.web> <authentication mode="Forms" /> <authorization> <allow users="Admin"/> <deny users="Jack,Mary" /> <deny users="?">...
2
by: Markus Palme | last post by:
Hi NG! Is it possible to deny access to a (logged in) user that is not in any role? Placeholders like <deny roles="?"/don't seem to be possible. Regards Markus <location...
0
by: Douglas J. Badin | last post by:
Hi, The problem with Authorization is it stops at the first match and doesn't permit Grouping. On the Web Site, I am trying to Secure Page Access and SiteNaviagation by implementing the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.