<% function DelGroup(ByRef pobjCon, ByVal pintGroupID, ByVal pblnInArchive) dim strSQL, objRs, intDelCount, intArchiveDeleteCount, intBoardID, intDisplayOrder set objRs = GetGroup(pobjCon, pintGroupID) intBoardID = objRs.Fields.Item("board").Value intDisplayOrder = objRs.Fields.Item("displayOrder").Value objRs.close set objRs = Nothing call BeginTransaction(pobjCon, "DelGroup") call DelAttachmentsForGroup(pobjCon, pintGroupID, pblnInArchive) if not pblnInArchive then 'delete everything to do with the entire group strSQL = "DELETE FROM forumEmailnotifications WHERE thread IN (SELECT ID AS thread FROM forumSubThreads WHERE thegroup=" & pintGroupID & ")" pobjCon.execute strSQL 'delete emailnotifications strSQL = "DELETE FROM forumGroupEmailnotifications WHERE thegroup=" & pintGroupID pobjCon.execute strSQL strSQL = "DELETE forumMessagesRead" & strDelExt & " FROM forumMessagesRead INNER JOIN forumMessages ON (forumMessages.ID=forumMessagesRead.message) WHERE forumMessages.thegroup=" & pintGroupID pobjCon.execute strSQL strSQL = "DELETE FROM forumMessages WHERE thegroup=" & pintGroupID call pobjCon.execute(strSQL, intDelCount) strSQL = "DELETE FROM forumSubthreads WHERE thegroup=" & pintGroupID pobjCon.execute strSQL strSQL = "DELETE FROM forumArchivedmessages WHERE thegroup=" & pintGroupID call pobjCon.execute(strSQL,intArchiveDeleteCount) strSQL = "DELETE FROM forumGroupadmins WHERE thegroup=" & pintGroupID call pobjCon.execute(strSQL) strSQL = "DELETE FROM forumGroupEmailNotifications WHERE thegroup=" & pintGroupID call pobjCon.execute(strSQL) strSQL = "DELETE FROM forumGroups WHERE ID=" & pintGroupID pobjCon.execute strSQL 'move displayorder one up so there are no "blanks" strSQL = "UPDATE forumGroups SET displayOrder=displayOrder-1 WHERE board=" & intBoardID & " AND displayOrder>" & intDisplayOrder pobjCon.execute strSQL else 'just delete the archived messages for the group. strSQL = "UPDATE forumGroups SET archives=0 WHERE ID=" & pintGroupID pobjCon.execute(strSQL) strSQL = "DELETE FROM forumArchivedmessages WHERE thegroup=" & pintGroupID call pobjCon.execute(strSQL,intArchiveDeleteCount) end if call CommitTransaction(pobjCon, "DelGroup") DelGroup = intDelCount end function %>