<% @ Language=VBScript %> <% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide - Web Wiz Forums '** http://www.webwizforums.com '** '** Copyright 2001-2006 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. '** '** You may not deactivate any adverts or links to Web Wiz Guide and it’s associates '** 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. '** '** '** Official support is available for this program through the free support forum at: - '** http://www.webwizguide.info/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** '** Web Wiz Guide, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, UK, BH15 4JD '** '**************************************************************************************** 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 sarryPosts 'Holds the posts recordset Dim intForumID 'Holds the forum ID number Dim strForumName 'Holds the forum name Dim intCatID 'Holds the cat ID Dim strCatName 'Holds the cat name Dim intMasterForumID 'Holds the main forum ID Dim strMasterForumName 'Holds the main forum name Dim lngTopicID 'Holds the topic number Dim strSubject 'Holds the topic subject Dim strUsername 'Holds the Username of the thread Dim lngUserID 'Holds the ID number of the user Dim dtmPostDate 'Holds the date the thread was made Dim strMessage 'Holds the post to display Dim strTopicIcon 'Holds the topic icon Dim lngMessageID 'Holds the message ID number Dim strAuthorHomepage 'Holds the homepage of the Username if it is given Dim strAuthorLocation 'Holds the location of the user if given Dim strAuthorAvatar 'Holds the authors avatar Dim strAuthorSignature 'Holds the authors signature Dim lngAuthorNumOfPosts 'Holds the number of posts the user has made to the forum Dim dtmAuthorRegistration 'Holds the registration date of the user Dim lngNumberOfViews 'Holds the number of times the topic has been viewed to save back to the database Dim intStatus 'Holds the users interger status Dim strStatus 'Holds the users status Dim strMode 'Holds the mode of the page that is being passed Dim intTopicPageNumber 'Holds the topic page position to link back to Dim blnIsModerator 'Set to true if the user who posted the message is a forum moderator Dim blnForumLocked 'Set to true if the forum is locked Dim blnTopicLocked 'set to true if the topic is locked Dim intThreadNo 'Holds the number of threads in the topic Dim intPriority 'Holds the priority level of the topic Dim intRecordPositionPageNum 'Holds the recorset page number to show the Threads for Dim intTotalRecordsPages 'Holds the number of pages Dim intTopicPageLoopCounter 'Loop counter for other thread page link Dim intTotalRecords 'Holds the total number of therads in this topic Dim strAuthorIP 'Holds the authors IP Dim strSearchKeywords 'Holds the keywords to search for Dim sarySearchWord 'Array to hold the search words Dim strGroupName 'Holds the authors group name Dim intRankStars 'Holds the number of stars for the group Dim strRankCustomStars 'Holds custom stars for the user group Dim lngPollID 'Holds the poll ID Dim blnPollNoReply 'Set to true if users can't reply to a poll Dim blnBannedIP 'Set to true if the user is using a banned IP Dim dtmLastEntryDate 'Holds the date of the last post entry to the topic Dim intIndexPosition 'Holds the idex poistion in the emiticon array Dim intNumberOfOuterLoops 'Holds the outer loop number for rows Dim intLoop 'Holds the loop index position Dim intInnerLoop 'Holds the inner loop number for columns Dim strMemberTitle 'Holds the members title Dim blnIsUserOnline 'Set to true if the user is online Dim blnHidePost 'Set to true if post is hidden Dim strPostTableRowClass 'Post row colour Dim intStartPosition 'Holds the start poition for records to be shown Dim intEndPosition 'Holds the end poition for records to be shown Dim intCurrentRecord 'Holds the current records for the posts Dim strGuestUsername 'Holds the Guest Username if it is a guest posting Dim blnHideTopic 'Set to true if topic is hidden Dim strLinkPage 'Holds the page to link to Dim lngGetPostID 'Holds the post to go straight to Dim strSortBy 'Holds the direction the posts are listed in Dim strPostTableSideClass 'Holds the post message side column css class Dim dtmEventDate 'Holds the date if this is a calendar event Dim intPageLinkLoopCounter 'Loop counter for page links include Dim intPostRowsSpan 'Holds the rowspam number for post table formatting Dim strForumPassword 'Holds the forum password Dim strPostPage Dim intReputation Dim intTopics 'Initialise variables strMode = "reply" lngMessageID = 0 lngGetPostID = 0 intForumID = 0 lngTopicID = 0 intThreadNo = 0 blnIsModerator = False blnPollNoReply = False blnBannedIP = False blnHidePost = false intPriority = 0 blnHideTopic = false 'See if the user is using a banned IP address If bannedIP() Then 'If the user is using a banned IP then set the banned IP variable to true and active member variable to false blnBannedIP = True End If 'If this is the first time the page is displayed then the Forum Thread record position is set to page 1 If isNumeric(Request.QueryString("PN")) = false Then intRecordPositionPageNum = 1 ElseIf Request.QueryString("PN") < 1 Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the Forum Thread record postion is set to the Record Position number Else intRecordPositionPageNum = CInt(Request.QueryString("PN")) End If 'Read in the Topic ID for the topic to display If isNumeric(Request.QueryString("TID")) Then lngTopicID = CLng(Request.QueryString("TID")) Else lngTopicID = 0 'If there is no Topic ID then redirect the user to the main forum page If lngTopicID = 0 Then 'Clean up Call closeDatabase() 'Redirect Response.Redirect("default.asp" & strQsSID1) End If 'Read in the post ID if we are going straight to a post If isNumeric(Request.QueryString("PID")) Then lngGetPostID = CLng(Request.QueryString("PID")) 'Fix for stupid IE 6 redirect bug (IE SUCKS!!!) MS have fixed this for IE7 If lngGetPostID = 0 AND Request.QueryString("PID") <> "" Then 'Remove the '#' hash anchor mark IE 6 includes in the string when doing a redirect (IE SUCKS!!) If InStr(Request.QueryString("PID"), "#") Then lngGetPostID = CLng(Mid(Request.QueryString("PID"), 1, InStr(Request.QueryString("PID"), "#")-1)) End If 'Read in the keywords if comming from a search strSearchKeywords = Trim(Mid(Request.QueryString("KW"), 1, 35)) 'Split up the keywords to be searched sarySearchWord = Split(Trim(strSearchKeywords), " ") 'Sort the direction of db results from session If Request.QueryString("PD") = "0" Then strSortBy = "DESC" ElseIf Request.QueryString("PD") = "1" Then strSortBy = "ASC" ElseIf getSessionItem("PD") = "0" Then strSortBy = "DESC" Else strSortBy = "ASC" End If 'Save the sort results order to app session If isNumeric(Request.QueryString("PD")) AND Request.QueryString("PD") <> "" Then Call saveSessionItem("PD", Request.QueryString("PD")) 'If this is a top priority post across all forums then read in the forum ID form the querystring and ingnore the real topic forum ID If Request.QueryString("PR") = "3" Then intForumID = Cint(Request.QueryString("FID")) strSQL = "" & _ "SELECT" & strDBTop1 & " " & strDbTable & "Category.Cat_ID, " & strDbTable & "Category.Cat_name, " & strDbTable & "Forum.Forum_ID AS ForumID, " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_name, " & strDbTable & "Forum2.Forum_name AS Main_forum, " & strDbTable & "Forum.Password, " & strDbTable & "Forum.Forum_code, " & strDbTable & "Forum.Locked AS forumLocked, " & strDbTable & "Topic.Poll_ID, " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Icon, " & strDbTable & "Topic.Locked AS topicLocked, " & strDbTable & "Topic.Priority, " & strDbTable & "Topic.No_of_views, " & strDbTable & "Topic.Hide, " & strDbTable & "Topic.Event_date, " & strDbTable & "Permissions.* " & _ "FROM " & strDbTable & "Category" & strDBNoLock & ", " & strDbTable & "Forum" & strDBNoLock & ", " & strDbTable & "Forum AS " & strDbTable & "Forum2" & strDBNoLock & ", " & strDbTable & "Permissions" & strDBNoLock & ", " & strDbTable & "Topic" & strDBNoLock & " " & _ "WHERE " & strDbTable & "Category.Cat_ID = " & strDbTable & "Forum.Cat_ID " & _ "AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Permissions.Forum_ID " 'Get the forum ID from the topic table If intForumID = 0 Then strSQL = strSQL & _ "AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID " 'Else this is a priority post so get the forum ID from the querystring (security built in later to make sure the user is not trying to view a post they shouldn't) Else strSQL = strSQL & "" & _ "AND " & strDbTable & "Forum.Forum_ID = " & intForumID & " " End If strSQL = strSQL & "" & _ "AND (" & strDbTable & "Forum.Forum_ID = " & intForumID & " OR " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Topic.Forum_ID) " & _ "AND (" & strDbTable & "Forum.Sub_ID = " & strDbTable & "Forum2.Forum_ID OR (" & strDbTable & "Forum.Sub_ID = 0 AND " & strDbTable & "Forum.Forum_ID = " & strDbTable & "Forum2.Forum_ID)) " & _ "AND " & strDbTable & "Topic.Topic_ID = " & lngTopicID & " " & _ "AND (" & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & " OR " & strDbTable & "Permissions.Group_ID = " & intGroupID & ") " & _ "ORDER BY " & strDbTable & "Forum.Sub_ID, " & strDbTable & "Forum.Forum_Order, " & strDbTable & "Permissions.Author_ID DESC" & strDBLimit1 & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occured write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "get_forum_data", "forum_posts.asp") 'Disable error trapping On Error goto 0 'If there is no record returended then set a message to say that If rsCommon.EOF Then 'If there are no thread's to display then display the appropriate error message strSubject = strTxtNoThreads 'Else get the details of the forum, permissions, and topic details Else 'Read in forum details from the database intForumID = Cint(rsCommon("ForumID")) intCatID = CInt(rsCommon("Cat_ID")) strCatName = rsCommon("Cat_name") strForumName = rsCommon("Forum_name") strMasterForumName = rsCommon("Main_forum") intMasterForumID = CLng(rsCommon("Sub_ID")) blnForumLocked = CBool(rsCommon("forumLocked")) blnHideTopic = CBool(rsCommon("Hide")) If isDate(rsCommon("Event_date")) Then dtmEventDate = CDate(rsCommon("Event_date")) 'Read in the forum permissions blnRead = CBool(rsCommon("View_Forum")) blnPost = CBool(rsCommon("Post")) blnReply = CBool(rsCommon("Reply_posts")) blnEdit = CBool(rsCommon("Edit_posts")) blnDelete = CBool(rsCommon("Delete_posts")) blnPriority = CBool(rsCommon("Priority_posts")) blnPollCreate = CBool(rsCommon("Poll_create")) blnVote = CBool(rsCommon("Vote")) blnAttachments = CBool(rsCommon("Attachments")) blnImageUpload = CBool(rsCommon("Image_upload")) blnModerator = CBool(rsCommon("Moderate")) blnCheckFirst = CBool(rsCommon("Display_post")) strForumPassword = rsCommon("Password") 'Read in the topic details lngPollID = CLng(rsCommon("Poll_ID")) strSubject = rsCommon("Subject") strTopicIcon = rsCommon("Icon") blnTopicLocked = CBool(rsCommon("topicLocked")) intPriority = CInt(rsCommon("Priority")) 'Clean up input to prevent XXS hack strSubject = formatInput(strSubject) 'If the user has no read writes then kick them out If blnRead = False Then 'Reset Server Objects rsCommon.Close Call closeDatabase() 'Redirect to a page asking for the user to enter the forum password Response.Redirect("insufficient_permission.asp" & strQsSID1) End If 'If the forum requires a password and a logged in forum code is not found on the users machine then send them to a login page If strForumPassword <> "" AND (Request.Cookies(strCookieName)("Forum" & intForumID) <> rsCommon("Forum_code") AND getSessionItem("Forum" & intForumID) <> rsCommon("Forum_code")) Then 'Reset Server Objects rsCommon.Close Call closeDatabase() 'Redirect to a page asking for the user to enter the forum password Response.Redirect("forum_password_form.asp?RP=PT&FID=" & intForumID & "&TID=" & lngTopicID & strQsSID2) End If 'Update no. of views, if not a bot (bots can index a poge 100's of times thus making the view count unreliable If NOT OSType = "Search Robot" Then 'Read in the number of views for the page form the database lngNumberOfViews = CLng(rsCommon("No_of_views")) 'Add 1 to the number of views the Topic has had lngNumberOfViews = lngNumberOfViews + 1 'Write the number of times the Topic has been viewed back to the database 'Initalise the strSQL variable with the SQL string strSQL = "UPDATE " & strDbTable & "Topic" & strRowLock & " " & _ "SET " & strDbTable & "Topic.No_of_views = " & lngNumberOfViews & " " & _ "WHERE (((" & strDbTable & "Topic.Topic_ID) = " & lngTopicID & "));" 'Set error trapping On Error Resume Next 'Write to the database adoCon.Execute(strSQL) 'If an error has occured write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occured while writing to the database.", "update_no._views", "forum_posts.asp") 'Disable error trapping On Error goto 0 End If End If 'clean up rsCommon.Close 'Securtiy check - if this isn't a Priority post and the user is just trying to view a post in a forum they don't have permission to 'then reload the page without the forum ID If Request.QueryString("PR") = "3" AND NOT intPriority = 3 Then 'Reset Server Objects Call closeDatabase() 'Redirect back to this page without the forum ID Response.Redirect("forum_posts.asp?TID=" & lngTopicID & strQsSID2) End If 'Use the application session to pass around what forum this user is within Call saveSessionItem("FID", intForumID) 'Intilise SQL query to get all the posts 'Use a LEFT JOIN for the Guest name as there may not be a Guest name and so we want to include null values strSQL = "" & _ "SELECT " & strDbTable & "Thread.Thread_ID, " & strDbTable & "Thread.Message, " & strDbTable & "Thread.Message_date, " & strDbTable & "Thread.Show_signature, " & strDbTable & "Thread.IP_addr, " & strDbTable & "Thread.Hide, " & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Homepage, " & strDbTable & "Author.Location, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Signature, " & strDbTable & "Author.Active, " & strDbTable & "Author.Avatar, " & strDbTable & "Author.Avatar_title, " & strDbTable & "Group.Name, " & strDbTable & "Group.Stars, " & strDbTable & "Group.Custom_stars, " & strDbTable & "GuestName.Name" if saryMegaMOD(0, 17) then strSQL = strSQL & ", " & strDbTable & "Author.Reputation" if saryMegaMOD(0, 30) then strSQL = strSQL & ", " & strDbTable & "Author.No_of_topic" strSQL = strSQL & " FROM (" & strDbTable & "Group INNER JOIN (" & strDbTable & "Author INNER JOIN " & strDbTable & "Thread ON " & strDbTable & "Author.Author_ID = " & strDbTable & "Thread.Author_ID) ON " & strDbTable & "Group.Group_ID = " & strDbTable & "Author.Group_ID) LEFT JOIN " & strDbTable & "GuestName ON " & strDbTable & "Thread.Thread_ID = " & strDbTable & "GuestName.Thread_ID " & _ "WHERE " & strDbTable & "Thread.Topic_ID = " & lngTopicID & " " 'If this isn't a moderator only display hidden posts if the user posted them If blnModerator = false AND blnAdmin = false Then strSQL = strSQL & "AND (" & strDbTable & "Thread.Hide = " & strDBFalse & " " 'Don't display hidden posts if guest If intGroupID <> 2 Then strSQL = strSQL & "OR " & strDbTable & "Thread.Author_ID = " & lngLoggedInUserID strSQL = strSQL & ") " End If strSQL = strSQL & "ORDER BY " & strDbTable & "Thread.Message_date " & strSortBy & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occured write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "get_topic_posts_data", "forum_posts.asp") 'Disable error trapping On Error goto 0 'If there is a topic in the database then get the post data If NOT rsCommon.EOF Then 'Read in the topic recordset into an array sarryPosts = rsCommon.GetRows() 'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name '20/1 = Reputation '20/1 = Topics 'Count the number of records intTotalRecords = Ubound(sarryPosts,2) + 1 'Count the number of pages for the topics using '\' so that any fraction is omitted intTotalRecordsPages = intTotalRecords \ intThreadsPerPage 'If there is a remainder or the result is 0 then add 1 to the total num of pages If intTotalRecords Mod intThreadsPerPage > 0 OR intTotalRecordsPages = 0 Then intTotalRecordsPages = intTotalRecordsPages + 1 'Get the record poistion to display from 'If the page number to show from is higher than the last page number then the last page number is the highest page If (intRecordPositionPageNum > intTotalRecordsPages) OR (Request.QueryString("get") = "last") Then 'Set the page position number to the highest page number intRecordPositionPageNum = intTotalRecordsPages End If 'If we need to jump straight to a particular post calculate which page to go to If NOT lngGetPostID = 0 AND NOT intTotalRecordsPages = 1 Then 'Calculate how many posts are before the post we want For intLoop = 0 to (intTotalRecords - 1) 'If we have found the post then calcualte the page it is on If CLng(sarryPosts(0,intLoop)) = lngGetPostID Then 'Calculate page number (use FIX to get the whole number) intRecordPositionPageNum = FIX(intLoop / intThreadsPerPage) + 1 'Exit Loop Exit For End If Next End If 'Start position intStartPosition = ((intRecordPositionPageNum - 1) * intThreadsPerPage) 'End Position intEndPosition = intStartPosition + intThreadsPerPage 'Get the start position intCurrentRecord = intStartPosition 'Get the last post date to set the read session cookie for the un-read post icon 'If displayed 'Newest Post First' then it will be the first post that has the last post date If strSortBy = "DESC" Then dtmLastEntryDate = CDate(sarryPosts(2,0)) 'If displayed 'Oldest Post First' it will be the last post that has the last post date Else dtmLastEntryDate = CDate(sarryPosts(2,intTotalRecords-1)) End If 'If this is a unread new post set a cookie so that it is not shown as a new post If(CDate(dtmLastVisitDate) < dtmLastEntryDate) AND (Session("RT" & lngTopicID) = "") Then Session("TID" & lngTopicID) = 1 'Else if no record is retuned we do not want to be displaying a foum title Else strSubject = "" End If 'Clean up rsCommon.Close 'set the topic icon If strTopicIcon = "" OR isNull(strTopicIcon) Then strTopicIcon = strImagePath & "topic_icon.gif" 'Page to link to for mutiple page (with querystrings if required) strLinkPage = "forum_posts.asp?TID=" & lngTopicID & "&" If Request.QueryString("KW") <> "" Then strLinkPage = strLinkPage & "KW=" & Server.URLEncode(Request.QueryString("KW")) & "&" If Request.QueryString("FID") <> "" Then strLinkPage = strLinkPage & "FID=" & intForumID & "&" If Request.QueryString("PR") <> "" Then strLinkPage = strLinkPage & "PR=" & CInt(Request.QueryString("PR")) & "&" 'If active users is enabled update the active users application array If blnActiveUsers Then 'If there are keywords this is a search If Request.QueryString("KW") <> "" Then 'Call active users function saryActiveUsers = activeUsers(strTxtViewingTopic & " " & strTxtSearchResults, strSubject, strLinkPage & "PN=" & intRecordPositionPageNum, intForumID) 'Else normal topic Else 'Call active users function saryActiveUsers = activeUsers(strTxtViewingTopic, strSubject, strLinkPage & "PN=" & intRecordPositionPageNum, intForumID) End If End If 'Write the HTML head of the page %> <% = strMainForumName & ": " & strSubject %> <% '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Response.Write("" & vbCrLf) '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'If RSS Feed is enabled then have an alt link to the XML file for supporting browsers 'Only display if the last post was less than xx weeks ago, to reduce the amount of consumed bandwidth If blnRSS AND (isNull(strForumPassword) OR strForumPassword = "") AND dtmLastEntryDate > DateAdd("ww", -intRSSLinkDisplayWeeks, now()) Then Response.Write(vbCrLf & "") %>
<% 'Display the forum name Response.Write(strForumName) 'If the forum is locked show a locked pad lock icon If blnForumLocked = True Then Response.Write (" ( " & strTxtForumLocked & ")") %>
 <% = strMainForumName %><% 'Display the category name Response.Write (strNavSpacer & "" & strCatName & "" & strNavSpacer) 'Display if there is a main forum to the sub forums name If intMasterForumID <> 0 Then Response.Write ("" & strMasterForumName & "" & strNavSpacer) 'Display forum name If strForumName = "" Then Response.Write "" & strTxtNoForums & "" Else Response.Write ("" & strForumName & "") %> <% 'If the user is the forum admin or a moderator then give them admin functions on this topic If blnAdmin OR blnModerator Then Response.Write(" ") 'If RSS XML enabled then display an RSS button to link to XML file If blnRSS AND (isNull(strForumPassword) OR strForumPassword = "") AND dtmLastEntryDate > DateAdd("ww", -intRSSLinkDisplayWeeks, now()) Then Response.Write(" ") %>
