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 DEV-Group
 DEV Bug Reports (Closed)
 (v3.4.03) BUG+FIX: pop_moderate.asp (#2)
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 23 September 2003 :  20:36:09  Show Profile
original post discussing this bug here:

http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=45658

here is the fix:

pop_moderate.asp


find the following (around line #206 and #269):
					UpdateUser LoopMemberID, LoopPostDate
replace both of those lines with this:
					UpdateUser LoopMemberID, LoopForumID, LoopPostDate

find the following (around line #535):
' ## UpdateUser - This will update the members table by adding to the total
' ##              posts (and total topics if appropriate), and will also update
' ##              the last forum post date and poster if appropriate.
sub UpdateUser(MemberID, PostDate)
	dim UpdateLastPost
	' -- Check to see if this post is the newest one for the member...
	strSql = " SELECT M_LASTPOSTDATE "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE MEMBER_ID = " & MemberID
	set RsCheck = my_Conn.Execute (strSql)
	if RsCheck("M_LASTPOSTDATE") < PostDate then
		UpdateLastPost = "Y"
	end if
	rsCheck.Close
	set rsCheck = nothing

	strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " SET M_POSTS = (M_POSTS + 1)"
	if UpdateLastPost = "Y" then
		strSql = strSql & ", M_LASTPOSTDATE = '" & PostDate & "'"
	end if
	strSql = strSql & " WHERE MEMBER_ID = " & MemberID
	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
end sub
and replace all of it with this:
' ## UpdateUser - This will update the members table by adding to the total
' ##              posts (and total topics if appropriate), and will also update
' ##              the last forum post date and poster if appropriate.
sub UpdateUser(MemberID, LForumID, PostDate)
	dim UpdateLastPost
	' -- Check to see if this post is the newest one for the member...
	set rsCheck = my_Conn.Execute("SELECT M_LASTPOSTDATE FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID = " & MemberID)
	if rsCheck("M_LASTPOSTDATE") < PostDate then
		UpdateLastPost = "Y"
	end if
	rsCheck.Close
	set rsCheck = nothing

	set rsFCountMP = my_Conn.Execute("SELECT F_COUNT_M_POSTS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & LForumID)
	ForumCountMPosts = rsFCountMP("F_COUNT_M_POSTS")
	rsFCountMP.close
	set rsFCountMP = nothing

	if UpdateLastPost = "Y" then
		strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
		strSql = strSql & " SET M_LASTPOSTDATE = '" & PostDate & "'"
		strSql = strSql & " WHERE MEMBER_ID = " & MemberID
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	end if

	if ForumCountMPosts <> 0 then
		strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
		strSql = strSql & " SET M_POSTS = (M_POSTS + 1)"
		strSql = strSql & " WHERE MEMBER_ID = " & MemberID
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	end if
end sub

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 23 September 2003 :  23:26:05  Show Profile
fixed in v3.4.04
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07