Didn't try that one, thanks. Here's the fix:
<%
'###############################################################################
'##
'## Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-09 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
'##
'###############################################################################
'##
'## Multi-topic Delete
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_subforum.asp" -->
<%
If mLev < 4 or Request.Form("Forum")="" Then
Response.Write "<script>javascript:history.go(-1);</script>"
Response.End
End If
Forum_ID=cInt(chkString(Request.Form("Forum"),"SQLString"))
strTopics=chkString(trim(Request.Form("MassDelete")),"SQLString")+","
If len(strTopics)<3 Then
Response.Write "<table align=""center"" width=""50%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strDefaultFontColor & """>No topics selected for deletion. Go <a href=""javascript:history.go(-1)"">back</a> to correct." & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
WriteFooter
Response.End
End If
dim intDelete(50), intj
strTopic="":intj=0
For i = 1 to len(strTopics)
If mid(strTopics,i,1)<>"," Then
strTopic=strTopic+mid(strTopics,i,1)
Else
intj=intj+1
intDelete(intj)=cInt(strTopic)
strTopic=""
End If
Next
strSql = "DELETE FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID = " & intDelete(1)
If intj > 1 Then
For i = 2 to intj
strSql = strSql & " OR TOPIC_ID = " & intDelete(i)
Next
End If
my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
strSql = "DELETE FROM " & strTablePrefix & "REPLY WHERE TOPIC_ID = " & intDelete(1)
If intj > 1 Then
For i = 2 to intj
strSql = strSql & " OR TOPIC_ID = " & intDelete(i)
Next
End If
my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
strSql = "DELETE FROM " & strTablePrefix & "SUBSCRIPTIONS WHERE TOPIC_ID = " & intDelete(1)
If intj > 1 Then
For i = 2 to intj
strSql = strSql & " OR TOPIC_ID = " & intDelete(i)
Next
End If
my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
On Error Resume Next
strSql = "SELECT TOPIC_ID, T_LAST_POST, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID FROM " & strTablePrefix & "TOPICS WHERE FORUM_ID = " & Forum_ID & " AND T_STATUS <=1 AND T_ARCHIVE_FLAG = 0 ORDER BY T_LAST_POST DESC"
Set rs = my_Conn.Execute(strSql)
my_Conn.Errors.Clear
Err.Clear
If not rs.EOF Then
rs.MoveFirst
strLast_Post = rs("T_LAST_POST")
strLast_Post_Author = rs("T_LAST_POST_AUTHOR")
strLast_Post_Topic_ID = rs("TOPIC_ID")
strLast_Post_Reply_ID = rs("T_LAST_POST_REPLY_ID")
Else
strLast_Post = ""
strLast_Post_Author = "NULL"
strLast_Post_Topic_ID = 0
strLast_Post_Reply_ID = 0
End If
rs.Close
Set rs = Nothing
strSql = "UPDATE " & strTablePrefix & "FORUM SET F_COUNT = F_COUNT - " & cLng(risposte) + intJ & ", F_TOPICS = F_TOPICS - " & intJ & ", F_LAST_POST = '" & strLast_Post & "' "
strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author & ", F_LAST_POST_TOPIC_ID = " & strLast_Post_Topic_ID
strSql = strSql & ", F_LAST_POST_REPLY_ID = " & strLast_Post_Reply_ID & " WHERE FORUM_ID = " & Forum_ID
my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
strSql = "UPDATE " & strTablePrefix & "TOTALS "
strSql = strSql & " SET T_COUNT = T_COUNT - " & intJ
strSql = strSql & ", P_COUNT = P_COUNT - " & cLng(risposte) + intJ
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
Response.Write "<table align=""center"" width=""50%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbNewLine & _
" <tr valign=""middle"">" & vbNewLine & _
" <td align=""center"" width=""100%"">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strDefaultFontColor & """>" & intJ & " topic"
If intJ = 0 or intJ > 1 Then
Response.Write "s"
End If
Response.Write " deleted.<br /><br />" & vbNewLine & _
" </font>" & vbNewLine & _
" <meta http-equiv=""Refresh"" content=""5; URL=forum.asp?FORUM_ID="&Forum_ID&""">" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """><a href=""default.asp"">All Forums</a>" & vbNewLine & _
" </font>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table><br /><br />" & vbNewLine
WriteFooter
%>