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)
 An auto-post merge mod for double posts???
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 10 December 2006 :  14:55:36  Show Profile  Visit HuwR's Homepage  Reply with Quote
will take a look later, but don't have access to my editing stuff at the moment, am currently sat watching BBC Sports personality of the year<
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 10 December 2006 :  15:03:00  Show Profile  Reply with Quote
That's fine HuwR. Just let me know what I messed up with so I can get this working.

Thanks<

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 10 December 2006 :  15:39:56  Show Profile  Visit HuwR's Homepage  Reply with Quote
from the error it would appear that your REPLY tables R_MESSAGE field is of type nText rather than Text as is standard for Snitz, which is why the code I posted is failing, it will need rewriting to work with an nText field<
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 10 December 2006 :  15:52:31  Show Profile  Reply with Quote
Is this something you could please do?

Again, if I was familiar with snitz, I'd do this myself. But, I'm not and that's the main reason I come to these forums for help.<

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 10 December 2006 :  16:16:43  Show Profile  Visit HuwR's Homepage  Reply with Quote
try replacing the main block of code I posted previously with the one below.


'## Mod to merge double post replies
boolDoPost = true
' Did this user make the last post
strSqlCheck = "SELECT T_LAST_POST_REPLY_ID FROM " & strActivePrefix & "TOPICS "
strSqlCheck = strSqlCheck + "WHERE T_REPLIES > 0 AND T_LAST_POST_AUTHOR = " & rs("MEMBER_ID")
set rsDCheck = my_Conn.Execute (strSqlCheck)
if rsDCheck.EOF or rsDCheck.BOF then 'didn't double post so let's carry on normally
set rsDCheck = nothing
'## Mod to merge double post replies
strSql = "INSERT INTO " & strTablePrefix & "REPLY "
strSql = strSql & "(TOPIC_ID"
strSql = strSql & ", FORUM_ID"
strSql = strSql & ", CAT_ID"
strSql = strSql & ", R_AUTHOR"
strSql = strSql & ", R_DATE "
if strIPLogging <> "0" then
strSql = strSql & ", R_IP"
end if
strSql = strSql & ", R_STATUS"
strSql = strSql & ", R_SIG"
strSql = strSql & ", R_MESSAGE"
strSql = strSql & ") VALUES ("
strSql = strSql & Topic_ID
strSql = strSql & ", " & Forum_ID
strSql = strSql & ", " & Cat_ID
strSql = strSql & ", " & rs("MEMBER_ID")
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
if strIPLogging <> "0" then
strSql = strSql & ", " & "'" & UserIPAddress & "'"
end if
' DEM --> Added R_STATUS to allow for moderation of posts
' Used R_STATUS = 1 to match the topic status code.
if Moderation = "Yes" then
strSql = strSql & ", 2"
else
strSql = strSql & ", 1"
end if
' DEM --> End of Code added
if Request.Form("sig") = "yes" and strDSignatures = "1" then
strSql = strSql & ", 1 "
else
strSql = strSql & ", 0 "
end if
strSql = strSql & ", " & "'" & txtMessage & "'"
strSql = strSql & ")"
'## Mod to merge double post replies
else
boolDoPost = false ' they double posted, lets update the last reply
set rsRupdate = my_Conn.Execute ("SELECT REPLY_ID,R_MESSAGE FROM " & strActivePrefix & "REPLY WHERE REPLY_ID=" & rsDCheck("T_LAST_POST_REPLY_ID"))
set rsDCheck = nothing
strSql = "UPDATE " & strActivePrefix & "REPLY "
strSql = strSql & "SET R_MESSAGE = '" & rsRupdate("REPLY_ID") & "<hr>" & txtMessage & "' "
' DEM --> Added R_STATUS to allow for moderation of posts
' Used R_STATUS = 1 to match the topic status code.
if Moderation = "Yes" then
strSql = strSql & ",R_STATUS = 2 "
else
strSql = strSql & ",R_STATUS = 1 "
end if
strSql = strSql & "WHERE REPLY_ID=" & rsRupdate("REPLY_ID")
set rsRupdate = nothing
'do the update
end if
'## Mod to merge double post replies


Once again, can't guarentee it at all, I don't even have any Snitz code on this laptop, so am just taking a gues

One thing I did realise is that the code will still update the users post count, will post some code to fix that later when I am back on my main machine.<
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 10 December 2006 :  16:41:01  Show Profile  Reply with Quote
Well, no error messages this time. However, after I make a post, all posts in the topic disappear and the "Topic" bar appears twice.

Let me know what I can do to correct this. <

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 10 December 2006 :  17:15:25  Show Profile  Visit HuwR's Homepage  Reply with Quote
I have absolutely no idea, all the code does that I posted is to update the last reply with the current posted text, it should have no other affect whatsoever. I'm sorry but I can not offer any further help, your code is not standard code and your database is not a standard database, I therefore have no way whatsoever of working out what your code is doing or why it would behave the way it does, sorry but you are on your own<
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 10 December 2006 :  17:18:09  Show Profile  Reply with Quote
Hm. Is this line correct: strSql = strSql & "(TOPIC_ID"

