% LanguageParser.IncludeSection "topic" Dim tid, arrTemp, strSortText, intSubId, finderror, arrDownload, objSysFile, i, arrDataFile, strFileName, arrTopic, intLocked, fid, cname, cid, sname, sid, arrWriteway, arrPoll, arrVote, posts, intColor, color, intTotalVotes, intSize, page, intLastPost, intPage, intPostsPerPage, intPostsTotal, intposts, strPaging, arrPosts 'Check if user has notify on and reset nseen in that case if instr(1,request.querystring("TID"),"#") <> 0 then tid = mid(request.querystring("TID"), 1, instr(1,request.querystring("TID"),"#")-1) tid = Clng(tid) Else tid = Clng(request.querystring("TID")) end if If hasnotify(tid, userid) then strSQL = "UPDATE aspbb_notify SET nseen=0 WHERE ntopicid= {0} AND nuser= {1}" objDAL.Execute strSQL, Array(tid, userid) End if Function DeleteFile(intFileId) If ModerateSub(userid, intSubId, 1) Then strSQL = "Select did,durl from aspbb_downloads where did = {0}" objDAL.Open arrDownload, strSQL, Array(Clng(intFileId)) set objSysFile = Server.CreateObject("Scripting.FileSystemObject") if objSysFile.FileExists(Server.MapPath(arrDownload(1, 0))) then objSysFile.DeleteFile Server.MapPath(arrDownload(1, 0)),true End if objDAL.Execute "Delete from aspbb_downloads where did = {0}", Array(arrDownload(0, 0)) objDAL.Execute "Update aspbb_topics Set tattach = 0 where tattach = {0}", Array(arrDownload(0, 0)) objDAL.Execute "Update aspbb_posts Set pattach = 0 where pattach = {0}", Array(arrDownload(0, 0)) End if End Function '/// Some administrative functions strSQL = "SELECT tforumid FROM aspbb_topics WHERE tid={0}" objDAL.Open arrTemp, strSQL, Array(tid) if not EOF(arrtemp) then intSubId = arrTemp(0, 0) else finderror = 1 end if if Request.QueryString("quickview") = "toggle" then if session("listmode") = 2 then session("listmode") = 1 else session("listmode") = 2 end if end if If Request.QueryString("action") = "lock" then If ModerateSub(userid, intSubId, 1) then objDAL.Execute "Update aspbb_topics set tlocked = 1 where tid ={0}", Array(tid) End if objDAL.Disconnect Response.Redirect("topic.asp?TID="& tid &"") End if If Request.QueryString("action") = "unlock" then If ModerateSub(userid, intSubId, 1) then objDAL.Execute "Update aspbb_topics set tlocked = 0 where tid ={0}", Array(tid) End if objDAL.Disconnect Response.Redirect("topic.asp?TID="& tid &"") End if If Request.QueryString("action") = "sticky" then If ModerateSub(userid, intSubId, 1) then objDAL.Execute "Update aspbb_topics set ttype = 2 where tid = {0}", Array(tid) End if objDAL.Disconnect Response.Redirect("topic.asp?TID="& tid &"") End if If Request.QueryString("action") = "nosticky" then If ModerateSub(userid, intSubId, 1) then objDAL.Execute "Update aspbb_topics set ttype = 0 where tid = {0}", Array(tid) End if objDAL.Disconnect Response.Redirect("topic.asp?TID="& tid &"") End if If Request.QueryString("action") = "delete_file" Then DeleteFile(Request.QueryString("fileid")) objDAL.Disconnect Response.Redirect("topic.asp?TID="& tid &"") End if if Request.QueryString("action") = "delete_topic" then dim postsintopic If ModerateSub(userid, intSubId, 1) or isMyTopic(userid, tid) then if isnumeric(tid) Then '// Get file attached to this topic strSQL = "SELECT tattach FROM aspbb_topics WHERE tid= {0}" objDAL.Open arrDataFile, strSQL, Array(tid) if not EOF(arrDataFile) then if arrDataFile(0, 0) <> 0 then DeleteFile(arrDataFile(0, 0)) end if End if '// Get files attached to replies under this topic strSQL = "SELECT pattach FROM aspbb_posts WHERE ptopicid= {0}" objDAL.Open arrDataFile, strSQL, Array(tid) if not EOF(arrDataFile) Then for i = 0 To Ubound(arrDataFile, 2) if arrDataFile(0, i) <> 0 then DeleteFile(arrDataFile(0, i)) end if Next End if postsintopic = objDAL.GetValue("Select Count(*) from aspbb_posts where ptopicid = {0}", Array(tid)) if len(postsintopic) = 0 then postsintopic = 0 else postsintopic = Clng(postsintopic) End if objDAL.Execute "Update aspbb_subcategory set sposts = sposts - {0}, stopics = stopics - 1 where sid = {1}", Array(postsintopic, intSubId) objDAL.Execute "Delete from aspbb_posts where ptopicid = {0}", Array(tid) objDAL.Execute "Delete from aspbb_topics where tid = {0} or toldid= {0}", Array(tid) End if End if Response.Redirect("forum.asp?forum_ID="& intSubId &"") End if if Request.QueryString("action") = "delete_post" then If ModerateSub(userid, intSubId, 1) or isMyPost(userid, chkstring(Request.QueryString("post"),1)) then if isnumeric(Request.QueryString("post")) then '/// First check if we need to delete a attachment strSQL = "SELECT pattach FROM aspbb_posts WHERE ptopicid= {0}" objDAL.Open arrDataFile, strSQL, Array(tid) if not EOF(arrDataFile) then if arrDataFile(0, 0) <> 0 Then DeleteFile(arrDataFile(0, 0)) End if end if objDAL.Execute "Delete from aspbb_posts where aspbb_posts.pid = {0}", Array(Request.QueryString("post")) objDAL.Execute "Update aspbb_topics Set tanswers = tanswers - 1 where tid = {0}", Array(tid) objDAL.Execute "Update aspbb_subcategory set sposts = sposts - 1 where sid = {0}", Array(intSubId) intLastPost = objDAL.GetValue("Select Count(*) from aspbb_posts where ptopicid = {0}", Array(tid)) if Clng(intLastPost) = 0 Then objDAL.Execute "Update aspbb_topics set tdatelast = tdatecreate where tid = {0}", Array(tid) Else intLastPost = objDAL.GetValue("Select Max(pdatecreate) from aspbb_posts where ptopicid = {0}", Array(tid)) objDAL.Execute "Update aspbb_topics set tdatelast = {0} where tid = {1}", Array(Clng(intLastPost), tid) End if End if End if Response.Redirect("topic.asp?sort="&Request.QueryString("sort")&"&page="&Request.QueryString("page")&"&TID="& tid &"") End if '/// End of administrative part if tid = "" then response.write LanguageParser.GetKey("errors", "ErrorGeneral") else If Clng(session("lastpost")) <> tid Then objDAL.Execute "UPDATE aspbb_topics set tseen=tseen+1 where tid = {0}", Array(tid) Session("lastpost") = tid End if '/// Display the topic strSQL = "Select aspbb_topics.tanswers, aspbb_topics.tlocked, aspbb_topics.tforumid, aspbb_topics.ttitle, aspbb_topics.ttype, aspbb_topics.tpoll, aspbb_topics.tbody, aspbb_topics.tattach, aspbb_topics.tdatechanged, aspbb_topics.tdatecreate, aspbb_topics.tip, "& _ "aspbb_members.mid, aspbb_members.muser, aspbb_members.mtitle, aspbb_members.mavatar, aspbb_members.mplace, aspbb_members.mreggad, aspbb_members.mwarnings, aspbb_members.msign, aspbb_topics.tnosmile, aspbb_topics.tforumid " & _ "from aspbb_topics inner join aspbb_members on aspbb_topics.tmemberid = aspbb_members.mid " & _ "where tid = {0}" objDAL.Open arrTopic, strSQL, Array(tid) If not EOF(arrTopic) then Response.Cookies("aspbb_newposts")(cstr(tid)) = arrTopic(0, 0) If Clng(arrTopic(1, 0)) = 1 then intLocked = 1 End if fid = arrTopic(2, 0) %>
<% '/// Write our current location in the forum strSQL = "SELECT aspbb_category.cid, aspbb_category.cname, aspbb_subcategory.sid, aspbb_subcategory.sname" & _ " FROM aspbb_category INNER JOIN aspbb_subcategory ON" & _ " aspbb_category.cid = aspbb_subcategory.suid where aspbb_subcategory.sid = {0}" objDAL.Open arrWriteway, strSQL, Array(fid) if not EOF(arrWriteway) Then cname = arrWriteway(1, 0) cid = arrWriteway(0, 0) sname = arrWriteway(3, 0) sid = arrWriteway(2, 0) End if '///Check if user have access to this topic If ModerateSub(userid, intSubId, 0) or readsub(userid,intsubid) or LimitedAccess(userid, intsubid) then %> <% =langStart %> > <%=cname%> > <%=sname%> > <%=Server.HTMLEncode(arrTopic(3, 0))%> |
<%
'/// End of path writing
'/// Display administrative options for moderators
If ModerateSub(userid, intSubId, 1) then
If arrTopic(1, 0) = 1 then
Response.Write("")
Else
Response.Write("")
End if
If arrTopic(4, 0) = 2 then
Response.Write("")
Else
Response.Write("")
End if
End if
'/// End of administrative options
if not readsub(userid, intsubid) and not LimitedAccess(userid, intsubid) then
%>
<%if inside=1 Then %><%End if %>
<%
end if
%>
<%= langQuickView %> <% if session("listmode") = 2 then response.write ""%>
|
<%=arrPoll(1, 0)%>
<%If Cdate(uTimeStamp(arrPoll(3, 0))) < now() then
Response.Write(" "& langPollEnded) elseif inside = 0 then Response.Write(" "& langSignToVote) End if %> |
||||||
<%=arrPoll(2, i)%> | <%If Not arrPoll(4, i) = 0 then intSize = Round((arrPoll(4, i)/intTotalVotes*100)) if intsize = 100 then intsize = intsize -1 %><%=arrPoll(4, i)%> | <%=Round((arrPoll(4, i)/intTotalVotes*100),2)%>% | <%Else%>0 | 0,00% | <%End if%>||
<%Response.Write(" "& langEditPoll &"")%> |
" & LanguageParser.GetKey("errors", "ErrorGeneral") &" |
" & LanguageParser.GetKey("errors", "ErrorGeneralLong") & " |
<% =langQuickReply %> |
<%if inside = 1 and not readsub(userid,intsubid) and (intLocked <> 1 or ModerateSub(userid, intSubId, 1)) and (intLastPost <> userID or blnAntiBump = false) or ModerateSub(userid, intSubId, 1) then%> <%Elseif intLocked = 1 and not ModerateSub(userid, intSubId, 1) then Response.Write(langThreadLocked) Elseif inside = 0 and intLocked <> 1 then Response.Write(LanguageParser.GetKey("errors", "NotLoggedIn")) End if%> |