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/Code)
 Flood Control
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  12:06:55  Show Profile
I have this mod for flood/spam control and it only works on replies not new topics. So, if someone wants to click 50 times on the submit button will work.

Here is the code I have for the current flood control I have.

If you want to stop people doing multi posts,

Open up post_info.asp and insert this function at the end, just before the closing

%>


function CanUserPost(fTopicID, fMemberID)
lastAllowedPost = DateToStr(DateAdd("n",-1,strForumTimeAdjust))
strSql = "SELECT MAX(R_DATE) AS LASTPOST FROM " & strTablePrefix & "REPLY WHERE "
strSql = strSql & "TOPIC_ID = " & fTopicID & " AND R_AUTHOR = " & fMemberID
rsTmp = my_conn.execute(strSQL)
if rsTmp("LASTPOST") > lastAllowedPost then
CanUserPost = "no"
else
CanUserPost = "yes"
end if
end function


Next look for this code

'## Forum_SQL
strSql = "INSERT INTO " & strTablePrefix & "REPLY "

imediately above the insert statement, put this line of code

if CanUserPost(Request.Form("TOPIC_ID"), rs("MEMBER_ID")) = "yes" then

now scroll down past the updates for the counts until you find


my_Conn.Execute (strSql)
if Err.description <> "" then

change it be

my_Conn.Execute (strSql)
else
Err.description = "You have already posted, please wait 60 secs before reposting"
end if
if Err.description <> "" then

That should do it






Edited by - raw on 04 July 2001 12:07:29

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 04 July 2001 :  12:13:48  Show Profile
Here is what I did over at www.forumco.com/support/default.asp

in post_info.asp

look for:

if Request.Form("Method_Type") = "Topic" then


just below that is this line:

	strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, "&Strdbntsqlname


change it to look like this:

	strSql = "SELECT MEMBER_ID, M_LEVEL, M_EMAIL, M_LASTPOSTDATE, "&Strdbntsqlname


do the same thing just below:

if Request.Form("Method_Type") = "Reply" or Request.Form("Method_Type") = "ReplyQuote" or Request.Form("Method_Type") = "TopicQuote" then



Now go back up to the first section you edited and look for this:

		if not(chkForumAccess(Request.Form("FORUM_ID"))) then
Go_Result "You are not allowed to post in this forum !", 0
end if


right below that add:

		if rs("M_LASTPOSTDATE") > DateToStr(DateAdd("n",-1,strForumTimeAdjust)) and mLev < 3 then
Go_Result "Sorry! We have flood control activated.<br>You cannot post within 60 seconds of your last post.<br>Please try again after this period of time elapses.", 0
end if



Now do the same thing in the second section that you edited above.

This allows Admins and Moderators to post without the flood control.
Go to Top of Page

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  12:16:09  Show Profile
Thanks, I figured you'd be the one to answer this. I just didn't think it would be sooo fast.

Go to Top of Page

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  12:39:00  Show Profile
For some reason it isn't working...

Go to Top of Page

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  12:44:23  Show Profile
Here is a copy of my post_info.asp

Go to Top of Page

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  12:55:07  Show Profile
I got it.

I see you edited the original post to get rid of this

if strFloodCheck = 1 then

end if


Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 04 July 2001 :  13:03:06  Show Profile
Yep, I had added an Admin Option to turn it on/off, that strFloodCheck if/then was part of it. It's not really necessary, especially since it does require you to add a database field to the FORUM_CONFIG table and edit the admin_config_features.asp & config.asp files.
Go to Top of Page

raw
Starting Member

45 Posts

Posted - 04 July 2001 :  13:30:59  Show Profile
Yeah, I was reading it after it didn't work and said to myself..."where is strFloodControl being turned on?"

I also went and killed the "and if mlev < 3" because I don't want admin spamming either.

Go to Top of Page

suhern
Junior Member

186 Posts

Posted - 04 July 2001 :  22:35:34  Show Profile
This sounds good. Is is possible to get the updated version here? Would be most helpful.

quote:

I got it.

I see you edited the original post to get rid of this

if strFloodCheck = 1 then

end if






Go to Top of Page

raw
Starting Member

45 Posts

Posted - 05 July 2001 :  00:41:09  Show Profile
http://www.raw1.net/floodcontrol.txt

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07