<% Option Explicit %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide Guestbook '** '** Copyright 2001 Bruce Corkhill All Rights Reserved. '** '** 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 '** any later version. '** '** All copyright notices must remain intacked in the scripts and the '** outputted HTML. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide must remain in place and the powered by '** logo with link back to Web Wiz Guide must remain visiable when the pages '** are viewed. '** '** 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 '** '** '** No official support is available for this program but you may post support questions at: - '** http://www.webwizguide.info/guestbook '** '** Support questions are NOT answered by e-mail ever! '** '** For correspondence or non support questions contact: - '** info@webwizguide.com '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '**************************************************************************************** 'Declare variables Dim adoCon 'Database Connection Variable Dim rsConfiguration 'Holds the configuartion recordset Dim strCon 'Holds the Database driver and the path and name of the database Dim strSQL 'Holds the SQL query for the database Dim intRecordsPerPage 'Holds the number of files shown on each page Dim strBgColour 'Holds the background colour of the guestbook Dim strTextColour 'Holds the text colour of the guestbook Dim strLinkColour 'Holds the link colour of the guestbook Dim strTextType 'Holds the font type of the guestbook Dim intTextSize 'Holds the font size of the guestbook Dim strTableColour 'Holds the table colour Dim strTableBorderColour 'Holds the table border colour Dim strTableTitleColour 'Holds the table title colour Dim strVisitedLinkColour 'Holds the visited link colour of the guestbook Dim strActiveLinkColour 'Holds the active link colour of the guestbook Dim strHoverLinkColour 'Holds the active link colour of the guestbook Dim blnEmail 'Boolean set to true if e-mail is on Dim strWebSiteEmailAddress 'Holds the e-mail address for the web site the Guestbook is on Dim strMailComponent 'Email coponent the guestbook useses Dim strSMTPServer 'SMTP server for sending the e-mails through Dim strLoggedInUserCode 'Holds the user code of the user Dim strTitleImage 'Holds the path and name for the title image for the guestbook Dim intMsgCharNo 'Holds the number of characters allowed for the messages 'Create database connection 'Create a connection odject Set adoCon = Server.CreateObject("ADODB.Connection") '------------- If you are having problems with the script then try using a diffrent driver by editing the lines below -------------- 'Database connection info and driver (if this driver does not work then comment it out and use one of the alternative drivers) strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("guestbook.mdb") 'Database driver for Brinkster 'strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/USERNAME/db/guestbook.mdb") 'This one is for Brinkster users place your Brinster username where you see USERNAME 'Alternative drivers faster than the basic one above 'strCon = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & Server.MapPath("guestbook.mdb") 'This one is if you convert the database to Access 97 'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("guestbook.mdb") 'This one is for Access 2000/2002 'If you wish to use DSN then comment out the driver above and uncomment the line below (DSN is slower than the above drivers) 'strCon = "DSN = DSN_NAME" 'Place the DSN where you see DSN_NAME '--------------------------------------------------------------------------------------------------------------------------------------------- 'Set an active connection to the Connection object adoCon.Open strCon 'Read in the Guestbook configuration 'Intialise the ADO recordset object Set rsConfiguration = Server.CreateObject("ADODB.Recordset") 'Initialise the SQL variable with an SQL statement to get the configuration details from the database strSQL = "SELECT tblConfiguration.* From tblConfiguration;" 'Query the database rsConfiguration.Open strSQL, strCon 'If there is config deatils in the recordset then read them in If NOT rsConfiguration.EOF Then 'Read in the configuration details from the recordset strMailComponent = rsConfiguration("mail_component") strSMTPServer = rsConfiguration("mail_server") strBgColour = rsConfiguration("bg_colour") strTextColour = rsConfiguration("text_colour") strTextType = rsConfiguration("text_type") intTextSize = CInt(rsConfiguration("text_size")) strLinkColour = rsConfiguration("links_colour") strTableColour = rsConfiguration("table_colour") strTableBorderColour = rsConfiguration("table_border_colour") strTableTitleColour = rsConfiguration("table_title_colour") strVisitedLinkColour = rsConfiguration("visited_links_colour") strHoverLinkColour = rsConfiguration("active_links_colour") strWebSiteEmailAddress = rsConfiguration("email_address") blnEmail = CBool(rsConfiguration("email_notify")) intRecordsPerPage = CInt(rsConfiguration("Comments_per_page")) strTitleImage = rsConfiguration("Title_image") intMsgCharNo = rsConfiguration("Message_char_no") End If %> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide Guestbook '** '** Copyright 2001 Bruce Corkhill All Rights Reserved. '** '** 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 '** any later version. '** '** All copyright notices must remain intacked in the scripts and the '** outputted HTML. '** '** You may not pass the whole or any part of this application off as your own work. '** '** All links to Web Wiz Guide must remain in place and the powered by '** logo with link back to Web Wiz Guide must remain visiable when the pages '** are viewed. '** '** 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 '** '** '** 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.com '** '** or at: - '** '** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom '**************************************************************************************** 'Buffer the response Response.Buffer = True 'Dimension variables Dim adoRec 'Database Recordset Variable Dim strName 'Holds the Users name Dim strEmailAddress 'Holds the Users e-mail address Dim strCountry 'Holds the users country Dim strHomepage 'Holds the Users homepage Dim strComments 'Holds the Users comments Dim dtmEntryDate 'Holds the date the commnets where made Dim intRecordPositionPageNum 'Holds the record position Dim intRecordLoopCounter 'Loop counter for displaying the guestbook records Dim intTotalNumGuestbookEntries 'Holds the total number of records in the database Dim intTotalNumGuestbookPages 'Holds the total number of pages in the database Dim intLinkPageNum 'Holds the page number to be linked to 'If this is the first time the page is displayed then the guestbook record position is set to page 1 If Request.QueryString("PagePosition") = "" Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the guestbook record postion is set to the Record Position number Else intRecordPositionPageNum = CInt(Request.QueryString("PagePosition")) End If 'Create recorset object Set adoRec = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblComments.* FROM tblComments ORDER BY Date_stamp DESC;" 'Set the cursor type property of the record set to dynamic so we can naviagate through the record set adoRec.CursorType = 3 'Query the database adoRec.Open strSQL, adoCon 'Set the number of records to display on each page by the constant set at the top of the script adoRec.PageSize = intRecordsPerPage 'Get the guestbook record poistion to display from If NOT adoRec.EOF Then adoRec.AbsolutePage = intRecordPositionPageNum %> TMN - Torpedos __compete_code = '667f89f26d96c30e99728fe6a608804d'; (function () { var s = document.createElement('script'), d = document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0], t = 'https:' == document.location.protocol ? 'https://c.compete.com/bootstrap/' : 'http://c.compete.com/bootstrap/'; s.src = t + __compete_code + '/bootstrap.js'; s.type = 'text/javascript'; s.async = 'async'; if (d) { d.appendChild(s); } }());
Make your own free website on Tripod.com
" text="<% = strTextColour %>"> " End If %>
<% 'If there is a Guestbook image then dsiplay it If NOT strTitleImage = "" Then Response.Write("

