% dim ID, objCom, subtype, return,ForumSubscription,ThreadSubscription, objRS dim T,S, allforum, rights, threadID, allowedToSubscribe, notAllowedSubscriptionMsg allowedToSubscribe = true if isGuest then allowedToSubscribe = false notAllowedSubscriptionMsg = rightviolationmessage end if if Application(dbName&"enableSubscribe")=0 or Application(dbName&"maildll") = "NoMail" then allowedToSubscribe = false notAllowedSubscriptionMsg = SiteWideSubscriptionDisabledMessage end if appid = request.queryString("appid")' it is the appid (forumID) people want to subscribe. When this value is passed, ID is not included threadID = request.queryString("threadID") 'it is the threadID people what to subscribe. When this value is passed, appid is also included for permission checking allForum = Application(dbName&"foruminfo") if isArray(allForum) then if appid <> "" then 'if people selects forum instead of thread, ID is changed to forumID ID = allForum(0,appid) subtype = 0 elseif threadID <> "" then 'if people selects thread instead of forum, ID is changed to threadID ID = threadID subtype = 1 appid = "" else ID="" end if if ID <> "" then 'going to subscribe to a forum or message if subtype = 1 then 'derive appid from threadID Dim forumID set objRS = server.createobject("adodb.recordset") with objRS .CacheSize = 1 .open "SELECT forumID from pgd_messages where threadID="&threadID, datastore, , , adCmdText If not (.EOF or .BOF) then forumID = objRS(0) else 'there is not such thing available rights = 0 End if .close end with set objRS=nothing if not isEmpty(forumID) then appid = ForumIdToAppid(forumID) end if if len(appid&"")<>0 then Dim objPermission Set objPermission = new PermissionSetting With objPermission .memID = memID .appid = appid .GetPermission(false) rights = .post End With Set objPermission = nothing end if if rights < 1 then allowedToSubscribe = false notAllowedSubscriptionMsg = rightviolationmessage end if end if if allowedToSubscribe then If ID<>"" 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, ID) .Parameters.Append .Createparameter("@type", adInteger, adParamInput, 0, subtype) .Parameters.Append .Createparameter("@getMail", adInteger, adParamInput, 0, 1) .execute , , adExecuteNoRecords return = .Parameters("@RETURN_VALUE") End With set objCom = nothing if return = -1 then allowedToSubscribe = false notAllowedSubscriptionMsg = SubscriptionErrorMessage else response.redirect("subscribe.asp") response.end end if end if set objRS = server.createobject("adodb.recordset") With objRS .open dbOwnerPrefix&"spGetSubscription("&memID&")", datastore, , , adCmdStoredProc if not (.eof and .bof) then ForumSubscription = .getrows set objRS = .nextRecordset if not (objRS.eof and objRS.bof) then ThreadSubscription = objRS.getrows objRS.close End With set objRS = nothing allforum = Application(dbName&"foruminfo") Dim allCat, p, q allcat = Application(dbName&"Category") 'get a list of readable forums 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 end if %>