<% LanguageParser.IncludeSection "forum" LanguageParser.IncludeKey "topic", "Today" LanguageParser.IncludeKey "topic", "Yesterday" Dim arrPath, aspbbclass, strNew, cname, cid, sname, sid, strOrder, strTime, intOrder1, intOrder2 Dim intLimited, intMembersOnly Dim intOrderTime, intPage, intPostsPerPage, strPaging, objForum, intForumID, objCountPages, intPostsTotal Dim intposts, intGrp, objMod, strGrpMembers if Len(Request.QueryString("allread")) > 0 Then Response.Cookies("readforum")(Cstr(Request.QueryString("allread"))) = cTimeStamp(now()) Response.Cookies("readforum").expires = Dateadd("m", 3, now()) Response.Redirect("forum.asp?FORUM_ID="& Request.QueryString("allread")) End if intForumID = Clng(Request("FORUM_ID")) If not intForumID <> "" then Response.write LanguageParser.GetKey("errors", "ErrorForumNotFound") else %> <% if not ReadSub(userid, intForumID) or ModerateSub(userid, intForumID,1) then %> <%end if%>
<% '/// Write path to this page strSQL = "SELECT aspbb_category.cname, aspbb_category.cid, aspbb_subcategory.sname, aspbb_subcategory.sid" & _ " FROM aspbb_category INNER JOIN aspbb_subcategory ON" & _ " aspbb_category.cid = aspbb_subcategory.suid where aspbb_subcategory.sid = {0}" objDAL.open arrPath, strSQL, array(intForumID) cname = arrPath(0,0) cid = arrPath(1,0) sname = arrPath(2,0) sid = arrPath(3,0) %> <% =langStart %> > <%=cname%> > <%=sname%> <% if inside = 1 and not LimitedAccess(userid, intForumID) Then %> <% End if %>
<% '//Check last order2 and change that Dim intChangeOrder2 If request("order2") = "1" then intChangeOrder2 = 2 else intChangeOrder2 = 1 End if %> <% '/// Build string for the order part of the SQL query If Request("order1") = "" then strOrder = "aspbb_topics.ttype DESC, aspbb_topics.tdatelast DESC" Else Select case Request("order1") case "1" strOrder = "aspbb_topics.ttype DESC, aspbb_topics.tdatelast" intOrder1 = 1 case "2" strOrder = "aspbb_topics.ttype DESC, aspbb_topics.ttitle" intOrder1 = 2 case "3" strOrder = "aspbb_topics.ttype DESC, aspbb_topics.tseen" intOrder1 = 3 case "4" strOrder = "aspbb_topics.ttype DESC, aspbb_topics.tanswers" intOrder1 = 4 End Select Select case Request("ordertime") case "1" strTime = " " intOrderTime = 1 case "2" strTime = " AND aspbb_topics.tdatelast > '"& cTimeStamp(DateAdd("yyyy",-1,Now())) &"' " strTime = strTime & " OR aspbb_topics.tdatecreate > '"& cTimeStamp(DateAdd("yyyy",-1,Now())) &"' AND aspbb_topics.tforumid ={0}" intOrderTime = 2 case "3" strTime = " AND aspbb_topics.tdatelast > '"& cTimeStamp(DateAdd("m",-1,Now())) &"' " strTime = strTime & " OR aspbb_topics.tdatecreate > '"& cTimeStamp(DateAdd("m",-1,Now())) &"' AND aspbb_topics.tforumid ={0}" intOrderTime = 3 case "4" strTime = " AND aspbb_topics.tdatelast > '"& cTimeStamp(DateAdd("d",-14,Now())) &"' " strTime = strTime & " OR aspbb_topics.tdatecreate > '"& cTimeStamp(DateAdd("d",-14,Now())) &"' AND aspbb_topics.tforumid ={0}" intOrderTime = 4 case "5" strTime = " AND aspbb_topics.tdatelast > '"& cTimeStamp(DateAdd("d",-7,Now())) &"' " strTime = strTime & " OR aspbb_topics.tdatecreate > '"& cTimeStamp(DateAdd("d",-7,Now())) &"' AND aspbb_topics.tforumid ={0}" intOrderTime = 5 case "6" strTime = " AND aspbb_topics.tdatelast > '"& cTimeStamp(DateAdd("d",-1,Now())) &"' " strTime = strTime & " OR aspbb_topics.tdatecreate > '"& cTimeStamp(DateAdd("d",-1,Now())) &"' AND aspbb_topics.tforumid ={0}" intOrderTime = 6 End select Select case Request("order2") case "1" strorder = strOrder & " DESC" intOrder2 = 1 case "2" strorder = strOrder & " ASC" intOrder2 = 2 End select End if '/// Setup for paginsystem intPage = cInt(Request.QueryString("page")) If intPage = 0 then intPage = 1 intPostsPerPage = intTopicsPerPage '/// Check usergroup permission If AccessSub(userid, intForumID) or ReadSub(userid, intForumID) or LimitedAccess(userid, intForumID) Then '/// Our SQL query strSQL = "SELECT aspbb_topics.tid, aspbb_topics.ttype, aspbb_topics.ttitle, aspbb_topics.tlocked, aspbb_topics.tmoved, aspbb_topics.tpoll, aspbb_topics.ttarget, aspbb_topics.tanswers, aspbb_topics.tseen, aspbb_topics.tbody, aspbb_members.muser,aspbb_topics.toldid " & _ "FROM aspbb_topics INNER JOIN aspbb_members ON aspbb_topics.tmemberid = aspbb_members.mid " & _ "where (aspbb_topics.tforumid ={0} OR aspbb_topics.tmoved ={0}) AND aspbb_topics.tshow = 1 "& strTime &" ORDER BY " & strOrder '/// Add the paging code to the sql string Dim arrForum objDAL.OpenPaged arrForum, intPage, intPostsPerPage, strSQL, array(intForumID) if not EOF(arrForum) then dim i, x for i = 0 to Ubound(arrForum,2) If arrForum(1,i) = 0 or arrForum(1,i)= 2 then if x mod 2 then if blnThirdColor then aspbbclass = "class=""aspbbcolor1"" onmouseover=""this.className='aspbbcolor3'"" onmouseout=""this.className='aspbbcolor1'""" else aspbbclass = "class=""aspbbcolor1""" end if Else if blnThirdColor then aspbbclass = "class=""aspbbcolor2"" onmouseover=""this.className='aspbbcolor3'"" onmouseout=""this.className='aspbbcolor2'""" else aspbbclass = "class=""aspbbcolor2""" end if end if if not CBool(NewPosts(arrForum(0,i))) then strNew = "_old" Else strNew = "" End if %> > <% x = x + 1 Elseif arrForum(1,i) = 1 then 'Sticky announcment %> <%if ModerateSub(userid,intForumID , 1) then%> <%else%> <%end if%> <% End if Next else Response.write "" end if Else '///User has no access Response.Write LanguageParser.GetKey("errors", "NoAccess") End if end if '/// Sort forum form %>
  <% =langThread %> &FORUM_ID=<%=intForumID%>" id="sortlink">   