Enviar torpedo
<% 'If there are no rcords in the database display an error message If adoRec.EOF Then 'Tell the user there are no records to show Response.Write "
No momento estamos sem torpedo" Response.Write "
Seja o primeiro a enviar um!" Response.End 'Display the guestbook Else 'Count the number of enties in the guestbook database intTotalNumGuestbookEntries = adoRec.RecordCount 'Count the number of pages there are in the guestbook database calculated by the PageSize attribute set above intTotalNumGuestbookPages = adoRec.PageCount 'Display the HTML number number the total number of pages and total number of records in the guestbook database %>

Total de <% = intTotalNumGuestbookEntries %> torpedos
Página <% = intRecordPositionPageNum %> de <% = intTotalNumGuestbookPages %>

<% 'For....Next Loop to display records from the guestbook database For intRecordLoopCounter = 1 to intRecordsPerPage 'If there are no guestbook records left to display then exit loop If adoRec.EOF Then Exit For 'Read in the values form the database strName = adoRec("Name") strCountry = adoRec("Country") strEmailAddress = adoRec("EMail") dtmEntryDate = CDate(adoRec("Date_stamp")) strHomepage = adoRec("Homepage") strComments = adoRec("Comments") 'Write the HTML to the web browser to display the guestbook entries %>
De: <% = strName %>
Para: <% = strHomepage %>
Assunto: <% = strCountry %>
<% = strComments %>
Enviado: <% = FormatDateTime(dtmEntryDate, VbLongDate) %> às <% = FormatDateTime(dtmEntryDate, VbShortTime) %>

<% 'Move to the next record in the database adoRec.MoveNext 'Loop back round Next End If 'Display an HTML table with links to the other entries in the guestbook %>
<% 'If there are more pages to display then add a title to the other pages If intRecordPositionPageNum > 1 or NOT adoRec.EOF Then Response.Write vbCrLf & " Page:  " End If 'If the guestbook page number is higher than page 1 then display a back link If intRecordPositionPageNum > 1 Then Response.Write vbCrLf & " << Anterior " End If 'If there are more pages to display then display links to all the pages If intRecordPositionPageNum > 1 or NOT adoRec.EOF Then 'Display a link for each page in the guestbook For intLinkPageNum = 1 to intTotalNumGuestbookPages 'If the page to be linked to is the page displayed then don't make it a hyper-link If intLinkPageNum = intRecordPositionPageNum Then Response.Write vbCrLf & " " & intLinkPageNum Else Response.Write vbCrLf & "  " & intLinkPageNum & " " End If Next End If 'If it is Not the End of the guestbook entries then display a next link for the next guestbook page If NOT adoRec.EOF then Response.Write vbCrLf & "  Próximo >>" End If 'Finsh HTML the table %>
<% 'Reset Server Variables Set adoCon = Nothing Set strCon = Nothing adoRec.Close Set adoRec = Nothing %>

<% '### START - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ### '### END - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ### %>