The database is a regular MS SQL. The code does seem to have been strangely modified before I became server admin.<

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 10 December 2006 :  17:29:01  Show Profile  Visit HuwR's Homepage  Reply with Quote
your database is not a regular Snitz database if it was the R_MESSAGE field would be a TEXT not nTEXT field, as for 'Is this line correct: strSql = strSql & "(TOPIC_ID" '
I have no idea, since I don't know what line you are referring to, as I said, sorry but I can't help any further.<
Go to Top of Page

CalloftheHauntedMaster
Junior Member

289 Posts

Posted - 14 December 2006 :  18:24:28  Show Profile  Reply with Quote
*sigh* thanks for the efforts.

Anyone familiar with the oddly modified code I have who is willing to try and help out? <

This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Go to Top of Page

kyodai
New Member

Azerbaijan
74 Posts

Posted - 29 May 2009 :  18:17:55  Show Profile  Reply with Quote
SOrry to reply to such an old thread but this is the only one related to what i wanted to do. I like the idea of merging double posts, as it became quite common on my forums, on one site by spammers who just wanted to up their post count, then by newbies who simply didnt care to read rules or think about the edit button and then by people who want to "bump" their post up to top of the list.


Well to make it short - the posted solution here simply didnt work for me. No idea, but it's probably because i already got so many mods installed??? I really dont know much about asp so i tried to uderstand what the error was, but simply didnt get it. I fixed some mods that didn't work out-of-the-box yet, but here i really didnt get what was wrong.

So i made my own version from scratch, as good as i understand asp and after some trial and error it finally worked! No more double posts in my forums...


My Table is called FORUM_TOPICS, if you have another prefix you might want to change it. This is a very basic mod, but i think beside the table name it is very compatible with all other mods and addons.


All it does is checking whether the last post in the topic was by the current user and if yes and he tries to reply he will get an error message to rather use the edit button. I hope this helps some people.



Kyodai Anti Double Post Mod 1.0
Last Updated 05/29/2009

Description: 
This mod simply disallows double posting, which means a member can't reply twice to a thread. If a member posts a 

reply and then tries to post a second reply an error message appears that says "Sorry, double posting is not 

allowed. Please use the edit button if you want to add information to your previous post."

Features:
Disallows double posting
Disables members to reply to their own topic if noone else has posted yet
Obviously also disables the typical "bumps" members do to get their Topic on top


Possible Features for future releases:
Maybe change this so instead of displaying the message it automatically merges the reply with the previous one.

Installation difficulty: 2  (1=Easy - 10=Hard)
              

###############
## INSTALLATION
###############
There are no files supplied with this mod as it is intended to edit your current file
Be sure to backup your file first!


####################################################################
## Post_info.asp
####################################################################
around line 1000 - find this:
   
if MethodType = "Reply" or MethodType = "ReplyQuote" or MethodType = "TopicQuote" then
	
	'## Forum_SQL


below this add:


  

' Kyodai anti-double post
		
strSQL = "SELECT T_LAST_POST_AUTHOR FROM FORUM_TOPICS WHERE TOPIC_ID = " & Topic_ID
set rs = my_Conn.Execute (strSql)
if rs.BOF or rs.EOF  then '##  no result
	rs.close
	set rs = nothing
	' "No Result"
	else
	myPostAuthor = rs("T_LAST_POST_AUTHOR") 
	rs.close
	set rs = nothing
	' Saved last Post Author name	
end if

' end Kyodai Anti-double post



   
A few lines below that - find this:


   err_Msg = "Invalid Password or User Name"
		Go_Result(err_Msg), 0
		Response.End
	else


add this directly below:


'kyodai anti double post

MyMemberName = rs("MEMBER_ID")

'end kyodai anti-double post


Another few lines below find this:

if txtMessage = " " then
			Go_Result "You must post a message!", 0
			Response.End
		end if
add this directly below:

'kyodai anti double post

	if myPostAuthor = myMemberName then
		rs.close
		set rs = nothing
		err_Msg = "Sorry, double posting is not allowed. Please use the edit button if you want to add 

information to your previous post."
		Go_Result(err_Msg), 0
		Response.End
	end if
		
'end kyodai anti-double post


Edited by - kyodai on 13 June 2009 17:09:34
Go to Top of Page

kyodai
New Member

Azerbaijan
74 Posts

Posted - 30 June 2009 :  16:23:38  Show Profile  Reply with Quote
On a side note: Afterwards i added an "if mLev < 3 then" to allow staff members to double post, because for staff sometimes it does make sense. AT least my staff complained about it, i added it and now users may not double post but staff does. Awwww I'm just the man for solutions... ^__^
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 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.1 seconds. Powered By: Snitz Forums 2000 Version 3.4.07