<% @ Language=VBScript codepage=1255 %> <% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide - Web Wiz Forums '** '** Copyright 2001-2003 Bruce Corkhill All Rights Reserved. '** '** This program is free software; you can modify (at your own risk) any part of it '** under the terms of the License that accompanies this software and use it both '** privately and commercially. '** '** All copyright notices must remain in tacked in the scripts and the '** outputted HTML. '** '** You may use parts of this program in your own private work, but you may NOT '** redistribute, repackage, or sell the whole or any part of this program even '** if it is modified or reverse engineered in whole or in part without express '** permission from the author. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place '** and must remain visible when the pages are viewed unless permission is first granted '** by the copyright holder. '** '** This program is distributed in the hope that it will be useful, '** but WITHOUT ANY WARRANTY; without even the implied warranty of '** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER '** WARRANTIES WHETHER EXPRESSED OR IMPLIED. '** '** You should have received a copy of the License along with this program; '** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom. '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** info@webwizguide.info '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '** '**************************************************************************************** 'Set the response buffer to true as we maybe redirecting and setting a cookie Response.Buffer = True 'Make sure this page is not cached Response.Expires = -1 Response.ExpiresAbsolute = Now() - 2 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "No-Store" 'Dimension variables Dim rsCategory 'Holds the categories for the forums Dim rsForum 'Holds the Recordset for the forum details Dim intForumID 'Holds the forum ID number Dim strCategory 'Holds the category name Dim intCatID 'Holds the id for the category Dim strForumName 'Holds the forum name Dim strForumDiscription 'Holds the forum description Dim strForumPassword 'Holds the forum password if there is one Dim strModeratorsList 'Holds a list of moderators for the forum Dim dtmForumStartDate 'Holds the forum start date Dim lngNumberOfTopics 'Holds the number of topics in a forum Dim lngNumberOfPosts 'Holds the number of Posts in the forum Dim lngTotalNumberOfTopics 'Holds the total number of topics in a forum Dim lngTotalNumberOfPosts 'Holds the total number of Posts in the forum Dim intNumberofForums 'Holds the number of forums Dim lngLastEntryMeassgeID 'Holds the message ID of the last entry Dim lngLastEntryTopicID 'Holds the topic ID of the last entry Dim dtmLastEntryDate 'Holds the date of the last entry to the forum Dim strLastEntryUser 'Holds the the username of the user who made the last entry Dim lngLastEntryUserID 'Holds the ID number of the last user to make and entry Dim dtmLastEntryDateAllForums 'Holds the date of the last entry to all fourms Dim strLastEntryUserAllForums 'Holds the the username of the user who made the last entry to all forums Dim lngLastEntryUserIDAllForums 'Holds the ID number of the last user to make and entry to all forums Dim blnForumLocked 'Set to true if the forum is locked Dim intForumColourNumber 'Holds the number to calculate the table row colour Dim intForumReadRights 'Holds the interger number to calculate if the user has read rights on the forum Dim intForumPostRights 'Holds the interger valuse to calculate if the suer can poist in the forum Dim intForumReplyRights 'Holds the interger value to calculate if the user can reply to a post Dim blnHideForum 'Set to true if this is a hidden forum Dim intCatShow 'Holds the ID number of the category to show if only showing one category 'Initialise variables lngTotalNumberOfTopics = 0 lngTotalNumberOfPosts = 0 intNumberofForums = 0 intForumColourNumber = 0 'Read in the category to show If Request.QueryString("C") Then intCatShow = CInt(Request.QueryString("C")) Else intCatShow = 0 End If 'Craete a recordset to get the forum details Set rsCategory = Server.CreateObject("ADODB.Recordset") 'Read the various categories from the database 'Initalise the strSQL variable with an SQL statement to query the database If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "CategoryAll" Else strSQL = "SELECT " & strDbTable & "Category.Cat_name, " & strDbTable & "Category.Cat_ID FROM " & strDbTable & "Category ORDER BY " & strDbTable & "Category.Cat_order ASC;" End If 'Query the database rsCategory.Open strSQL, adoCon %> <% = strMainForumName %> <% Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") Response.Write(vbCrLf & " ") 'If the user has not logged in (guest user ID = 2) then show them a quick login form If lngLoggedInUserID = 2 Then Response.Write(vbCrLf & " ") End If Response.Write(vbCrLf & " ") %>
" & strTxtTheTimeNowIs & " " & DateFormat(now(), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(now(), saryDateTimeData) & ".
") 'If this is not the first time the user has visted the site display the last visit time and date If Session("dtmLastVisit") < CDate(Request.Cookies(strCookieName)("LTVST")) Then Response.Write(strTxtYouLastVisitedOn & " " & DateFormat(Session("dtmLastVisit"), saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(Session("dtmLastVisit"), saryDateTimeData) & ".") End If 'Display main page link if in a category view If intCatShow <> 0 Then Response.Write("
 " & strMainForumName & "") Response.Write(vbCrLf & "

