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)
 Merge USERS?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Todd
New Member

USA
63 Posts

Posted - 01 February 2011 :  18:43:56  Show Profile  Visit Todd's Homepage  Reply with Quote
Did a search for this but only found merging forums/topics etc. but nothing on users. My forum uses Access for it's database.

I have a user who contributed for years, disappeared and came back with a different account.

Would it be possible to merge all of his posts/replies/pm's etc into just one of those existing accounts?


Admin for the Tyco Collector's Forum

AnonJr
Moderator

United States
5768 Posts

Posted - 01 February 2011 :  19:38:52  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Not sure about anything beyond posts and replies, but you should be able to accomplish it without too much fuss by writing a custom DBS script.

I did something similar for a user years ago. I can't seem to locate the DBS script at the moment, but there is a guide for writing them around here somewhere.
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 02 February 2011 :  11:42:06  Show Profile  Reply with Quote
Just a quick fix till you get the members merged. I wrote a mod for a friends snitz forum that temporarily changes usernames. It doesn't merge anything, but the old name will display as the new name throughout the forum.

This is a basic version of it, good for 1 name.

find this line in inc_func_common.asp
Case "display"

Add this line under it
if trim(fString) = "oldname" then fString = "newname"

oldname = name you want to replace
newname = name you want to replace it with.

Merging the ids would involve updating a lot of tables. topics forums,reply, all the archives,moderator,subscription, whatever mods you have like PMs. Not that it would be hard but you'd have to do each table separately.

    _-/Cripto9t\-_
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 02 February 2011 :  13:09:15  Show Profile  Reply with Quote
Sounds like a useful mod, though. I'll take a look at writing something.
Go to Top of Page

Todd
New Member

USA
63 Posts

Posted - 02 February 2011 :  18:16:09  Show Profile  Visit Todd's Homepage  Reply with Quote
Thanks, I appreciate the responses. Just thought of another caveat with doing this. Within the posts I'm sure people who replied have at times said "Yeah, I agree with USER". I would edit those myself but this guy posted close to 2,000 times under the first name and only about 100 under his current name. I could of course merge the new "smaller" account into the larger older account.

Is there a way to change every instance of a word in the entire database after I might merge? I guess I could probably do that right in Access itself. First thing to tackle is still the merge.


Admin for the Tyco Collector's Forum

Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 03 February 2011 :  02:02:58  Show Profile  Reply with Quote
Changing every instance of a word? Depending on the number of users and topics/replies, etc., that could be a very long process and would probably time-out.

Looking at the feasibility of merging users, in most tables the MEMBER_ID is the only defining attribute .. and that's an automatic field which cannot be changed. It would be easy to change the author fields pertaining to topics/replies (would correct stats, etc), but any mention of the user in posts? I wouldn't do that in a busy forum.

In retrospect, Cripto9t's solution is probably the best approach. Of course, it doesn't combine statistics, etc.

For simply changing the authors of all replies/topics, you can use the Alt Mod Setup function in the Admin panel. Replace the two instances of OLDNUM with the MEMBER_ID to be merged and the two instances of NEWNUM with the MEMBER_ID to be merged into.


[UPDATE]
FORUM_TOPICS
T_AUTHOR#(NEWNUM)#(OLDNUM)
[END]

[UPDATE]
FORUM_REPLY
R_AUTHOR#(NEWNUM)#(OLDNUM)
[END]


Alternatively, if you don't want to have to look up MEMBER_IDs, etc.; you can use this:

"admin_mergeuser.asp"


<%
'###############################################################################
'##
'##			Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'##			Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modIfy it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.	The "powered by" text/logo with a
'## link back to http://Forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful but
'## WITHOUT ANY WARRANTY; without even an implied warranty of MERCHANTABILITY
'## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
'## For more details.
'##
'## You should have received a copy of the GNU General Public License along
'## with this program; If not, write to:
'##
'##			Free Software Foundation, Inc.
'##			59 Temple Place, Suite 330
'##			Boston, MA 02111-1307
'##
'## Support can be obtained from our support Forums at:
'##
'##			http://Forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##			manderson@snitz.com
'##
'###############################################################################
'##
'## admin_mergeuser.asp
'##
'###############################################################################
Response.Buffer = true
on error resume Next
Server.ScriptTimeout = "1200"
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_admin.asp"-->
<!--#INCLUDE FILE="inc_func_member.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp"-->
<% 
If Session(strCookieURL & "Approval") <> "15916941253" Then
	scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
End If
Response.Write	"			<table border=""0"" width=""100%"">" & vbNewLine & _
	"				<tr>" & vbNewLine & _
	"			<td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"					" & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpenTopic,"","align=""absmiddle""") & " Admin Section<br />" & vbNewLine & _
	"					" & getCurrentIcon(strIconBlank,"","align=""absmiddle""") & getCurrentIcon(strIconBar,"","align=""absmiddle""") & getCurrentIcon(strIconFolderOpen,"","align=""absmiddle""") & "Members' Accounts Merger<br /></font></td>" & vbNewLine & _
	"		</tr>" & vbNewLine & _
	"			</table>" & vbNewLine & _
	"			<br />" & vbNewLine
Response.Flush