<% =langAuthor %>
<% =langReplies %> &FORUM_ID=<%=intForumID%>" id="sortlink">    <% =langViews %> &FORUM_ID=<%=intForumID%>" id="sortlink">    <% =langLatestPost %> &FORUM_ID=<%=intForumID%>" id="sortlink">   
<% 'Due to extensive fuckin bullshit this function was added. Think I hate ..... Dim varHasWritten varHasWritten = cint(objDAL.Getvalue("SELECT COUNT(*) as intRes FROM aspbb_posts WHERE aspbb_posts.pmemberid={0} AND aspbb_posts.ptopicid={1}", array(userid,arrForum(0,i)))) if varHasWritten <> 0 then varHasWritten = "" else varHasWritten = "" end if %> <% If arrForum(1,i) = 2 and arrForum(3,i) = 0 then Response.Write "
" & varHasWritten & "
" elseif arrForum(4,i) <> 0 then Response.write "
" & varHasWritten & "
" ElseIf arrForum(1,i) = 0 and arrForum(3,i) = 0 and arrForum(5,i) = 0 and arrForum(6,i) = 0 then Response.write "
" & varHasWritten & "
" elseif arrForum(3,i) = 1 then Response.write "
" & varHasWritten & "
" elseif arrForum(5,i) <> 0 then Response.write "
" & varHasWritten & "
" End if %>
<% if arrForum(4,i) <> 0 and arrForum(4,i) = Cint(Request.QueryString("FORUM_ID")) then response.write(""& langMoved &": ") End if if arrForum(1,i)= 2 then response.write(""& langSticky &": ") End if If arrForum(5,i) <> 0 then Response.Write(""& langPoll &": ") End if if cint(arrForum(11,i)) = 0 then %> <%=Server.HTMLEncode(arrForum(2,i))%> <%else%> <%=Server.HTMLEncode(arrForum(2,i))%> <% End if If arrForum(4,i) <> 0 and arrForum(4,i) <> Cint(Request.QueryString("FORUM_ID")) then Response.Write("(Moved)") end if%> <% 'Number of pages and quicklink to page Dim thisThreadPosts, thisThreadPages,y thisThreadPosts = arrForum(7,i) If thisThreadPosts > intReplyPerPage then If (thisThreadPosts / intReplyPerPage) <> Fix(thisThreadPosts / intReplyPerPage) then thisThreadPages = Fix(thisThreadPosts / intReplyPerPage) + 1 else thisThreadPages = (thisThreadPosts / intReplyPerPage) end if Response.Write " [ " for y=1 to thisThreadPages If y <> 1 then Response.Write ", " Response.Write "" & y & "" If y >= 5 then Response.Write " ... " Response.Write "" & langLastPage & "" exit for end if next Response.Write " ]" End if %> <%=arrForum(10,i)%> <% if arrForum(4,i) = 0 then Response.Write thisThreadPosts else Response.Write "-" end if %>   <%=arrForum(8,i)%>  <%= getlatest(arrForum(0,i), "posts") %>
<%=Server.HTMLEncode(arrForum(2,i))%>
<%=arrForum(9,i)%>
<% =langEdit %> | <% =langDelete %>
<%=Server.HTMLEncode(arrForum(2,i))%>
<%=arrForum(9,i)%>
" & LanguageParser.GetKey("errors", "ErrorNoThreads") &"
 <% =langSort %>: <% =langTimeInterval %>