" & strTxtQuickLogin & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ "" & _ vbCrLf & " " & _ vbCrLf & "
<% 'Check there are categories to display If rsCategory.EOF Then 'If there are no categories to display then display the appropriate error message Response.Write (vbCrLf & "") 'Else there the are categories so write the HTML to display categories and the forum names and a discription Else 'Create a recordset to get the forum details Set rsForum = Server.CreateObject("ADODB.Recordset") 'Loop round to read in all the categories in the database Do While NOT rsCategory.EOF 'Get the category name from the database strCategory = rsCategory("Cat_name") intCatID = CInt(rsCategory("Cat_ID")) 'Display the category name Response.Write vbCrLf & "" 'If there this is the cat to show then show it If intCatShow = intCatID OR intCatShow = 0 Then 'Read the various forums from the database 'Initalise the strSQL variable with an SQL statement to query the database If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "ForumsAllWhereCatIs @intCatID = " & intCatID Else strSQL = "SELECT " & strDbTable & "Forum.* FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.Cat_ID = " & intCatID & " ORDER BY " & strDbTable & "Forum.Forum_Order ASC;" End If 'Query the database rsForum.Open strSQL, adoCon 'Check there are forum's to display If rsForum.EOF Then 'If there are no forum's to display then display the appropriate error message Response.Write vbCrLf & "" 'Else there the are forum's to write the HTML to display it the forum names and a discription Else 'Loop round to read in all the forums in the database Do While NOT rsForum.EOF 'Initialise variables lngLastEntryTopicID = 0 strModeratorsList = "" 'Read in forum details from the database intForumID = CInt(rsForum("Forum_ID")) strForumName = rsForum("Forum_name") strForumDiscription = rsForum("Forum_description") dtmForumStartDate = CDate(rsForum("Date_Started")) strForumPassword = rsForum("Password") lngNumberOfPosts = CLng(rsForum("No_of_posts")) lngNumberOfTopics = CLng(rsForum("No_of_topics")) blnForumLocked = CBool(rsForum("Locked")) intForumReadRights = CInt(rsForum("Read")) intForumPostRights = CInt(rsForum("Post")) intForumReplyRights = CInt(rsForum("Reply_posts")) blnHideForum = CBool(rsForum("Hide")) 'Call the function to check the forum permissions Call forumPermisisons(intForumID, intGroupID, intForumReadRights, intForumPostRights, intForumReplyRights, 0, 0, 0, 0, 0, 0, 0) 'Add all the posts and topics together to get the total number for the stats at the bottom of the page lngTotalNumberOfPosts = lngTotalNumberOfPosts + lngNumberOfPosts lngTotalNumberOfTopics = lngTotalNumberOfTopics + lngNumberOfTopics 'If this forum is to be hidden and but the user is allowed access to it set the hidden boolen back to false If blnHideForum = True AND blnRead = True Then blnHideForum = False 'If the forum is to be hidden then don't show it If blnHideForum = False Then 'Get the row number intForumColourNumber = intForumColourNumber + 1 'Initilaise variables for the information required for each forum dtmLastEntryDate = dtmForumStartDate strLastEntryUser = strTxtForumAdministrator lngLastEntryUserID = 1 'Get the List of Group Moderators for the Forum If blnShowMod Then 'Initalise the strSQL variable with an SQL statement to query the database to get the moderators for this forum If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "ModeratorGroup @intForumID = " & intForumID Else strSQL = "SELECT " & strDbTable & "Group.Group_ID, " & strDbTable & "Group.Name " strSQL = strSQL & "FROM " & strDbTable & "Group, " & strDbTable & "Permissions " strSQL = strSQL & "WHERE " & strDbTable & "Group.Group_ID = " & strDbTable & "Permissions.Group_ID AND " & strDbTable & "Permissions.Moderate = True AND " & strDbTable & "Permissions.Forum_ID = " & intForumID & ";" End If 'Query the database rsCommon.Open strSQL, adoCon 'Initlaise the Moderators List varible if there are records returned for the forum If NOT rsCommon.EOF Then strModeratorsList = "
" & strTxtModerators & ":" 'Loop round to build a list of moderators, if there are any Do While NOT rsCommon.EOF 'Place the moderators username into the string strModeratorsList = strModeratorsList & " " & rsCommon("Name") & "" 'Move to the next record rsCommon.MoveNext Loop 'Close the recordset rsCommon.Close 'Initalise the strSQL variable with an SQL statement to query the database to get the moderators for this forum If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "Moderators @intForumID = " & intForumID Else strSQL = "SELECT " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username " strSQL = strSQL & "FROM " & strDbTable & "Permissions, " & strDbTable & "Author " strSQL = strSQL & "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Permissions.Author_ID AND " & strDbTable & "Permissions.Moderate = True AND " & strDbTable & "Permissions.Forum_ID = " & intForumID & ";" End If 'Query the database rsCommon.Open strSQL, adoCon 'Initlaise the Moderators List varible if there are records returned for the forum If NOT rsCommon.EOF AND strModeratorsList = "" Then strModeratorsList = "
" & strTxtModerators & ":" 'Loop round to build a list of moderators, if there are any Do While NOT rsCommon.EOF 'Place the moderators username into the string strModeratorsList = strModeratorsList & " " & rsCommon("Username") & "" 'Move to the next record rsCommon.MoveNext Loop 'Close the recordset rsCommon.Close End If 'Initalise the strSQL variable with an SQL statement to query the database for the date of the last entry and the author for the thread If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "LastForumPostEntry @intForumID = " & intForumID Else strSQL = "SELECT Top 1 " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID, " & strDbTable & "Thread.Topic_ID, " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message_date " strSQL = strSQL & "FROM " & strDbTable & "Author, " & strDbTable & "Thread " strSQL = strSQL & "WHERE " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID AND " & strDbTable & "Thread.Topic_ID IN " strSQL = strSQL & " (SELECT TOP 1 " & strDbTable & "Topic.Topic_ID " strSQL = strSQL & " FROM " & strDbTable & "Topic " strSQL = strSQL & " WHERE " & strDbTable & "Topic.Forum_ID = " & intForumID & " " strSQL = strSQL & " ORDER BY " & strDbTable & "Topic.Last_entry_date DESC) " strSQL = strSQL & "ORDER BY " & strDbTable & "Thread.Message_date DESC;" End If 'Query the database rsCommon.Open strSQL, adoCon 'If there are threads for topic then read in the date and author of the last entry If NOT rsCommon.EOF Then 'Read in the deatils from the recorset of the last post details lngLastEntryMeassgeID = CLng(rsCommon("Thread_ID")) lngLastEntryTopicID = CLng(rsCommon("Topic_ID")) dtmLastEntryDate = CDate(rsCommon("Message_date")) strLastEntryUser = rsCommon("Username") lngLastEntryUserID = CLng(rsCommon("Author_ID")) End If 'Reset variables rsCommon.Close 'Calculate the last forum entry across all forums for the statistics at the bottom of the forum If dtmLastEntryDateAllForums < dtmLastEntryDate Then dtmLastEntryDateAllForums = dtmLastEntryDate strLastEntryUserAllForums = strLastEntryUser lngLastEntryUserIDAllForums = lngLastEntryUserID End If 'Write the HTML of the forum descriptions and hyperlinks to the forums Response.Write(vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " ") End If 'Count the number of forums intNumberofForums = intNumberofForums + 1 'Move to the next database record rsForum.MoveNext 'Loop back round for next forum Loop End If 'Close recordsets rsForum.Close End If 'Move to the next database record rsCategory.MoveNext 'Loop back round for next category Loop End If 'Release server variables rsCategory.Close Set rsCategory = Nothing Set rsForum = Nothing %>
  <% = strTxtForum %> <% = strTxtTopics %> <% = strTxtPosts %> <% = strTxtLastPost %>