<% If blnTopicIcon Then Response.Write(" ") %><% 'If a calendar event then display so If isDate(dtmEventDate) Then Response.Write(strTxtEvent & ": " & strSubject & " - " & strTxtEventDate & ": " & stdDateFormat(dtmEventDate, False)) Else Response.Write(strTxtTopic & ": " & strSubject) End If %><% 'If the topic is locked then have a locked icon If blnTopicLocked = True Then Response.Write ("( " & strTxtTopicLocked & ")") %> <% = strTxtPostReply %> <% = strTxtNewTopic %> <% 'If the user can create a poll disply a create poll link If blnPollCreate = True Then Response.Write ("") %>
<% 'If there is a poll then display the poll include If lngPollID > 0 Then %><% End If 'If there are posts display them If intTotalRecords > 0 Then %> <% 'Calculate the post number intThreadNo = (intRecordPositionPageNum - 1) * intThreadsPerPage 'Do....While Loop to loop through the recorset to display the topic posts Do While intCurrentRecord < intEndPosition 'If there are no post records left to display then exit loop If intCurrentRecord >= intTotalRecords Then Exit Do 'Calculate the thread number intThreadNo = intThreadNo + 1 'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name 'Read in threads details for the topic from the database lngMessageID = CLng(sarryPosts(0,intCurrentRecord)) strMessage = sarryPosts(1,intCurrentRecord) dtmPostDate = CDate(sarryPosts(2,intCurrentRecord)) strAuthorIP = sarryPosts(4,intCurrentRecord) blnHidePost = CBool(sarryPosts(5,intCurrentRecord)) lngUserID = CLng(sarryPosts(6,intCurrentRecord)) strUsername = sarryPosts(7,intCurrentRecord) strAuthorHomepage = sarryPosts(8,intCurrentRecord) strAuthorLocation = sarryPosts(9,intCurrentRecord) lngAuthorNumOfPosts = CLng(sarryPosts(10,intCurrentRecord)) dtmAuthorRegistration = CDate(sarryPosts(11,intCurrentRecord)) strAuthorSignature = sarryPosts(12,intCurrentRecord) strAuthorAvatar = sarryPosts(14,intCurrentRecord) strMemberTitle = sarryPosts(15,intCurrentRecord) strGroupName = sarryPosts(16,intCurrentRecord) intRankStars = CInt(sarryPosts(17,intCurrentRecord)) strRankCustomStars = sarryPosts(18,intCurrentRecord) strGuestUsername = sarryPosts(19,intCurrentRecord) if saryMegaMOD(0, 17) AND saryMegaMOD(0, 30) then if isNumeric(sarryPosts(20,intCurrentRecord)) then intReputation = Clng(sarryPosts(20,intCurrentRecord)) else intReputation = 0 if isNumeric(sarryPosts(21,intCurrentRecord)) then intTopics = Clng(sarryPosts(21,intCurrentRecord)) else intTopics = 0 elseif saryMegaMOD(0, 17) then if isNumeric(sarryPosts(20,intCurrentRecord)) then intReputation = Clng(sarryPosts(20,intCurrentRecord)) else intReputation = 0 elseif saryMegaMOD(0, 30) then if isNumeric(sarryPosts(20,intCurrentRecord)) then intTopics = Clng(sarryPosts(20,intCurrentRecord)) else intTopics = 0 End if 'Calculate the row colour If intCurrentRecord MOD 2 = 0 Then strPostTableRowClass = "msgEvenTableRow" strPostTableSideClass = "msgEvenTableSide" Else strPostTableRowClass = "msgOddTableRow" strPostTableSideClass = "msgOddTableSide" End If 'If this is a hidden post then change the row colour to highlight it If blnHidePost Then strPostTableRowClass = "msgHiddenTableRow" 'If the poster is a guest see if they have entered their name in the GuestName table and get it If lngUserID = 2 AND strGuestUsername <> "" Then strUsername = strGuestUsername 'If the post contains a quote or code block then format it If InStr(1, strMessage, "[QUOTE=", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatUserQuote(strMessage) If InStr(1, strMessage, "[QUOTE]", 1) > 0 AND InStr(1, strMessage, "[/QUOTE]", 1) > 0 Then strMessage = formatQuote(strMessage) If InStr(1, strMessage, "[CODE]", 1) > 0 AND InStr(1, strMessage, "[/CODE]", 1) > 0 Then strMessage = formatCode(strMessage) 'If the post contains a flash link then format it If blnFlashFiles Then If InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage) If InStr(1, strAuthorSignature, "[FLASH", 1) > 0 AND InStr(1, strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature = formatFlash(strAuthorSignature) End If 'If the message has been edited parse the 'edited by' XML into HTML for the post If InStr(1, strMessage, "", 1) Then strMessage = editedXMLParser(strMessage) 'Call the function to highlight search words if coming froma search page If strSearchKeywords <> "" Then strMessage = searchHighlighter(strMessage, sarySearchWord) 'Calulate rowspan amount for table below side bar If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then intPostRowsSpan = 4 Else intPostRowsSpan = 3 End If 'If we are showing ads increase by 1 If intCurrentRecord = 0 AND blnLCode Then intPostRowsSpan = intPostRowsSpan + 1 %> " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " " & _ vbCrLf & " <% 'Move to the next record intCurrentRecord = intCurrentRecord + 1 Loop %>
<% = strTxtAuthor %> <% = strTxtMessage %>
<% = strUsername %>
<% = strGroupName %>
" alt="<% = strGroupName %>"/>
<% 'If the user has an avatar then display it If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("") 'If there is a title for this member then display it If strMemberTitle <> "" Then Response.Write(vbCrLf & "
" & strMemberTitle) 'If not a guest post then display some details If lngUserID <> 2 Then 'Show the joined date Response.Write(vbCrLf & "
" & strTxtJoined & ": " & DateFormat(dtmAuthorRegistration)) 'If the is a location display it If strAuthorLocation <> "" Then if saryMegaMOD(0, 35) then Response.Write(vbCrLf & "
" & strTxtLocation & ":
" & strAuthorLocation & "
") else Response.Write(vbCrLf & "
" & strTxtLocation & ": " & strAuthorLocation) End if End if 'If active users is enabled see if the user is online If blnActiveUsers Then 'Display if the user is online blnIsUserOnline = False 'Loop through the active users array For intLoop = 1 To UBound(saryActiveUsers, 2) If saryActiveUsers(1, intLoop) = lngUserID Then blnIsUserOnline = True Next 'Display if the user is online If blnIsUserOnline Then Response.Write(vbCrLf & " " & strTxtOnlineStatus & ": " & strTxtOnLine2 & "
") Else Response.Write(vbCrLf & " " & strTxtOnlineStatus & ": " & strTxtOffLine & "
") End If 'Display the num of posts Response.Write(strTxtPosts & ": " & lngAuthorNumOfPosts) if saryMegaMOD(0, 30) then Response.Write(vbCrLf & "
" & strTxtTopics & ": " & intTopics) if saryMegaMOD(0, 17) then 'Mod by Venky, hrvojevencl@gmail.com, http://venki.seccomnetworks.net 'Display reputatin Response.Write(vbCrLf & "
" & strTxtReputation & ": " & intReputation & "
") intReputation = Int((intReputation / intMBV_MR_100) * 100) %> ">
">" width="0" height="0" /> " width="0" height="0" />
<% End if End If %>
<% 'If the topic is not locked put in a link for someone to quote this message If blnTopicLocked = False AND blnPollNoReply = False AND blnHidePost = False Then Response.Write(" ") 'Display direct link to post Response.Write(" ") 'If first record display topic title If intCurrentRecord = 0 Then Response.Write("") 'If a calendar event then display so If isDate(dtmEventDate) Then Response.Write(strTxtCalendarEvent & ": ") Else Response.Write(strTxtTopic & ": ") Response.Write(strSubject & "
    ") End If 'Display message post date and time Response.Write(strTxtPosted & " " & DateFormat(dtmPostDate) & " " & strTxtAt & " " & TimeFormat(dtmPostDate)) %>
<% = strMessage %>
<% 'If the user wants there signature the display it If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then Response.Write(vbCrLf & "
" & _ formatSignature(strAuthorSignature)) End If '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If intCurrentRecord = 0 AND blnLCode Then Response.Write(vbCrLf & "
" & _ vbCrLf & strPostAds) End If '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** %>
IP <% 'If the user is the admin or moderatir then display the authors IP If (blnAdmin OR blnModerator) AND strAuthorIP <> "" Then Response.Write(strTxtIP & ": " & strAuthorIP & "") Else Response.Write(strTxtIPLogged) End If %><% 'Display the report post feature if email is enabled. If (blnEmail AND intGroupID <> 2 AND lngUserID <> lngLoggedInUserID AND blnActiveMember) AND (blnAdmin = false AND blnModerator = false) Then Response.Write(" ") 'If the logged in user is the person who posted the message or the forum administrator/moderator then allow them to edit or delete the message If (lngLoggedInUserID = lngUserID AND blnForumLocked = False AND blnActiveMember AND blnTopicLocked = False) OR (blnAdmin OR blnModerator) Then 'Only let the user edit the post if they have edit rights If blnEdit OR blnAdmin Then Response.Write(" ") End If 'Only let a normal user delete there post if someone hasn't posted a reply If (intTotalRecords = intThreadNo) OR (blnAdmin OR blnModerator) Then 'Only let the user delete the post if they have delete rights If blnDelete OR blnAdmin Then Response.Write(" ") End If End If End If 'If the user is the forum admin or a moderator If blnAdmin OR blnModerator Then 'Let them hide the post If blnHidePost Then Response.Write(" ") Else Response.Write(" ") End If 'Let them move the post to another forum Response.Write(" ") End If 'mod by venki if saryMegaMOD(0, 17) and saryMegaMOD(0, 18) then Response.Write(" +1 " & strTxtOR & " -1 " & strTxtRepPiont) End if %>
<% 'Else display there are no posts to display so display error message Else %>
<% = strTxtError %>
<% = strTxtNoThreads %>
<% End If 'Display table for email and/or page links If (blnEmail AND blnLoggedInUserEmail AND intGroupID <> 2) OR (intTotalRecordsPages > 1) Then %>
<% 'Display a link to watch or un-watch this topic if email notification is enabled If blnEmail AND blnLoggedInUserEmail AND intGroupID <> 2 Then 'Create link Response.Write("" & strTxtWatchThisTopic & "") End If %>
<% End If 'Quick Reply !!!! If blnBannedIP = false AND blnActiveMember AND blnBanned = False AND blnForumLocked = false AND blnReply AND blnTopicLocked = false AND blnPollNoReply = false AND intRecordPositionPageNum = intTotalRecordsPages Then 'Name of the HTML form the textarea is within Const strFormName = "frmMessageForm" 'ID tag name of HTML textarea being replaced Const strTextAreaName = "message" if saryMegaMOD(0, 6) then %>
<% = strTxtQuickReply %>
<% else %><% End if End If %>
<% = strTxtPostReply %> <% = strTxtNewTopic %> <% 'If the user can create a poll disply a create poll link If blnPollCreate = True Then Response.Write ("") %>
<% = strTxtPrintVersion %> <% = strTxtPrintVersion %><% 'If the user has logged in then the Logged In and the e-mail is on then display a link to allow the user to e-mail topic to a friend If intGroupID <> 2 AND blnEmail AND blnActiveMember Then Response.Write("  " & strTxtEmailTopic & "") End If %>


<% 'Clear server objects Call closeDatabase() '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** If blnLCode Then If blnTextLinks Then Response.Write("Bulletin Board Software by Web Wiz Forums version " & strVersion & "") Else Response.Write("") End If Response.Write("
Copyright ©2001-2006 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, 3) & " " & strTxtSeconds & "
") Response.Write("
") 'Display an alert message if the user is watching this topic for email notification If Request.QueryString("EN") = "TS" Then Response.Write("") End If 'Display an alert message if the user is not watching this topic for email notification If Request.QueryString("EN") = "TU" Then Response.Write("") End If 'Display an alert message if the user is posting in a moderated forum If Request.QueryString("MF") = "Y" Then Response.Write("") End If %>