<% dim appid, m, allforum,allCat, nailMode, lockMode, FAQMode, recycleThreadID,mode, forumID,parent, rights, fromPage, isRecycled 'appid = request.queryString("appid") dim key, objCon, strSQL allForum = application(dbName&"foruminfo") allCat = application(dbName&"Category") fromPage = request.querystring("fromPage") m = Clng(request("m"))' catch both form and querystring Dim objRS set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 1 .open "SELECT forumID,parent,r.messageID, threadID FROM pgd_messages m "&_ "left join pgd_recyclebin r on m.messageID = r.messageID WHERE m.messageID="&Clng(m), datastore, , , adCmdText If not (.EOF or .BOF) then forumID = .fields(0).value parent = .fields(1).value isRecycled = iff(isNull(.fields(2).value),false,true) recycleThreadID = .fields(3).value 'response.write "here" 'response.end End if .close end with set objRS=nothing 'response.write forumid 'response.end appid = ForumIdToAppid(forumID) Dim objPermission Set objPermission = new PermissionSetting With objPermission .memID = memID .appid = appid .GetPermission(true) rights = .post mode = .isModerator End With Set objPermission = nothing if request.querystring("actions") = "restore" then 'response.end if mode or isadmin then if Clng(m) = recycleThreadID then ' restore all messages strSQL = "delete pgd_recyclebin where messageID in (SELECT messageID from pgd_messages where threadid = "&recycleThreadID&") and deletetime=(SELECT deletetime from pgd_recyclebin WHERE messageID = "&recycleThreadID&")" else strSQL = "delete pgd_recyclebin where messageID="&Clng(m) end if SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing end if if request.querystring("frompage") = "manage" then ' from thread management interface to restore the entire thread response.write (variousSuccessHTML("opener.location.reload()")) else response.redirect (request("http_referer")) end if response.end else Dim allowToDelete:allowToDelete = true 'response.write rights Dim delThread, delPost delThread = false delPost = false if isAdmin or mode then delThread = true delPost = true elseif allforum(21,appid) = 2 and rights >=2 then delPost = true elseif allforum(21,appid) = 3 then if rights >=3 then delThread = true if rights >= 2 then delPost = true end if if isGuest or rights <=1 then delThread = false delPost = false end if If parent = 0 then if not delThread then allowToDelete = false else if not delPost then allowToDelete = false end if if request.form<>"" then if Clng(m) = recycleThreadID then 'put all messages into recycle bin strSQL = "insert into pgd_recyclebin SELECT messageID, '"&left(""&SQLStrip(request.form("reason")),150)&"',getDate() from pgd_messages m where threadID="&recycleThreadID&" and not exists (SELECT messageID from pgd_recyclebin r where r.messageID = m.messageID)" else strSQL = "insert into pgd_recyclebin values("&Clng(request.form("m"))&",'"&left(""&SQLStrip(request.form("reason")),150)&"', getDate())" end if SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQL, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing response.write (variousSuccessHTML("opener.location.reload()")) response.end end if end if If allowToDelete then %> <%= ttManageDesc %> <%= OutputCSS() %> style="margin:0px 0px 0px 0px">
<% if not isRecycled then %> > <% end if %> <% if mode or isAdmin then %> > <% End If %>
<%= adminDeleteOptionDesc %>
<%= adminRecycleDesc %>
<% if mode or isAdmin then %> <%= recyleReasonDesc %> <% end if %>
<%= adminPermanentDelete %>


"> ">
<% else 'response.redirect ("redirect.asp") end if %>