<%if not (editor or master or member) then response.redirect("/common/members_only.asp")%> <%=SiteName%>
Member's Forums
<% mScope = "month" : if len(request("Scope")) > 0 then mScope = request("Scope") mForumID = request("ForumID") if mForumID = "" then if editor or master then mForumID = ubound(mForumNames,1)-1 'default for editor is unmoderated messages vetting = true else mForumID = 0 'default for users is all forums end if end if mSearchText = "" if len(request.form("SearchText")) > 0 then mSearchText = request.form("SearchText") mScope = "all" mForumID = 0 end if mForumID = cInt(mForumID) %>
<%=forumbutton("forums.asp?Scope="&mScope&"&ForumID=0&g="&g,"","Show All Forums"& mForumNames(0,1))%> <%for n=1 to ubound(mForumNames,1)-2%> <%=forumbutton("forums.asp?Scope="&mScope&"&ForumID="&n&"&g="&g,mForumNames(n,1),mForumNames(n,0))%> <%next %>
  • the forums are only visible to logged-in Members.
  • all posts appear immediately, and can be re-edited by the original author at any time.
  • All posts are the responsibility and views of the individual author, and we do not necessarily condone nor endorse any of the views expressed. Any inappropriate, offensive or defamatory messages will be erased.
<% 'if (editor or master) and mForumID = ubound(mForumNames,1)-1 then Vetting = true if Vetting then SQL="SELECT * from tblMessages where Checked < 2 " else select case mScope case "day" : ScopeFilter = " last(DatePosted) >= #" & formatdatetime(DateAdd("h", -24, Now()),1) & "# " case "week" : ScopeFilter = " last(DatePosted) >= #" & formatdatetime(DateAdd("d", -7, Now()),1) & "# " case "month" : ScopeFilter = " last(DatePosted) >= #" & formatdatetime(DateAdd("m", -1, Now()),1) & "# " end select if Editor or Master then if len(mSearchText) > 0 then mFilter = " where (MsgText like '%"+mSearchText+"%' or Subject like '%"+mSearchText+"%' or FromName like '%"+mSearchText+"%') " end if else if len(mSearchText) > 0 then mFilter = " where (MsgText like '%"+mSearchText+"%' or Subject like '%"+mSearchText+"%' or FromName like '%"+mSearchText+"%' and checked > 0 ) " else mFilter = " where (checked > 0 ) " end if end if SQL="SELECT Last(MsgID) AS lMsgID, "&_ "Last(ForumID) AS lForumID, "&_ "ReplyID, "&_ "Count(ReplyID) AS RepliesCount, "&_ "Last(AuthorID) AS lAuthorID, "&_ "First(DatePosted) AS fDatePosted, "&_ "Last(DatePosted) AS lDatePosted, "&_ "First(readcount) AS readcount, "&_ "First(FromName) AS fFromName, "&_ "Last(FromName) AS lFromName, "&_ "Last(FromEmail) AS lFromEmail, "&_ "Last(Subject) AS lSubject, "&_ "Last(MsgText) AS lMsgText, "&_ "Last(CC) AS lCC, "&_ "Last(Checked) AS lChecked "&_ " FROM tblMessages " & mFilter & " GROUP BY ReplyID " if mForumID > 0 then if len(ScopeFilter) > 0 then ScopeFilter = " and " & ScopeFilter SQL = SQL & " having(((last(forumid)) =" & mForumID & ")"&ScopeFilter&") " elseif len(ScopeFilter) > 0 then SQL = SQL & " having("&ScopeFilter&") " end if SQL = SQL & "ORDER BY Last(DatePosted) DESC " end if OpenOleConn(datadir&"npc_forums.mdb") Set rs=objConn.Execute(SQL) mTotRecs = 0 ' if rs.Eof then ' select case mScope ' case "week" : response.redirect("forums.asp?g="&g&"&ForumID="&mForumID&"&Scope=month") ' case "month" : response.redirect("forums.asp?g="&g&"&ForumID="&mForumID&"&Scope=all") ' end select ' end if Do while not rs.Eof rs.movenext mTotRecs = mTotRecs + 1 loop %>

<%=mForumNames(mForumID,0)%>

