<%@ LANGUAGE = "VBScript" %> <% Option Explicit %> <% Response.Buffer = True %> <% Response.Expires = -1 %> <% Response.CacheControl = "Public" %> <% '**************************************************************************************** '** Copyright Notice '** '** iPortalX.com '** '** Copyright 2001-2003 Drew Gauderman All Rights Reserved. '** '** This program is a paid 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 NOT use parts of this program in your own private work, and 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 iPortalX.com and powered by logo's (if any) 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. '** '** Support is for those that have purchased it. Post support questions at: - '** http://www.iportalx.com/forum '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** support@iportalx.com '** '**************************************************************************************** Dim intTotalNumGBEntries Dim intTotalNumGBPages Dim intLinkPageNum Dim intTotalNumOfPages Dim blnBannedIP Dim blnIPMatched Dim intRecordPositionPageNum 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 blnActiveMember = False End If If Request.QueryString("PagePosition") = "" Then intRecordPositionPageNum = 1 Else intRecordPositionPageNum = CInt(Request.QueryString("PagePosition")) End If '****************************************** '**** Banned IP's ***** '****************************************** Private Function CheckIfbannedIP(strIPAddress) 'Declare variables Dim rsIPAddr Dim strCheckIPAddress Dim strUserIPAddress Dim blnIPMatched 'Intilise variable blnIPMatched = False 'Get the users IP strUserIPAddress = strIPAddress 'Intialise the ADO recordset object Set rsIPAddr = Server.CreateObject("ADODB.Recordset") 'Get any banned IP address from the database 'Initalise the strSQL variable with an SQL statement to query the database to count the number of topics in the forums If strDatabaseType = "SQLServer" Then strSQL = "EXECUTE " & strDbProc & "BannedIPs" Else strSQL = "SELECT " & strDbTable & "BanList.IP FROM " & strDbTable & "BanList WHERE " & strDbTable & "BanList.IP Is Not Null;" End If 'Query the database rsIPAddr.Open strSQL, adoCon 'Loop through the IP address and check 'em out Do while NOT rsIPAddr.EOF 'Get the IP address to check from the recordset strCheckIPAddress = rsIPAddr("IP") 'See if we need to check the IP range or just one IP address 'If the last character is a * then this is a wildcard range to be checked If Right(strCheckIPAddress, 1) = "*" Then 'Remove the wildcard charcter form the IP strCheckIPAddress = Replace(strCheckIPAddress, "*", "", 1, -1, 1) 'Trim the users IP to the same length as the IP range to check strUserIPAddress = Mid(strUserIPAddress, 1, Len(strCheckIPAddress)) 'See if whats left of the IP matches If strCheckIPAddress = strUserIPAddress Then blnIPMatched = True 'Else check the IP address metches Else 'Else check to see if the IP address match If strCheckIPAddress = strUserIPAddress Then blnIPMatched = True End If 'Move to the next record rsIPAddr.MoveNext Loop 'Clean up rsIPAddr.Close Set rsIPAddr = Nothing 'Return the function CheckIfbannedIP = blnIPMatched End Function %> <% = strWebsiteName %> - <% = strTxtGuestbook %>
<% = strWebsiteName %> : <% = strTxtGuestbook %>

<% Dim intGuestBookItemsPerPage Dim strGuestbookComments intGuestBookItemsPerPage = 15 Dim rsGuestbook Set rsGuestbook = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT " & strDbTable & "Guestbook.* FROM " & strDbTable & "Guestbook " strSQL = strSQL & "ORDER BY " & strDbTable & "Guestbook.Created_date DESC;" rsGuestbook.CursorType = 1 rsGuestbook.Open strSQL, adoCon rsGuestbook.PageSize = intGuestBookItemsPerPage If rsGuestbook.EOF Then Call FormatTopTable2("100%") %>
<% = strTxtThereAreNoGuestbookEntries %>

<% = strTxtSignGuestbook %>

