Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Block unwanted postings..
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Presario
Starting Member

46 Posts

Posted - 04 December 2006 :  11:55:13  Show Profile  Reply with Quote
Please forgive me if this has already been asked in the past (Ive tried looking but cant find anything.).

I am trying to write a little script into the forum which will STOP any postings about a certain football/soccer team (local team I may add and not a professional club)..

Obviously the script will need to check the input box where the message is being written in and when submitted a warning will appear telling the user his/her posting WILL NOT be accepted.

I know I can use the bad word filter but this doesnt really do want I want.

I need to STOP the posting happening and the user being redirected either back to the posting screen OR back to the main forum index.

If anyone could help with this then I would be indebted..

<

Edited by - Presario on 04 December 2006 12:00:23

Presario
Starting Member

46 Posts

Posted - 04 December 2006 :  13:18:46  Show Profile  Reply with Quote
Right, I have got close to what I need to achieve :


select case MethodType case "Topic", "EditTopic", "TopicQuote", "Reply", "Edit", "ReplyQuote"
postTxt = trim(Request.Form("Message"))
if postTxt = "FC United" OR postTxt = "fc united" or postTxt = "fc utd" or postTxt = "FC Utd" or postTxt = "FC utd" or postTxt = "FCUoM" then Go_Result "Your post must NOT contain anything to do with FC United!", 0
end select


The problem with this is, if a member enters a message and includes any of the terms "FC United"... somewhere in the message it doesnt pick it up.

However, if they START the message with any of the terms it WILL pick it up and tell the poster that they cannot carry on with the posting when they submit.


So can anyone advise on how to change the script to scan the entire message, picking up the `FC` terms along the way??

<

Edited by - Presario on 04 December 2006 13:21:55
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 04 December 2006 :  13:52:45  Show Profile  Send pdrg a Yahoo! Message  Reply with Quote
Or could you add the team's name to the badwords (swearwords) list?<
Go to Top of Page

Presario
Starting Member

46 Posts

Posted - 04 December 2006 :  14:07:06  Show Profile  Reply with Quote
Done that but it doesnt do what I want it to do unfortunately..


Yes I agree it deletes the names but Im after the posting not being accepted in full..<
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 04 December 2006 :  14:18:03  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
i think u woudl have to moderate all the posts before they are viewable to the public.

the way you are trying to do it is to stop people from posting useing certain words but u can use different words/combinations to overcome what you have at the moment.<

© 1999-2010 MaD2ko0l
Go to Top of Page

RArch
Junior Member

United Kingdom
103 Posts

Posted - 04 December 2006 :  15:37:50  Show Profile  Reply with Quote
You could improve your code by using the Instr function to search all "postTxt" for occurrences of your banned words.

Take a look here for some examples:
http://www.w3schools.com/vbscript/func_instr.asp

You should be able to use like this:

postTxt = lcase(postTxt) ' change to lower case
if Instr(postTxt, "fc united") or Instr(postTxt, "fc utd")... then ...

<
Go to Top of Page

Presario
Starting Member

46 Posts

Posted - 04 December 2006 :  16:10:03  Show Profile  Reply with Quote
quote:
Originally posted by RArch

You could improve your code by using the Instr function to search all "postTxt" for occurrences of your banned words.

Take a look here for some examples:
http://www.w3schools.com/vbscript/func_instr.asp

You should be able to use like this:

postTxt = lcase(postTxt) ' change to lower case
if Instr(postTxt, "fc united") or Instr(postTxt, "fc utd")... then ...





That is EXACTLY what I needed!!! Many thanks.. I have just incorporated that code (with some slight changes) into the post_info.asp page and it does what I need!

I agree there are ways around it if people want to post comments on the team `fc united` and I will sort that as and when , but hopefully when people go and try to post as they are doing, then this new script MAY put them off in the future...

Cheers anyway and thanks to all of you for your help!!
<
Go to Top of Page

RArch
Junior Member

United Kingdom
103 Posts

Posted - 04 December 2006 :  16:53:13  Show Profile  Reply with Quote
Glad it helped, why dont you post what you did as others may find it useful.
<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 05 December 2006 :  04:16:09  Show Profile  Reply with Quote
I'd also recommend going the moderation route rather than hard coding checks for strings that members can easily get around; with moderation turned on, your admins and moderators can delete any posts that mention the team before other members see them and send an e-mail to the posting member informing them why their post was deleted.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07