Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 An auto-post merge mod for double posts???

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
CalloftheHauntedMaster Posted - 07 December 2006 : 17:17:50
This is not for split topics or for merging different threads together.

This is to auto-merge a double/triple post...

For example, I'm the last poster in a thread. I post again and now I have two posts in a row (double posts). Instead of that, this mod would immediately edit my first post and add the content of my second post to it, thereby preventing a double post.

It seems pretty easy to make since the only thing necessary is a check to see if you're the last poster in the thread. If so, your posts are merged together. If not, the post proceeds as normal.

Obviously, your post count would not increase as a result of these auto-merged posts.

Anyhow, a search for this type of feature came out dry, and my knowledge of coding is just as dry. Does anyone have a mod they've designed for this or can someone design it?

Again, it seems simple provided you're familiar with snitz...<
15   L A T E S T    R E P L I E S    (Newest First)
kyodai Posted - 30 June 2009 : 16:23:38
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... ^__^
kyodai Posted - 29 May 2009 : 18:17:55
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

CalloftheHauntedMaster Posted - 14 December 2006 : 18:24:28
*sigh* thanks for the efforts.

Anyone familiar with the oddly modified code I have who is willing to try and help out? <
HuwR Posted - 10 December 2006 : 17:29:01
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.<
CalloftheHauntedMaster Posted - 10 December 2006 : 17:18:09
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.<
HuwR Posted - 10 December 2006 : 17:15:25
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<
CalloftheHauntedMaster Posted - 10 December 2006 : 16:41:01
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. <
HuwR Posted - 10 December 2006 : 16:16:43
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.<
CalloftheHauntedMaster Posted - 10 December 2006 : 15:52:31
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.<
HuwR Posted - 10 December 2006 : 15:39:56
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<
CalloftheHauntedMaster Posted - 10 December 2006 : 15:03:00
That's fine HuwR. Just let me know what I messed up with so I can get this working.

Thanks<
HuwR Posted - 10 December 2006 : 14:55:36
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<
CalloftheHauntedMaster Posted - 10 December 2006 : 14:44:15
Here is a text file of the post_info.asp as it looks like with your code (ignore the edited file name):

http://www.schoolofduel.com/bbs/post_info_edit.txt

Can you please check to make sure I didn't make a mistake in adding this code? I've looked over it twice and can't find anything wrong.

It is rather modded though.

Anyhow, your changes start at line 1851.<
HuwR Posted - 10 December 2006 : 13:59:22
quote:
What does this mean?
I have no idea.

As I said above, I have tested this code on a virgin standard Snitz install and everything works without error, if you are getting errors it is either because you have inserted the code incorrectly or something else in your post_info.asp that is not standard, either way I can't help.<
CalloftheHauntedMaster Posted - 10 December 2006 : 13:43:02
Fixed an error I made. Now I get this:

Microsoft OLE DB Provider for SQL Server error '80040e14'

Invalid operator for data type. Operator equals add, type equals ntext.

/bbs/post_info.asp, line 1914



What does this mean?<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07