" & strTxtNoForums & "
" & strCategory & "
" & strTxtNoForums & "
") 'If the user has no access to a forum diplay a no access icon If blnRead = False AND blnModerator = False AND blnAdmin = False Then Response.Write (" ") 'If the forum requires a password diplay the password icon ElseIf strForumPassword <> "" Then Response.Write (" ") 'If the forum is read only and has new posts show the locked new posts icon ElseIf CDate(Session("dtmLastVisit")) < dtmLastEntryDate AND (blnForumLocked = True) AND blnAdmin = False AND blnModerator = False Then Response.Write (" ") 'If the forum is read only show the locked new posts icon ElseIf blnForumLocked Then Response.Write (" ") 'If the forum has new posts show the new posts icon ElseIf CDate(Session("dtmLastVisit")) < dtmLastEntryDate Then Response.Write (" ") 'If the forum is open but with no new replies Else Response.Write (" ") End If Response.Write(vbCrLf & " ") 'If this is the forum admin then let them have access to the forum admin pop up window If blnAdmin Then Response.Write(" ") Response.Write(vbCrLf & " " & strForumName & "
" & strForumDiscription & strModeratorsList & "
" & lngNumberOfTopics & "" & lngNumberOfPosts & "" & DateFormat(dtmLastEntryDate, saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(dtmLastEntryDate, saryDateTimeData) & "" & _ vbCrLf & "
" & strTxtBy & " " & strLastEntryUser & "

 <% = strTxtForumStatistics %>