<% =langStart %> > <%=cname%> > <%=sname%>
<% '////Pagin system '/// Check how many pages there are to display strSQL = "SELECT COUNT(*) FROM aspbb_topics WHERE aspbb_topics.tshow=1 AND aspbb_topics.tforumid ={0} " & strTime intPostsTotal = Clng(objDAL.GetValue(strSQL, array(intForumID))) '///Check if we need to round up the counter If (intPostsTotal / intPostsPerPage) <> Fix(intPostsTotal / intPostsPerPage) then intposts = Fix(intPostsTotal / intPostsPerPage) + 1 else intposts = (intPostsTotal / intPostsPerPage) end if '/// Draw pagingsystem navigation if intPosts >= 1 then Response.Write "
" & langPages & ": " & intPosts & " (" If intPage > 1 Then Response.Write "" & langFirstPage & " ... " Response.write "<< " End If For i = intpage-4 to intpage+4 If i > intPosts Then Exit For if i <> cint(intPage) Then If i >= 1 Then response.write "" & i & " " End If else response.write " [" & i & "] " end if Next If intPage + 1 =< intposts Then Response.write ">> " Response.write " ... " & langLastPage & "" End if Response.Write ")
" end if '/// End of pagingsystem navigation %>
<% =langModerators %>:
<% '///Find the group that is administraors for this subcategory strSQL = "SELECT aspbb_subcategory.smoderators FROM aspbb_subcategory WHERE aspbb_subcategory.sid={0}" intGrp = objDAL.GetValue(strSQL, array(intForumID)) '///Resolve the names strSQL = "SELECT aspbb_members.mid, aspbb_members.muser FROM aspbb_members INNER JOIN aspbb_groupmembers ON " & _ "aspbb_groupmembers.gmmid=aspbb_members.mid WHERE aspbb_groupmembers.gmgid={0}" dim arrMod objDAL.open arrMod, strSQL, array(intGrp) For i = 0 to Ubound(arrMod,2) strGrpMembers = strGrpMembers & ""& arrMod(1,i) &"" If i <> Ubound(arrMod,2) Then strGrpMembers = strGrpMembers & ", " end if next Response.Write strGrpMembers %>