If Request.Form("Merger") = "confirm" and MEMBERID = intAdminMemberID Then
	strSql = "SELECT MEMBER_ID, M_NAME FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & Request.Form("OLD_M_NAME") & "'"
	set rsOld=my_Conn.Execute(strSql)
	If not rsOld.EOF Then
		OLD_MEMBER_ID = rsOld("MEMBER_ID")
		OLD_M_NAME = rsOld("M_NAME")
		rsOld.Close
	End If
	set rsOld = Nothing
	strSql = "SELECT MEMBER_ID, M_NAME FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME = '" & Request.Form("NEW_M_NAME") & "'"
	set rsNew=my_Conn.Execute(strSql)
	If not rsNew.EOF Then
		NEW_MEMBER_ID = rsNew("MEMBER_ID")
		NEW_M_NAME = rsNew("M_NAME")
		rsNew.Close
	End If
	set rsNew = Nothing
	strSql = "UPDATE " & strTablePrefix & "TOPICS SET T_AUTHOR = NEW_MEMBER_ID WHERE T_AUTHOR = " & OLD_MEMBER_ID
	set rsUpdate = my_Conn.Execute(strSql)
	if not rsUpdate.EOF then Response.Write	"Topic Authors merged.<br>"
	set rsUpdate = Nothing
	strSql = "UPDATE " & strTablePrefix & "REPLY SET R_AUTHOR = NEW_MEMBER_ID WHERE R_AUTHOR = " & OLD_MEMBER_ID
	set rsUpdate = my_Conn.Execute(strSql)
	if not rsUpdate.EOF then Response.Write	"Reply Authors merged.<br>"
	set rsUpdate = Nothing
	Response.Write	"<br><br>Merge process completed." & vbNewLine & _  
		"  Returning to admin home page." & vbNewLine & _ 
		"			<meta http-equiv=""Refresh"" content=""6; URL=admin_home.asp"">" & vbNewLine
	WriteFooter
	Response.End
Else
	Response.Write	"<Form action=""admin_mergeuser.asp"" name=""usermerge"" id=""usermerge"" method=""post"">" & vbNewLine & _
		"	<input type=""hidden"" name=""Merger"" value=""confirm"">" & vbNewLine & _
		"	<table align=""center"" width=""50%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
		"		<tr>" & vbNewLine & _
		"			<td align=""center"" width=""100%"" bgcolor=""" & strTableBorderColor & """>" & vbNewLine & _
		"				<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""4"">" & vbNewLine & _
		"					<tr valign=""middle"" height=""50"">" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strCategoryCellColor & """ colspan=""3"">" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ color=""" & strCategoryFontColor & """ size=""" & strHeaderFontSize+1 & """><b>Members' Accounts Merger</b>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """><b>Old</b> Member Name<br><small>(to be replaced)</small>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strHeadCellColor & """>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strHeaderFontSize & """>New Member Name<br>" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"					<tr valign=""middle"">" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
		"								<input type=""text"" name=""OLD_M_NAME"" size=""40"" maxlength=""75"">" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"						<td align=""center"" bgcolor=""" & strForumCellColor & """>" & vbNewLine & _
		"							<font face=""" & strDefaultFontFace & """ color=""" & strDefaultFontColor & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
		"								<input type=""text"" name=""NEW_M_NAME"" size=""40"" maxlength=""75"">" & vbNewLine & _
		"							</font>" & vbNewLine & _
		"						</td>" & vbNewLine & _
		"					</tr>" & vbNewLine & _
		"				</table>" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine & _
		"		<tr valign=""middle"">" & vbNewLine & _
		"			<td align=""center"" colspan=""2"">" & vbNewLine & _
		"				<input type=""submit"" value=""Merge"" name=""Merge"" id=""Merge"">" & vbNewLine & _
		"			</td>" & vbNewLine & _
		"		</tr>" & vbNewLine & _
		"	</table>" & vbNewLine & _
		"</Form>" & vbNewLine
End If
WriteFooter
%>


To add to admin control panel:

"admin_home.asp"


Look for the following line (appx 155):

		"                <LI><span class=""spnMessageText""><a href=""setup.asp"">Check Installation</a></span><font size=""" & strFooterFontSize & """><b> (Run after each upgrade !)</b></font></LI>" & vbNewLine & _

After it, insert the following:

		"								<LI><span class=""spnMessageText""><a href=""admin_mergeuser.asp"">Merge Users</a></span></LI>" & vbNewLine & _
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 03 February 2011 :  07:50:30  Show Profile  Reply with Quote
Add it to the bad word filter. That should take care of post display.

    _-/Cripto9t\-_
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 February 2011 :  06:20:36  Show Profile  Reply with Quote
Should go without saying, but make sure you back up your database before attempting this Just in case ...


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

Todd
New Member

USA
63 Posts

Posted - 05 February 2011 :  20:54:17  Show Profile  Visit Todd's Homepage  Reply with Quote
Thanks, I'll give it a shot. I'll just use the Alt Mod Setup method you suggested.

Yes I will definately back it up so I don't walk away with a


Admin for the Tyco Collector's Forum

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.48 seconds. Powered By: Snitz Forums 2000 Version 3.4.07