<% ' -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Response.Write(vbCrLf & " " & strTxtOurUserHavePosted & " " & lngTotalNumberOfPosts & " " & strTxtPostsIn & " " & lngTotalNumberOfTopics & " " & strTxtTopicsIn & " " & intNumberofForums & " " & strTxtForums) Response.Write(vbCrLf & "
" & strTxtLastPostOn & " " & DateFormat(dtmLastEntryDateAllForums, saryDateTimeData) & " " & strTxtAt & " " & TimeFormat(dtmLastEntryDateAllForums, saryDateTimeData) & " " & strTxtBy & " " & strLastEntryUserAllForums & "") 'Get the latest forum posts 'Cursor type to one to count rsCommon.CursorType = 1 'Get the last signed up user 'Initalise the strSQL variable with an SQL statement to query the database If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "AuthorDesc" Else strSQL = "SELECT " & strDbTable & "Author.Username, " & strDbTable & "Author.Author_ID " strSQL = strSQL & "FROM " & strDbTable & "Author " strSQL = strSQL & "ORDER BY " & strDbTable & "Author.Author_ID DESC;" End If 'Query the database rsCommon.Open strSQL, adoCon 'Display some statistics for the members If NOT rsCommon.EOF Then Response.Write(vbCrLf & "
" & strTxtWeHave & " " & rsCommon.RecordCount & " " & strTxtForumMembers) Response.Write(vbCrLf & "
" & strTxtTheNewestForumMember & " " & rsCommon("Username") & "") End If 'Close the recordset rsCommon.Close %>
<% 'Reset Server Objects Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %>

<% = strTxtOpenForum %> <% = strTxtOpenForum %> <% = strTxtReadOnly %> <% = strTxtReadOnly %> <% = strTxtPasswordRequired %> <% = strTxtPasswordRequired %>
<% = strTxtOpenForumNewReplies %> <% = strTxtOpenForumNewReplies %> <% = strTxtReadOnlyNewReplies %> <% = strTxtReadOnlyNewReplies %> <% = strTxtNoAccess %> <% = strTxtNoAccess %>

<% = strTxtMarkAllPostsAsRead %> :: <% = strTxtDeleteCookiesSetByThisForum %>

<% = strTxtCookies %>

<% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode = True Then If blnTextLinks = True Then Response.Write("Hebrew Translate By Web Wiz Hebrew Forums
Hebrew Version " & strHebrewVersion & "

") Response.Write("Powered by Web Wiz Forums version " & strVersion & "") Else Response.Write("Hebrew Translate By Web Wiz Hebrew Forums
Hebrew Version " & strHebrewVersion & "

") Response.Write("") End If Response.Write("
Copyright ©2001-2003 Web Wiz Guide") End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'Display the process time If blnShowProcessTime Then Response.Write "

" & strTxtThisPageWasGeneratedIn & " " & FormatNumber(Timer() - dblStartTime, 4) & " " & strTxtSeconds & "
" %>