<% Call FormatBottomTable("100%") Else intTotalNumGBPages = rsGuestbook.PageCount intTotalNumGBEntries = rsGuestbook.RecordCount rsGuestbook.AbsolutePage = intRecordPositionPageNum Response.Write("
" & strTxtClickHereToSignGuestbook & "
" & strTxtThereAre & " " & intTotalNumGBEntries & " " & strTxtGuestbookEntriesIn & " " & intTotalNumGBPages & " " & strTxtPagesAndYouAreOnPageNumber & " " & intRecordPositionPageNum & "

") For intRecordLoopCounter = 1 to intGuestBookItemsPerPage If rsGuestbook.EOF Then Exit For strGuestbookComments = rsGuestbook("Comments") strGuestbookComments = Replace(strGuestbookComments, "smileys/", "forum/smileys/", 1, -1, 1) If InStr(1, strGuestbookComments, "[QUOTE=", 1) > 0 AND InStr(1, strGuestbookComments, "[/QUOTE]", 1) > 0 Then strGuestbookComments = formatQuote(strGuestbookComments) Call FormatTableTitleTop(strTxtCommentsBy & " " & rsGuestbook("Name"), "100%", 1) %>  <% = strTxtSignedOn & " " & DateFormat(rsGuestbook("Created_date"), saryDateTimeData) %><% If blnAdmin = True OR blnModerator = True Then %> | <% = strTxtIP %>: ','move','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=425,height=425')" class="tiHeadingLink"><% = rsGuestbook("IP") %><% If blnAdmin = True Then If CheckIfbannedIP(rsGuestbook("IP")) = True Then Response.Write(vbCrLf & "(IP Has Been Blocked)") End If %> | &PN=<% = intRecordPositionPageNum %>" class="tiHeadingLink"><% = strTxtEdit %> | &Mode=Delete&PN=<% = intRecordPositionPageNum %>" class="tiHeadingLink"><% = strTxtDelete %> <% End If %> <% = strGuestbookComments %> <% Response.Write(vbCrLf & strTxtCountry & " " & rsGuestbook("Country")) If blnGuestbookWebsiteField Then Response.Write(" | " & strTxtSite) If rsGuestbook("Site") = "http://" OR rsGuestbook("Site") = "" Then Response.Write(" " & strTxtNoSite) Else Response.Write(" " & rsGuestbook("Site") & "") End If End If %> <% Call FormatBottomTable("100%") rsGuestbook.Movenext Next End If Call FormatTopTable2("100%") %> <% If blnDropDownPageNumbers Then If intRecordPositionPageNum > 1 or NOT rsGuestbook.EOF Then Response.Write(vbCrLf & strTxtPage & ":  ") End If If intRecordPositionPageNum > 1 Then Response.Write(vbCrLf & "<< " & strTxtPrevious & " ") End If If intRecordPositionPageNum > 1 or NOT rsGuestbook.EOF Then For intLinkPageNum = 1 to intTotalNumGBPages If intLinkPageNum = intRecordPositionPageNum Then Response.Write(vbCrLf & intLinkPageNum) Else Response.Write(vbCrLf & "" & intLinkPageNum & "") End If Next End If If NOT rsGuestbook.EOF then Response.Write(vbCrLf & " " & strTxtNext & " >>") End If If intRecordPositionPageNum > 1 or NOT rsGuestbook.EOF Then Response.Write("

") End if Else Dim intTotalLinksToHide Dim intTotalLinksToShow Dim intPageNumLoop If intTotalNumGBPages <> 0 Then 'Display PREV page link, if appropriate If Not intRecordPositionPageNum = 1 Then Response.Write("Prev ") if intRecordPositionPageNum > 5 and intTotalNumGBPages > 10 Then Response.write("1 ...") if intTotalNumGBPages > 10 Then if intRecordPositionPageNum > 5 Then if intTotalNumGBPages > (intRecordPositionPageNum + 5) Then intTotalLinksToHide = (intRecordPositionPageNum - 4) intTotalLinksToShow = (intRecordPositionPageNum + 5) Else intTotalLinksToHide = (intTotalNumGBPages - 9) intTotalLinksToShow = intTotalNumGBPages End if Else intTotalLinksToHide = 1 intTotalLinksToShow = 10 End if Else intTotalLinksToHide = 1 intTotalLinksToShow = intTotalNumGBPages End if For intPageNumLoop = intTotalLinksToHide To intTotalLinksToShow if intPageNumLoop = Cint(intRecordPositionPageNum) Then Response.write(intPageNumLoop & " ") Else Response.write("" & intPageNumLoop & " ") End if Next Else if intTotalNumGBPages <> 1 Then Response.Write("1 ") if intTotalNumGBPages > 10 Then intTotalLinksToShow = 10 Else intTotalLinksToShow = intTotalNumGBPages End if For intPageNumLoop = 2 To intTotalLinksToShow if intPageNumLoop = Cint(intRecordPositionPageNum) Then Response.write(intPageNumLoop) Else Response.write("" & intPageNumLoop & " ") End if Next End if if intRecordPositionPageNum < intTotalNumGBPages - 5 and intTotalNumGBPages > 10 Then Response.write("... " & intTotalNumGBPages & "") if Not intRecordPositionPageNum = intTotalNumGBPages Then Response.Write(" Next") Response.Write(vbCrLf & "
") End If End If rsGuestbook.Close Set rsGuestbook = Nothing %><% = strTxtBackToHome %> | <% = strTxtSignGuestbook %>
<% Call FormatBottomTable("100%") %> <% Set rsCommon = Nothing adoCon.Close Set adoCon = Nothing %>