<% '################################################################################# '## Snitz Forums 2000 v3.4.06 '################################################################################# '## Copyright (C) 2000-06 Michael Anderson, Pierre Gorissen, '## Huw Reddick and Richard Kinser '## '## This program is free software; you can redistribute it and/or '## modify it under the terms of the GNU General Public License '## as published by the Free Software Foundation; either version 2 '## of the License, or (at your option) any later version. '## '## All copyright notices regarding Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from our support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## manderson@snitz.com '## '################################################################################# ' ' This allows all Members to View all Active Polls in the past 30 Days ' instead of poking around the forum looking for them all. ' ' Original script by: Dayve ' Modified and upgraded by: Davio %> <% nDays = Request.Cookies(strCookieURL & "PollDays") if Request.form("cookie") = 1 then if strSetCookieToForum = "1" then Response.Cookies(strCookieURL & "PollDays").Path = strCookieURL end if Response.Cookies(strCookieURL & "PollDays") = Request.Form("PollDays") Response.Cookies(strCookieURL & "PollDays").expires = strForumTimeAdjust + 365 nDays = Request.Form("PollDays") end if if nDays = "" then nDays = "-1" end if ActiveSince = Request.Cookies(strCookieURL & "ActiveSince") '## Do Cookie stuffs with show last date if Request.form("cookie") = "2" then ActiveSince = Request.Form("PollDays") if strSetCookieToForum = 1 then Response.Cookies(strCookieURL & "ActiveSince").Path = strCookieURL end if Response.Cookies(strCookieURL & "ActiveSince") = ActiveSince end if if IsEmpty(Session(strCookieURL & "last_here_date")) then Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName) end if if nDays = "-1" then defDate = Session(strCookieURL & "last_here_date") else defDate = DateToStr(DateAdd("d", -(nDays), strForumTimeAdjust)) end if if mlev = 3 then strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "MODERATOR " & _ " WHERE MEMBER_ID = " & MemberID Set rsMod = Server.CreateObject("ADODB.Recordset") rsMod.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText if rsMod.EOF then recModCount = "" else allModData = rsMod.GetRows(adGetRowsRest) recModCount = UBound(allModData,2) end if RsMod.close set RsMod = nothing if recModCount <> "" then for x = 0 to recModCount if x = 0 then ModOfForums = allModData(0,x) else ModOfForums = ModOfForums & "," & allModData(0,x) end if next else ModOfForums = "" end if else ModOfForums = "" end if '## Forum_SQL - Get all active polls strSql = "SELECT C.CAT_ID, C.CAT_NAME, C.CAT_STATUS, F.FORUM_ID, F.F_SUBJECT, F.F_STATUS, T.TOPIC_ID, " &_ "T.T_SUBJECT, T.T_STATUS, T.T_AUTHOR, T.T_REPLIES, M.M_NAME, P.P_LASTVOTE, P.P_WHOVOTES " For nCount = 1 To 15 strSql = strSql & ", P.ANSWER" & CStr(nCount) strSql = strSql & ", P.COUNT" & CStr(nCount) Next strSql = strSql & " FROM " & strTablePrefix & "CATEGORY C, " & strTablePrefix & "FORUM F, " &_ strTablePrefix & "TOPICS T, " & strMemberTablePrefix & "MEMBERS M, " & strTablePrefix & "POLLS P " &_ "WHERE C.CAT_ID = T.CAT_ID AND F.FORUM_ID = T.FORUM_ID AND P.TOPIC_ID = T.TOPIC_ID " &_ "AND M.MEMBER_ID = T.T_AUTHOR AND T.T_ISPOLL = 1 AND T.T_POLLSTATUS = 1" if nDays > "0" or nDays = "-1" then strSql = strSql & " AND (P.P_LASTVOTE > '" & defDate & "' OR T.T_DATE > '" & defDate & "')" end if strSql = strSql & " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, P.P_LASTVOTE DESC" Set rs = Server.CreateObject("ADODB.Recordset") if strDBType <> "mysql" then rs.cachesize = 50 rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText if rs.EOF then recActivePollsCount = "" else allActivePolls = rs.GetRows(adGetRowsRest) recActivePollsCount = UBound(allActivePolls,2) end if rs.close set rs = nothing Dim vAnswers(15) Dim vCount(15) Response.Write "" & vbNewLine & _ "" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewLine & _ " " & vbNewLine & _ " " & getCurrentIcon(strIconFolderOpen, "", "") & " All Forums
" & vbNewLine & _ " " & getCurrentIcon(strIconBar, "", "") & getCurrentIcon(strIconFolderOpen, "", "") & " Active Polls" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewLine Response.Write "" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine if (mLev > 0) or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewLine end if Response.Write " " & vbNewLine if recActivePollsCount = "" then Response.Write " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine else currForum = 0 fDisplayCount = 0 aCount = 0 for Rowcount = 0 to recActivePollsCount Cat_ID = allActivePolls(0,Rowcount) Cat_Name = allActivePolls(1,Rowcount) Cat_Status = allActivePolls(2,Rowcount) Forum_ID = allActivePolls(3,Rowcount) Forum_Subject = allActivePolls(4,Rowcount) Forum_Status = allActivePolls(5,Rowcount) Topic_ID = allActivePolls(6,Rowcount) Topic_Subject = allActivePolls(7,Rowcount) Topic_Status = allActivePolls(8,Rowcount) Topic_Author = allActivePolls(9,Rowcount) Topic_Replies = allActivePolls(10,Rowcount) Member_Name = allActivePolls(11,Rowcount) Last_Vote = allActivePolls(12,Rowcount) Who_Votes = allActivePolls(13,Rowcount) nCount = 14 For i = 1 to 15 vAnswers(i) = allActivePolls(nCount,Rowcount) nCount = nCount + 1 vCount(i) = allActivePolls(nCount,Rowcount) nCount = nCount + 1 Next if chkForumAccess(Forum_ID, MemberID, false) then if mLev = 4 then ModerateAllowed = "Y" elseif mLev = 3 and ModOfForums <> "" then if (strAuthType = "nt") then if (chkForumModerator(Forum_ID, Session(strCookieURL & "username")) = "1") then ModerateAllowed = "Y" else ModerateAllowed = "N" else if (instr("," & ModOfForums & "," ,"," & Forum_ID & ",") > 0) then ModerateAllowed = "Y" else ModerateAllowed = "N" end if else ModerateAllowed = "N" end if fDisplayCount = fDisplayCount + 1 if currForum <> Forum_ID then Response.Write " " & vbNewLine & _ " " & vbNewLine if (mLev > 0) or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewline elseif (mLev = 3) then Response.Write " " & vbNewline end if Response.Write " " & vbNewLine end if Response.Write " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " "& vbNewLine & _ " " & vbNewLine if (mLev > 0) or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewLine end if Response.Write " " & vbNewLine end if currForum = Forum_ID next if fDisplayCount = 0 then Response.Write " " & vbNewLine & _ " " & vbNewLine if (ModerateAllowed = "Y") or (lcase(strNoCookies) = "1") then Response.Write " " & vbNewLine end if end if end if Response.Write "
 PollAuthorRepliesTotal VotesLast Vote 
