<% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz Guide - Web Wiz Mailing List '** '** Copyright 2001-2004 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 '** '**************************************************************************************** Dim adoCon 'Database Connection Variable Dim strAccessDB 'Holds the Access Database Name Dim rsCommon '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 strWebsiteName 'Holds the website name Dim strWebsiteAddress 'Holds the website URL and path to the script Dim strWebsiteEmailAddress 'Holds the forum e-mail address Dim strTestEmailAddress 'holds the e-mail address the preview e-mail is sent to Dim strMailComponent 'Email coponent the mailing list useses Dim strMailServer 'Website's outgoing SMTP mail server Dim strMailServerUser 'SMTP server user name Dim strMailServerPass 'SMTP server password Dim blnLCode 'set to true Dim strWelcomeEmailSub 'Holds the subject of the welcome email Dim strWelcomeEmailHTML 'Holds the welcome message that is sent to users (HTML format) Dim strWelcomeEmailText 'Holds the welcome message that is sent to users (plain text format) Dim strDbPathAndName 'Holds the path and name to the database Dim blnActivate 'Set to true if email activation is enabled Dim blnPlainTextOption 'Set to true if the user has a choice of a plain text email format Dim blnEncryptPasswords 'Set to true if passwords are encrypted Dim blnJoinNotify 'Set to true if the admin wants to be notifies of new subscriptions Dim blnRemoveNotify 'Set to trus if the admin wants to be notified of poeple leaving Dim strTitleImage 'Holds the location of the title image Dim strUploadComponent 'Holds the upload component Dim strFileUploadPath 'Holds the upload path Dim strFileTypes 'Holds the upload file types Dim strImageTypes 'Holds the upload image types Dim strDBFalse 'Holds the fales database value Dim strDBTrue 'Holds the true database value Dim strDatabaseDateFunction 'Holds the date function Dim strPrivacyStatment 'Holds the privacy statment for the mailing list Dim strSignature 'Holds custom signature 'Initiliase varibales Const strVersion = "4.0" Const strRTEversion = "1.2d" '***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** Const strSalt = "5CB237B1D85" Const strCodeField = "L_code" Const intSendValue = 50 '***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ****** 'Set up the database table name prefix Const strDbTable = "tblML" 'Database Type Const strDatabaseType = "Access" 'Const strDatabaseType = "SQLServer" 'Create database connection 'Create a connection odject Set adoCon = Server.CreateObject("ADODB.Connection") 'If this is access set the access driver If strDatabaseType = "Access" Then '--------------------- Set the path and name of the database -------------------------------------------------------------------------------- 'Virtual path to database strDbPathAndName = Server.MapPath("../dbz/mailing_list.mdb") 'This is the path of the database from this files location on the server 'Physical path to database 'strDbPathAndName = "" 'Use this if you use the physical server path, eg:- C:\Inetpub\private\mailing_list.mdb 'PLEASE NOTE: - For extra security it is highly recommended you change the name of the database, mailing_list.mdb, to another name and then 'replace the wwForum.mdb found above with the name you changed the forum database to. '--------------------------------------------------------------------------------------------------------------------------------------------- '------------- If you are having problems with the script then try using a diffrent driver or DSN 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=" & strDbPathAndName 'Alternative drivers faster than the generic one above 'strCon = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & strDbPathAndName 'This one is if you convert the database to Access 97 strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & strDbPathAndName '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 '--------------------------------------------------------------------------------------------------------------------------------------------- 'The now() function is used in Access for dates strDatabaseDateFunction = "Now()" 'Set true and false strDBFalse = "false" strDBTrue = "true" 'Else set the MS SQL server stuff Else %><% 'The GetDate() function is used in SQL Server strDatabaseDateFunction = "GetDate()" 'Set true and false strDBFalse = 0 strDBTrue = 1 End If adoCon.connectionstring = strCon 'Set an active connection to the Connection object adoCon.Open 'Read in the mailing list configuration 'Intialise the ADO recordset object Set rsCommon = Server.CreateObject("ADODB.Recordset") 'Initialise the SQL variable with an SQL statement to get the configuration details from the database strSQL = "SELECT " & strDbTable & "Configuration.* From " & strDbTable & "Configuration;" 'Query the database rsCommon.Open strSQL, adoCon 'If there is config deatils in the recordset then read them in If NOT rsCommon.EOF Then 'Read in the configuration details from the recordset strWebsiteName = rsCommon("Website_name") strWebsiteAddress = rsCommon("Website_address") strWebsiteEmailAddress = rsCommon("Website_email_address") strTestEmailAddress = rsCommon("Test_email_address") strTitleImage = rsCommon("Title_image") strMailComponent = rsCommon("Mail_component") strMailServer = rsCommon("Mail_server") strMailServerUser = rsCommon("Mail_username") strMailServerPass = rsCommon("Mail_password") strWelcomeEmailSub = rsCommon("Welcome_email_subject") strWelcomeEmailHTML = rsCommon("Welcome_email_HTML") strWelcomeEmailText = rsCommon("Welcome_email_text") blnLCode = CBool(rsCommon("L_code")) blnActivate = CBool(rsCommon("Activate")) blnPlainTextOption = CBool(rsCommon("PlainText_Option")) blnEncryptPasswords = CBool(rsCommon("Encrypt_passwords")) blnJoinNotify = CBool(rsCommon("Join_notify")) blnRemoveNotify = CBool(rsCommon("Remove_notify")) strUploadComponent = rsCommon("Upload_component") strImageTypes = rsCommon("Upload_img_types") strFileUploadPath = rsCommon("Upload_path") strFileTypes = rsCommon("Upload_files_type") strPrivacyStatment = rsCommon("Privacy") strSignature = rsCommon("Signature") End If 'Reset server object rsCommon.Close %>