<%if not vetting then %>
Display:  
<%if mScope = "day" then %> last 24 hours' updates ( <%=mTotRecs%> ) <%else %> last 24 hours' updates <%end if %>
<%if mScope = "week" then %> last week's updates ( <%=mTotRecs%> ) <%else %> last week's updates <%end if %>
<%if mScope = "month" then %> last month's updates ( <%=mTotRecs%> ) <%else %> last month's updates <%end if %>
<%if mScope = "all" and len(mSearchText) = 0 then %> all of the threads ( <%=mTotRecs%> ) <%else %> all of the threads <%end if %>
<%end if %>
or enter a word or phrase to search for:
<%if mForumID < 5 then %> "> or click here to start a new topic <%end if %>
<%if len(mSearchText) > 0 then %> These <%=mTotRecs%> threads contain the word or phrase that you searched for. Click any one to view the complete thread. <%elseif not vetting then %> These are the most recently updated message 'Threads', listed in reverse order. Click any one to view the complete thread. <%end if %>
<%Set rs=objConn.Execute(SQL) If not rs.Bof then Do while not rs.Eof ' step through the messages If Vetting then lForumID = rs("ForumID") lSubject = rs("Subject") lChecked = rs("Checked") fDatePosted = rs("DatePosted") lDatePosted = rs("DatePosted") fFromName = rs("FromName") lFromName = rs("FromName") RepliesCount = 0 lAuthorID = rs("AuthorID") lMsgText = rs("MsgText") Else lForumID = rs("lForumID") lSubject = rs("lSubject") lChecked = rs("lChecked") fDatePosted = rs("fDatePosted") lDatePosted = rs("lDatePosted") fFromName = rs("fFromName") lFromName = rs("lFromName") RepliesCount = rs("RepliesCount") lAuthorID = rs("lAuthorID") lMsgText = rs("lMsgText") End if If lForumID >= 0 and lForumID < ubound(mForumNames,1)-1 then mBullet = mForumNames(lForumID,1) else mBullet = "" end if %>
&forumid=<%=lForumID%>'" style=cursor:hand >
 
&forumid=<%=lForumID%>"><%=lsubject%>  <%If Editor or Master then select case lChecked 'mark the href with the message moderation status case 2 :%> <% case 1 :%> (Visible, but not Checked yet) <% case -1 :%> (**SUSPECT**) <% case else :%> (Hidden, not Moderated yet) <% end select end if %>
Started on <%=formatdatetime(fdateposted,2) & " at " & formatdatetime(fdateposted,4)%> by <%=fFromName%> <%if Repliescount < 2 then mHours = DateDiff("h",fDatePosted,now) ShowInterval(mHours) end if %>
<%if Repliescount > 1 then %> last reply on <%=formatdatetime(lDatePosted,2) & " at " & formatdatetime(lDatePosted,4)%>  by <%=lFromName%>  
<%mHours = DateDiff("h",lDatePosted,now) ShowInterval(mHours) else %> no replies yet <%end if %>
read <%=rs("ReadCount")%> times
<%if RepliesCount > 2 then %> <%=RepliesCount-1%> replies
<%elseif RepliesCount = 2 then %> 1 reply
<%end if %>
    "<%=left(lMsgText,80)%>"

<% rs.movenext if not rs.eof then select case mScope case "day" case "week" case "month" case "all" end select end if Loop Else %>

<%if vetting then %> You are logged in as an Editor, and there are no new 'unvetted' forum posts.
If you wish to see the posts from a normal user's point of view,
please click here

<%else %> no forum posts found for this criteria
you could try widening the search scope

<%end if %>

<% End if closedata()%>


<%function forumbutton(url,icon,label) %>
<%=label%>    <%if len(icon) > 0 then %>
<%end if %>
<%end function function showInterval(mHours) if len(mHours) > 0 then %>  <% if mHours < 1 then %>less than 1 hour ago<% elseif mHours < 24 then %><%=int(mHours)%> hours ago<% elseif mHours < 720 then %><%=int(mHours/24)%> <% if int(mHours/24) = 1 then %>day ago<% else %>days ago<% end if else %>> <%=int(mHours/720)%> <% if int(mHours/720) = 1 then %>month ago<% else %>months ago<% end if end if %><% end if end function %>