No Active Polls Found
" & vbNewLine & _ " " & ChkString(Cat_Name,"display") & " / " & ChkString(Forum_Subject,"display") & "" & vbNewLine & _ " " & vbNewLine if (ModerateAllowed = "Y") or (lcase(strNoCookies) = "1") then call ForumAdminOptions else if Cat_Status <> 0 and Forum_Status <> 0 then ForumMemberOptions else Response.Write "  " & vbNewLine end if end if Response.Write "  
" & vbNewLine if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then if lcase(strHotTopic) = "1" then if Topic_Replies >= intHotTopicNum then Response.Write "" & getCurrentIcon(strIconFolderNewHot, "Hot Topic", "hspace=""0""") & "" & vbNewLine 'hspace="0" else Response.Write "" & getCurrentIcon(strIconFolderNew, "View Poll", "") & "" & vbNewLine end if end if else Response.Write "" if Cat_Status = 0 then Response.Write getCurrentIcon(strIconFolderNewLocked, "Category Locked", "") elseif Forum_Status = 0 then Response.Write getCurrentIcon(strIconFolderNewLocked, "Forum Locked", "") else Response.Write getCurrentIcon(strIconFolderNewLocked, "Poll Locked", "") end if Response.Write "" end if 'Go through all and get total nTotal = 0 For nCount = 1 To 15 If trim(vAnswers(nCount)) <> "" Then nTotal = nTotal + vCount(nCount) End If Next Response.Write " " & chkString(left(Topic_Subject, 50),"display") & " " & vbNewLine if Who_Votes = "members" then Response.write " (members only)" & vbNewLine end if if strShowPaging = "1" then TopicPaging() Response.Write " " & chkString(Member_Name,"display") & "" & Topic_Replies & "" & nTotal & "" if cint(nTotal) > 0 then Response.Write(chkDate(Last_Vote, " ", true)) else Response.Write("Never") Response.Write "" & vbNewLine if (ModerateAllowed = "Y") or (lcase(strNoCookies) = "1") then call TopicAdminOptions else if Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0 then call TopicMemberOptions else Response.Write "  " & vbNewline end if end if elseif (mLev = 3) then Response.Write " 
No Active Topics Found 
" & vbNewLine & _ "
" & vbNewLine & _ "" & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewline & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine & _ "
" & vbNewLine & _ "

" & vbNewLine & _ " " & getCurrentIcon(strIconFolderNew,"New Posts","align=""absmiddle""") & " New posts since last logon.
" & vbNewLine & _ " " & getCurrentIcon(strIconFolder,"Old Posts","align=""absmiddle""") & " Old Posts." if lcase(strHotTopic) = "1" then Response.Write (" (" & getCurrentIcon(strIconFolderHot,"Hot Topic","align=""absmiddle""") & " " & intHotTopicNum & " replies or more.)
" & vbNewLine) Response.Write " " & getCurrentIcon(strIconFolderLocked,"Locked Topic","align=""absmiddle""") & " Locked topic.
" & vbNewLine ' DEM --> Start of Code added for moderation if HeldFound = "Y" then Response.Write " " & getCurrentIcon(strIconFolderHold,"Held Topic","align=""absmiddle""") & " Held Topic.
" & vbNewline end if if UnapprovedFound = "Y" then Response.Write " " & getCurrentIcon(strIconFolderUnmoderated,"UnModerated Topic","align=""absmiddle""") & " UnModerated Topic.
" & vbNewline end if ' DEM --> End of Code added for moderation Response.Write "

" & vbNewLine & _ "
" & vbNewLine %><% Response.Write "
" & vbNewLine WriteFooter Response.End sub ForumAdminOptions() if (ModerateAllowed = "Y") or (lcase(strNoCookies) = "1") then if Cat_Status = 0 then if mlev = 4 then Response.Write " " & getCurrentIcon(strIconFolderUnlocked,"Un-Lock Category","") & "" & vbNewline else Response.Write " " & getCurrentIcon(strIconFolderLocked,"Category Locked","") & vbNewline end if else if Forum_Status <> 0 then Response.Write " " & getCurrentIcon(strIconFolderLocked,"Lock Forum","") & "" & vbNewline else Response.Write " " & getCurrentIcon(strIconFolderUnlocked,"Un-Lock Forum","") & "" & vbNewline end if end if if (Cat_Status <> 0 and Forum_Status <> 0) or (ModerateAllowed = "Y") then Response.Write " " & getCurrentIcon(strIconFolderPencil,"Edit Forum Properties","hspace=""0""") & "" & vbNewline end if if mLev = 4 or lcase(strNoCookies) = "1" then Response.Write(" " & getCurrentIcon(strIconFolderDelete,"Delete Forum","") & "" & vbNewLine) Response.Write " " & getCurrentIcon(strIconFolderNewTopic,"New Poll","") & "" & vbNewLine end if end sub sub ForumMemberOptions() if (mlev > 0) then Response.Write " " & getCurrentIcon(strIconFolderNewTopic,"New Topic","") & "" & vbNewLine ' DEM --> Start of Code added to handle subscription processing. if (strSubscription > 0 and strSubscription < 4) and CatSubscription > 0 and ForumSubscription = 1 and strEmail = 1 then if InArray(strForumSubs, Forum_ID) then Response.Write ShowSubLink ("U", Cat_ID, Forum_ID, 0, "N") elseif strBoardSubs <> "Y" and not(InArray(strCatSubs,Cat_ID)) then Response.Write ShowSubLink ("S", Cat_ID, Forum_ID, 0, "N") end if end if end if end sub sub TopicAdminOptions() if Cat_Status = 0 then Response.Write " " & getCurrentIcon(strIconUnlock,"Un-Lock Category","hspace=""0""") & "" & vbNewLine elseif Forum_Status = 0 then Response.Write " " & getCurrentIcon(strIconUnlock,"Un-Lock Forum","hspace=""0""") & "" & vbNewLine elseif Topic_Status <> 0 then Response.Write " " & getCurrentIcon(strIconLock,"Lock Topic","hspace=""0""") & "" & vbNewLine else Response.Write " " & getCurrentIcon(strIconUnlock,"Un-Lock Topic","hspace=""0""") & "" & vbNewLine end if if (ModerateAllowed = "Y") or (Cat_Status <> 0 and Forum_Status <> 0 and Topic_Status <> 0) then Response.Write " " & getCurrentIcon(strIconPencil,"Edit Topic","hspace=""0""") & "" & vbNewLine end if Response.Write " " & getCurrentIcon(strIconTrashcan,"Delete Topic","hspace=""0""") & "" & vbNewLine if Topic_Status <= 1 then Response.Write " " & getCurrentIcon(strIconReplyTopic,"Reply to Topic","hspace=""0""") & "" & vbNewLine end if ' DEM --> Start of Code for Full Moderation if Topic_Status > 1 then TopicString = "TOPIC_ID=" & Topic_ID & "&CAT_ID=" & Cat_ID & "&FORUM_ID=" & Forum_ID Response.Write " " & getCurrentIcon(strIconFolderModerate,"Approve/Hold/Reject this Topic","hspace=""0""") & "" & vbNewline end if ' DEM --> End of Code for Full Moderation ' DEM --> Start of Code added to handle subscription processing. if (strSubscription < 4 and strSubscription > 0) and (CatSubscription > 0) and ForumSubscription > 0 and strEmail = 1 then if InArray(strTopicSubs, Topic_ID) then Response.Write " " & ShowSubLink ("U", Cat_ID, Forum_ID, Topic_ID, "N") elseif strBoardSubs <> "Y" and not(InArray(strForumSubs,Forum_ID) or InArray(strCatSubs,Cat_ID)) then Response.Write " " & ShowSubLink ("S", Cat_ID, Forum_ID, Topic_ID, "N") end if end if ' DEM --> End of code added to handle subscription processing. end sub sub TopicMemberOptions() if (Topic_Status > 0 and Topic_Author = MemberID) or (ModerateAllowed = "Y") then Response.Write " " & getCurrentIcon(strIconPencil,"Edit Topic","hspace=""0""") & "" & vbNewLine end if if (Topic_Status > 0 and Topic_Author = MemberID and Topic_Replies = 0) or (ModerateAllowed = "Y") then Response.Write " " & getCurrentIcon(strIconTrashcan,"Delete Topic","hspace=""0""") & "" & vbNewLine end if if Topic_Status <= 1 then Response.Write " " & getCurrentIcon(strIconReplyTopic,"Reply to Topic","hspace=""0""") & "" & vbNewLine end if if (strSubscription < 4 and strSubscription > 0) and (CatSubscription > 0) and ForumSubscription > 0 and strEmail = 1 then if InArray(strTopicSubs, Topic_ID) then Response.Write " " & ShowSubLink ("U", Cat_ID, Forum_ID, Topic_ID, "N") elseif strBoardSubs <> "Y" and not(InArray(strForumSubs,Forum_ID) or InArray(strCatSubs,Cat_ID)) then Response.Write " " & ShowSubLink ("S", Cat_ID, Forum_ID, Topic_ID, "N") end if end if ' DEM --> End of code added to handle subscription processing. end sub sub TopicPaging() mxpages = (Topic_Replies / strPageSize) if mxPages <> cLng(mxPages) then mxpages = int(mxpages) + 1 end if if mxpages > 1 then Response.Write " " & vbNewLine & _ " " & vbNewLine & _ " " & vbNewLine for counter = 1 to mxpages ref = " " Response.Write ref & vbNewLine if counter mod strPageNumberSize = 0 and counter < mxpages then Response.Write(" " & vbNewLine) Response.Write(" " & vbNewLine) Response.Write(" " & vbNewLine) end if next Response.Write(" " & vbNewLine) Response.Write("
" & getCurrentIcon(strIconPosticon,"","align=""absmiddle""") & "" if ((mxpages > 9) and (mxpages > strPageNumberSize)) or ((counter > 9) and (mxpages < strPageNumberSize)) then ref = ref & " " end if ref = ref & widenum(counter) & "" & counter & "
 
" & vbNewLine) end if end sub %>