<% Dim subtype, ID, objCom, return, objCon if not fromThisDomain("subscribe.asp") then response.clear response.redirect (forumdir&"first.asp?error=referer") response.end end if if request.form<>"" then if request.form("type") = 0 then ID = request.form("forumID") Dim arrForumID: arrForumID = SPlit(ID,", ") Dim i, ubForumID:ubForumID = ubound(arrForumID) SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute "delete from pgd_Subscription WHERE Mem="&memID&" and type=0", , adExecuteNoRecords + adCmdtext .close end with Set objCon = nothing if ubForumID <> -1 then Dim allforum:allforum = Application(dbName&"foruminfo") if isArray(allforum) then Dim objSearchableForum, finalforums Set objSearchableForum = new searchableForum With objSearchableForum .memID = memID .SearchType = "all" finalforums = .GetSearchableForums End With Set objSearchableForum = nothing else finalforums = "-5" end if end if for i = 0 to ubForumID if Instr(1, "," & finalforums & ",", "," & arrForumID(i) & ",", 0) > 0 then set objCom = server.createobject("adodb.command") With objCom .activeConnection = datastore .commandText = dbOwnerPrefix&"spSubscription" .commandType = adCmdStoredProc .Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0) .Parameters.Append .Createparameter("@mem", adInteger, adParamInput, 0, memID) .Parameters.Append .Createparameter("@ID", adInteger, adParamInput, 0, arrForumID(i)) .Parameters.Append .Createparameter("@type", adInteger, adParamInput, 0, 0) .Parameters.Append .Createparameter("@getMail", adInteger, adParamInput, 0, 0) .execute , , adExecuteNoRecords return = .Parameters("@RETURN_VALUE") End With set objCom = nothing end if response.write "hela" next else ID = request.form("threadID") Dim arrThreadID: arrThreadID = SPlit(ID,", ") Dim strSQLUpdate, strSQLDelete for i = 0 to ubound(arrThreadID) 'response.write (arrThreadID(i)&": subscribe="&checkedornot(request.form("subscribe_"&arrThreadID(i)))&"; getMail="&checkedornot(request.form("getMail_"&arrThreadID(i)))&"
"&vbcrlf) if checkedornot(request.form("subscribe_"&arrThreadID(i))) = 0 then strSQLDelete = strSQLDelete &" DELETE FROM pgd_subscription WHERE mem="&memID&" and type=1 and threadID= "&arrThreadID(i)&vbcrlf else strSQLUpdate = strSQLUpdate &" Update pgd_subscription Set getMail = "&checkedornot(request.form("getMail_"&arrThreadID(i)))&" WHERE mem="&memID&" and type=1 and threadID= "&arrThreadID(i)&vbcrlf end if next ' response.write strSQLDelete&vbcrlf&vbcrlf ' response.write strSQLUpdate SET objCon = server.createObject("ADODB.connection") with objCon .open datastore .execute strSQLDelete&strSQLUpdate, , adExecuteNoRecords + adCmdtext 'adCmdStoredProc .close end with Set objCon = nothing end if end if response.redirect("subscribe.asp") %>