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:
<%
'###############################################################################
'##
'## 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
%>
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 & _