<% ' Copyright (C) 1998-2005 Cyberstrong Internet Services, Inc. All Rights Reserved ' ' This file has been seeded with unique information at point of sale and ' is traceable to its purchaser. ' ' Your license agreement forbids the removal of this notice. Dim cst50FooterMsg ' Footer Message Page 5 Dim cstAffiliateLink ' Enable Affiliate Link Dim cstAmountEditEnabled ' Enable Amount Editing Dim cstAuthorizedHours ' Auto Log In Authorization Hours Dim cstAutoUpdateSEP ' Auto Update Search Engine Pages Dim cstBrowseColumnProfile ' Browse Column Profile Dim cstBrowsePageCount ' Browse Page Count Dim cstBrowseStartPageURL ' Browse Start Page URL Dim cstBrowseTemplate ' Product Browse Template Dim cstCancelURL ' Cancel URL Dim cstCanPostLogin ' Account ID (Canada Post) Dim cstCanPostPackageSize ' Package Size (Canada Post) Dim cstCatalogName ' Catalog Name Dim cstCategoriesEnabled ' Enable Product Categories Dim cstCCCollectEnabled ' CC Collect Enable Dim cstCCGreekEnabled ' Enable CC Greeking Dim cstCCRepeatPmtEnabled ' Enable Repeat Payments Dim cstCCValidate ' CC Validate Dim cstCouponsEnabled ' Enable Product Coupons Dim cstCrossSellDisplayMenu ' Display Cross Sell Product Selection Menu Dim cstCrossSellEnabled ' Enable Cross Selling Dim cstCrossSellInviteText ' Cross Sell Invitation Text Dim cstCSCEnabled ' CC Security Code Enabled Dim cstCurrencySymbol ' Currency Symbol Dim cstCustomerDeleteDays ' Customer Record Delete Time Dim cstCustomerEMailSubjectLine ' Customer E-Mail Subject Line Dim cstCustomerLoginEnabled ' Enable Customer Login Dim cstDatabaseVersion ' Database Version Dim cstDeleteCCInfoAfterUse ' Delete Credit Card Info After Use Dim cstDigitalDownloadEnabled ' Enable Product Downloads Dim cstDiscountAmountFormat ' Discount Amount Format Dim cstDiscountsEnabled ' Enable Product Discounts Dim cstDisplayCategoryDDB ' Display Category Drop Down Box Dim cstDisplayDatesEnabled ' Enable Product Display Dates Dim cstDisplaySearchBox ' Display Search Box Dim cstDisplayStateDDB ' Display State/Province Drop Down Box Dim cstDisplayTransitTime ' Display Transit Time Dim cstDomain ' Domain Name URL Dim cstDownloadDeleteDays ' Download Delete Days Dim cstEncryptionKey ' Encryption Key Dim cstErrorsToAddress ' Errors To Address Dim cstExpandTemplate ' Product Expand Template Dim cstFedExInsidePickup ' Inside Pickup (FedEx) Dim cstFedExLogin ' Account Number (FedEx) Dim cstFedExMeterNum ' Meter Number (FedEx) Dim cstFedExPackageType ' Package Type (FedEx) Dim cstFedExPickupType ' Pickup Type (FedEx) Dim cstFlatRateShippingEnabled ' Enable Flat Rate Shipping Dim cstFreeShippingEnabled ' Enable Free Shipping Dim cstFromEmailAddress ' From E-Mail Address Dim cstHideSalesTax ' Hide Sales Tax Dim cstHomeState ' Home State Dim cstHomeStateTax ' Home State Tax Dim cstHomeURL ' Home URL Dim cstInsured ' Insure Package Dim cstKeywordsEnabled ' Enable Product Keywords Dim cstLinkExpandOnCheckout ' Link Expand Page on Checkout Dim cstListPriceEnabled ' Enable Product List Price Dim cstLiveInvEnabled ' Enable Live Inventory Dim cstLiveInvInStockDisplay ' In Stock Display Message Dim cstLiveInvNoStockDisplay ' Out of Stock Display Message Dim cstLiveInvNoStockHide ' Hide Out of Stock Items Dim cstLoginID ' Login ID Dim cstLongDescriptionEnabled ' Enable Long Descriptions Dim cstMailService ' E-Mail Service Dim cstMinOrderAmount ' Minimum Order Amount Dim cstMinOrderQtyEnabled ' Enable Minimum Order Quantity Dim cstNewUntilDateEnabled ' Enable Product New Until Date Dim cstNonSecurePrefix ' Non-Secure Server Prefix Dim cstNotify1EMailSubjectLine ' Notify 1 E-Mail Subject Line Dim cstNotify2EMailSubjectLine ' Notify 2 E-Mail Subject Line Dim cstNotifyAddress1 ' Notify 1 E-Mail Address Dim cstNotifyAddress2 ' Notify 2 E-Mail Address Dim cstOptInMessage ' Opt In Message Dim cstOptionsUseRadio ' Options Use Radio Dim cstOrderDeleteDays ' Order Delete Time Dim cstOrderStartNo ' Order Start Number Dim cstOriginCity ' Originating City Dim cstOriginCode ' Originating Postal Code Dim cstOriginCountry ' Originating Country Dim cstOriginState ' Originating State Dim cstPagePosition ' Page Position Dim cstPassword ' Password Dim cstPONumberEnabled ' Enable Purchase Order Numbers Dim cstProductHideEnabled ' Enable Product Hide Dim cstProductImageFolder ' Product Image Folder Dim cstProductImagesEnabled ' Enable Product Images Dim cstProductShipsFreeEnabled ' Enable Free Shipping Per Product Dim cstProgressBarEnabled ' Enable Progress Bar Dim cstRecordCountMsg ' Record Count Message Dim cstRunningTotalsEnabled ' Enable Running Totals Dim cstSalePriceEnabled ' Enable Product Sale Price Dim cstSalesTaxIncludesShipping ' Sales Tax Includes Shipping Dim cstSalesTaxName ' Sales Tax Name Dim cstSalesTaxUsesBillToAddress ' Use Bill To Address Dim cstSavingsDisplayEnabled ' Enable Savings Display Dim cstScriptTimeOut ' Script Time Out Dim cstSecurePrefix ' Secure Server Prefix Dim cstSendShippedEmail ' Send eMail When Order Shipped Dim cstSessionTimeOut ' Session Time Out Dim cstSharedCrossSellEnabled ' Enable Shared Cross Selling Dim cstSharedOptionsEnabled ' Enable Shared Product Options Dim cstShipAmountAdd ' Shipping Amount Add Dim cstShipFailWarn ' Shipping Fail Warn Dim cstShipFreeOverAmount ' Free Shipping Over Amount Dim cstShipMaxCharge ' Maximum Shipping Charge Dim cstShipMinCharge ' Minimum Shipping Charge Dim cstShipNote ' Special Instructions Dim cstShipPercentAdd ' Shipping Percent Add Dim cstShipPerMethodAdd ' Per Shipping Method Add Dim cstShippingRulesEnabled ' Enable Shipping Method Rules Dim cstShippingUnitsEnabled ' Enable Product Shipping Units Dim cstShipPreviewEnabled ' Enable Shipping Rate Preview Dim cstShipWarn ' Shipping Warning Dim cstShipWeightAdd ' Shipping Weight Add Dim cstSMTPServer ' SMTP Server Address Dim cstSortCodeEnabled ' Enable Product Sort Code Dim cstStockStatusEnabled ' Enable Product Stock Status Dim cstSuppressShipTo ' Suppress 'Ship To' Fields Dim cstSurveyQuestions ' Survey Questions Dim cstTaxOverrideEnabled ' Enable Product Tax Override Dim cstUpgradeFileCRC ' Upgrade File CRC Dim cstUPSContainer ' Shipping Container (UPS) Dim cstUPSLogin ' Login and Password (UPS) Dim cstUPSPackageOversize ' Oversized Packaging (UPS) Dim cstUPSPickupType ' Pickup Type (UPS) Dim cstUPSUnitsofWeight ' Units of Weight (UPS) Dim cstUseAutoShipToAddress ' Enable Auto-Fill 'Ship To' Address Dim cstUseResidentialRate ' Use Residential Rate Dim cstUSPSContainer ' Shipping Container (USPS) Dim cstUSPSLogin ' Login and Password (USPS) Dim cstUSPSMachinable ' Machinable (USPS) Dim cstUSPSPackageSize ' Package Size (USPS) Dim cstViewAllButtonEnabled ' Enable View All Button Dim gblDemoMode ' Demo Mode Public Sub LoadConfiguration() Dim ReturnValue, rsConfig, SQLConfig, oTable, VariableName ' Do our own error processing ... On Error Resume Next Set oTable = CreateObject("Scripting.Dictionary") ' Duplicate these two ADO constants here to eliminate dependence on adovbs.asp Const adOpenKeysetConfig = 1 Const adLockOptimisticConfig = 3 ' Default, bootstrap values, in case we are unable to read the database ... oTable("cstScriptTimeOut") = CLng(300) oTable("cstSessionTimeOut") = CLng(10) oTable("cstLoginID") = "safina" oTable("cstPassword") = "safina" ' Set bootstrap timeouts ... Server.ScriptTimeOut = oTable("cstScriptTimeOut") Session.TimeOut = oTable("cstSessionTimeOut") ' Open the database and get the shop parameters ... Set Conn = dbOpen("rs") If (Not ConnectFailed) Then SQLConfig = "SELECT * FROM Parms Order By VariableName" set rsConfig = Server.CreateObject("ADODB.Recordset") rsConfig.Open SQLConfig, Conn, adOpenKeysetConfig, adLockOptimisticConfig If (rsConfig.RecordCount <> 0) Then Do While (Not rsConfig.EOF) If Trim(rsConfig("Value")) <> "-" Then VariableName = CStr(rsConfig("VariableName")) Select Case rsConfig("VariableType") Case "Bool" If (Trim(LCase(rsConfig("Value"))) = "yes") Then oTable(VariableName) = True Else oTable(VariableName) = False End If Case "Lng" If (Not Trim(rsConfig("Value")) = "") Then oTable(VariableName) = CLng(Trim(rsConfig("Value"))) Else oTable(VariableName) = CLng(0) End If Case "Dbl" If (Not Trim(rsConfig("Value")) = "") Then oTable(VariableName) = CDbl(Trim(rsConfig("Value"))) Else oTable(VariableName) = CDbl(0) End If Case "Str" oTable(VariableName) = CStr(CleanConfigString(Trim(rsConfig("Value")))) Case Else wl("config.asp: Unknown parameter type for variable '" & VariableName & "'. Contact software vendor") Response.End End Select End If rsConfig.MoveNext Loop ' Set timeouts ... Server.ScriptTimeOut = oTable("cstScriptTimeOut") Session.TimeOut = oTable("cstSessionTimeOut") End If End If Call dbClose(Conn) ' Load configuration variables from temporary table ... cst50FooterMsg = oTable("cst50FooterMsg") cstAffiliateLink = oTable("cstAffiliateLink") cstAmountEditEnabled = oTable("cstAmountEditEnabled") cstAuthorizedHours = oTable("cstAuthorizedHours") cstAutoUpdateSEP = oTable("cstAutoUpdateSEP") cstBrowseColumnProfile = oTable("cstBrowseColumnProfile") cstBrowsePageCount = oTable("cstBrowsePageCount") cstBrowseStartPageURL = oTable("cstBrowseStartPageURL") cstBrowseTemplate = oTable("cstBrowseTemplate") cstCancelURL = oTable("cstCancelURL") cstCanPostLogin = oTable("cstCanPostLogin") cstCanPostPackageSize = oTable("cstCanPostPackageSize") cstCatalogName = oTable("cstCatalogName") cstCategoriesEnabled = oTable("cstCategoriesEnabled") cstCCCollectEnabled = oTable("cstCCCollectEnabled") cstCCGreekEnabled = oTable("cstCCGreekEnabled") cstCCRepeatPmtEnabled = oTable("cstCCRepeatPmtEnabled") cstCCValidate = oTable("cstCCValidate") cstCouponsEnabled = oTable("cstCouponsEnabled") cstCrossSellDisplayMenu = oTable("cstCrossSellDisplayMenu") cstCrossSellEnabled = oTable("cstCrossSellEnabled") cstCrossSellInviteText = oTable("cstCrossSellInviteText") cstCSCEnabled = oTable("cstCSCEnabled") cstCurrencySymbol = oTable("cstCurrencySymbol") cstCustomerDeleteDays = oTable("cstCustomerDeleteDays") cstCustomerEMailSubjectLine = oTable("cstCustomerEMailSubjectLine") cstCustomerLoginEnabled = oTable("cstCustomerLoginEnabled") cstDatabaseVersion = oTable("cstDatabaseVersion") cstDeleteCCInfoAfterUse = oTable("cstDeleteCCInfoAfterUse") cstDigitalDownloadEnabled = oTable("cstDigitalDownloadEnabled") cstDiscountAmountFormat = oTable("cstDiscountAmountFormat") cstDiscountsEnabled = oTable("cstDiscountsEnabled") cstDisplayCategoryDDB = oTable("cstDisplayCategoryDDB") cstDisplayDatesEnabled = oTable("cstDisplayDatesEnabled") cstDisplaySearchBox = oTable("cstDisplaySearchBox") cstDisplayStateDDB = oTable("cstDisplayStateDDB") cstDisplayTransitTime = oTable("cstDisplayTransitTime") cstDomain = oTable("cstDomain") cstDownloadDeleteDays = oTable("cstDownloadDeleteDays") cstEncryptionKey = oTable("cstEncryptionKey") cstErrorsToAddress = oTable("cstErrorsToAddress") cstExpandTemplate = oTable("cstExpandTemplate") cstFedExInsidePickup = oTable("cstFedExInsidePickup") cstFedExLogin = oTable("cstFedExLogin") cstFedExMeterNum = oTable("cstFedExMeterNum") cstFedExPackageType = oTable("cstFedExPackageType") cstFedExPickupType = oTable("cstFedExPickupType") cstFlatRateShippingEnabled = oTable("cstFlatRateShippingEnabled") cstFreeShippingEnabled = oTable("cstFreeShippingEnabled") cstFromEmailAddress = oTable("cstFromEmailAddress") cstHideSalesTax = oTable("cstHideSalesTax") cstHomeState = oTable("cstHomeState") cstHomeStateTax = oTable("cstHomeStateTax") cstHomeURL = oTable("cstHomeURL") cstInsured = oTable("cstInsured") cstKeywordsEnabled = oTable("cstKeywordsEnabled") cstLinkExpandOnCheckout = oTable("cstLinkExpandOnCheckout") cstListPriceEnabled = oTable("cstListPriceEnabled") cstLiveInvEnabled = oTable("cstLiveInvEnabled") cstLiveInvInStockDisplay = oTable("cstLiveInvInStockDisplay") cstLiveInvNoStockDisplay = oTable("cstLiveInvNoStockDisplay") cstLiveInvNoStockHide = oTable("cstLiveInvNoStockHide") cstLoginID = oTable("cstLoginID") cstLongDescriptionEnabled = oTable("cstLongDescriptionEnabled") cstMailService = oTable("cstMailService") cstMinOrderAmount = oTable("cstMinOrderAmount") cstMinOrderQtyEnabled = oTable("cstMinOrderQtyEnabled") cstNewUntilDateEnabled = oTable("cstNewUntilDateEnabled") cstNonSecurePrefix = oTable("cstNonSecurePrefix") cstNotify1EMailSubjectLine = oTable("cstNotify1EMailSubjectLine") cstNotify2EMailSubjectLine = oTable("cstNotify2EMailSubjectLine") cstNotifyAddress1 = oTable("cstNotifyAddress1") cstNotifyAddress2 = oTable("cstNotifyAddress2") cstOptInMessage = oTable("cstOptInMessage") cstOptionsUseRadio = oTable("cstOptionsUseRadio") cstOrderDeleteDays = oTable("cstOrderDeleteDays") cstOrderStartNo = oTable("cstOrderStartNo") cstOriginCity = oTable("cstOriginCity") cstOriginCode = oTable("cstOriginCode") cstOriginCountry = oTable("cstOriginCountry") cstOriginState = oTable("cstOriginState") cstPagePosition = oTable("cstPagePosition") cstPassword = oTable("cstPassword") cstPONumberEnabled = oTable("cstPONumberEnabled") cstProductHideEnabled = oTable("cstProductHideEnabled") cstProductImageFolder = oTable("cstProductImageFolder") cstProductImagesEnabled = oTable("cstProductImagesEnabled") cstProductShipsFreeEnabled = oTable("cstProductShipsFreeEnabled") cstProgressBarEnabled = oTable("cstProgressBarEnabled") cstRecordCountMsg = oTable("cstRecordCountMsg") cstRunningTotalsEnabled = oTable("cstRunningTotalsEnabled") cstSalePriceEnabled = oTable("cstSalePriceEnabled") cstSalesTaxIncludesShipping = oTable("cstSalesTaxIncludesShipping") cstSalesTaxName = oTable("cstSalesTaxName") cstSalesTaxUsesBillToAddress = oTable("cstSalesTaxUsesBillToAddress") cstSavingsDisplayEnabled = oTable("cstSavingsDisplayEnabled") cstScriptTimeOut = oTable("cstScriptTimeOut") cstSecurePrefix = oTable("cstSecurePrefix") cstSendShippedEmail = oTable("cstSendShippedEmail") cstSessionTimeOut = oTable("cstSessionTimeOut") cstSharedCrossSellEnabled = oTable("cstSharedCrossSellEnabled") cstSharedOptionsEnabled = oTable("cstSharedOptionsEnabled") cstShipAmountAdd = oTable("cstShipAmountAdd") cstShipFailWarn = oTable("cstShipFailWarn") cstShipFreeOverAmount = oTable("cstShipFreeOverAmount") cstShipMaxCharge = oTable("cstShipMaxCharge") cstShipMinCharge = oTable("cstShipMinCharge") cstShipNote = oTable("cstShipNote") cstShipPercentAdd = oTable("cstShipPercentAdd") cstShipPerMethodAdd = oTable("cstShipPerMethodAdd") cstShippingRulesEnabled = oTable("cstShippingRulesEnabled") cstShippingUnitsEnabled = oTable("cstShippingUnitsEnabled") cstShipPreviewEnabled = oTable("cstShipPreviewEnabled") cstShipWarn = oTable("cstShipWarn") cstShipWeightAdd = oTable("cstShipWeightAdd") cstSMTPServer = oTable("cstSMTPServer") cstSortCodeEnabled = oTable("cstSortCodeEnabled") cstStockStatusEnabled = oTable("cstStockStatusEnabled") cstSuppressShipTo = oTable("cstSuppressShipTo") cstSurveyQuestions = oTable("cstSurveyQuestions") cstTaxOverrideEnabled = oTable("cstTaxOverrideEnabled") cstUpgradeFileCRC = oTable("cstUpgradeFileCRC") cstUPSContainer = oTable("cstUPSContainer") cstUPSLogin = oTable("cstUPSLogin") cstUPSPackageOversize = oTable("cstUPSPackageOversize") cstUPSPickupType = oTable("cstUPSPickupType") cstUPSUnitsofWeight = oTable("cstUPSUnitsofWeight") cstUseAutoShipToAddress = oTable("cstUseAutoShipToAddress") cstUseResidentialRate = oTable("cstUseResidentialRate") cstUSPSContainer = oTable("cstUSPSContainer") cstUSPSLogin = oTable("cstUSPSLogin") cstUSPSMachinable = oTable("cstUSPSMachinable") cstUSPSPackageSize = oTable("cstUSPSPackageSize") cstViewAllButtonEnabled = oTable("cstViewAllButtonEnabled") gblDemoMode = oTable("gblDemoMode") ' Config variable over-rides, defaults and checks ... If (Trim(cstCancelURL) = "") Then cstCancelURL = cstHomeURL If (Trim(cstBackgroundImage) = "") Then cstBackgroundImage = "images/bgwhite.gif" ' Allow additional user defined configuration adjustments ... Call UserExit(usrAdjustConfig, 0, 0, 0, 0, ReturnValue) If ((Session(SessionPrefix & "Loaded") = "") AND (LCase(GetScriptName()) = "msetprm.asp")) Then ' Changing the configuration parms may require rebuilding the category index ... Set Conn = dbOpen("rw") : Call UpdateCategoryIndexAll() : Call dbClose(Conn) End If ' Clean up ... Session(SessionPrefix & "Loaded") = "Yes" oTable.RemoveAll : Set oTable = Nothing End Sub ' CleanConfigString() - Remove problem characters from parm value string ' - Special version of CleanString() supports backward ' - compatibility with EncryptionKey handling. Private Function CleanConfigString(ByVal argString) Dim i, s s = argString For i = 1 To Len(s) Step 1 Select Case Mid(s, i, 1) Case Chr(10) CleanConfigString = CleanConfigString & " " Case Chr(13) CleanConfigString = CleanConfigString & " " Case Else CleanConfigString = CleanConfigString & Mid(s, i, 1) End Select Next End Function Call LoadConfiguration() %>