%
'Version 2.47. Copyright 2006 to 2007(c), Jay Ligda. All rights reserved
Function stripTags(htmlCodeToStrip)
stripTags = htmlCodeToStrip
If Len(stripTags) > 0 Then stripTags = Replace(stripTags,"><", "> <")
Do While InStr(stripTags,"<") > 0
startStrip = InStr(stripTags,"<")
endStrip = InStr(stripTags,">")
Do While startStrip > endStrip
stripTags = Left(stripTags,endStrip-1) & ">" & Right(stripTags,Len(stripTags)-endStrip)
startStrip = InStr(stripTags,"<")
endStrip = InStr(stripTags,">")
Loop
htmlTag = Mid(stripTags,startStrip,endStrip-startStrip+1)
stripTags = Replace(stripTags,htmlTag,"")
Loop
End Function
Function From2SQL(strSource)
If strSource <> "" Then
From2SQL = Replace(strSource,"**SQUOTE**","'")
From2SQL = Replace(From2SQL,"**QUOTE**",Chr(34))
Else
From2SQL = ""
End If
End Function
Function To2SQL(strSource)
If strSource <> "" Then
To2SQL = Replace(strSource, "'", "**SQUOTE**")
To2SQL = Replace(To2SQL, Chr(34), "**QUOTE**")
Else
To2SQL = ""
End If
End Function
Function firstName(strFullNameForFirst)
strFullNameForFirst = Trim(strFullNameForFirst)
theSpace = InStr(strFullNameForFirst," ")
If theSpace > 0 Then
firstName = Trim(Left(strFullNameForFirst,theSpace-1))
strFullNameForFirst = Trim(Right(strFullNameForFirst,Len(strFullNameForFirst)-theSpace))
theSpace = InStr(strFullNameForFirst," ")
If theSpace = 2 Then firstName = firstName & " " & Left(strFullNameForFirst,1)
If theSpace = 3 And Mid(strFullNameForFirst,2,1) = "." Then firstName = firstName & " " & Left(strFullNameForFirst,2)
Else
firstName = strFullNameForFirst
End If
End Function
Function lastName(strFullNameForLast)
strFullNameForLast = Trim(strFullNameForLast)
theSpace = InStr(strFullNameForLast," ")
If theSpace > 0 Then
strFullNameForLast = Trim(Right(strFullNameForLast,Len(strFullNameForLast)-theSpace))
theSpace = InStr(strFullNameForLast," ")
If theSpace = 2 Then
strFullNameForLast = Trim(Right(strFullNameForLast,Len(strFullNameForLast)-2))
End If
If theSpace = 3 And Mid(strFullNameForLast,2,1) = "." Then
strFullNameForLast = Trim(Right(LastName,Len(strFullNameForLast)-3))
End If
End If
lastName = strFullNameForLast
End Function
Function generatePassword(intLength)
Randomize
Pass = 0
strGENPassword = ""
Do Until Pass = intLength
intRandNum = int(rnd*87)+35
If (intRandNum <= 57 And intRandNum >= 48) Or (intRandNum <= 90 And intRandNum >= 65) Or (intRandNum <= 122 And intRandNum >= 97) Then
Pass = Pass + 1
strGENPassword = strGENPassword & Chr(intRandNum)
End If
Loop
generatePassword = strGENPassword
End Function
Function DollarValue(numValue)
If numValue & "*" <> "*" Then numValue = Replace(numValue,"$","")
If IsNumeric(numValue) Then
numValue = Round(numValue,2)
DollarValue = "$" & numValue
theDot = Instr(DollarValue,".")
If Mid(DollarValue,Len(DollarValue)-1,1) = "." Then DollarValue = DollarValue & "0"
Else
DollarValue = "$0"
End If
End Function
Function FromSQL(strSource)
If strSource <> "" Then
FromSQL = Replace(strSource, "", "'")
FromSQL = Replace(FromSQL, """, Chr(34))
FromSQL = Replace(FromSQL, "
", VbCrLf)
Else
FromSQL = ""
End If
End Function
Function ToSQL(strSource)
If strSource <> "" Then
ToSQL = Replace(strSource, "'", "")
ToSQL = Replace(ToSQL, Chr(34), """)
ToSQL = Replace(ToSQL, VbCrLf, "
")
Else
ToSQL = ""
End If
End Function
Function sendEmail(strRecipientAddress, strRecipientName, strSenderAddress, strSenderName, strSubject, strMessage)
If Application("sendEmail") = "Store" Then sendLater = "True"
DBConnectStringEmail = Application("cl_ConnectionString")
Set DBConnectionEmail = Server.CreateObject("ADODB.Connection")
DBConnectionEmail.open DBConnectStringEmail
SQLStatementEmail = "clients.cl_ClientsServersSelectAll"
Set RecordSetEmail = Server.CreateObject("ADODB.Recordset")
RecordSetEmail.Open SQLStatementEmail, DBConnectionEmail, 3, 3
If Not RecordSetEmail.EOF Then
RecordSetEmail.MoveFirst
Do While Not RecordSetEmail.EOF
strIP = RecordSetEmail.Fields("strIP").Value
If Request.ServerVariables("LOCAL_ADDR") = strIP Then strServer = RecordSetEmail.Fields("strServer").Value
RecordSetEmail.MoveNext
Loop
End If
Set RecordSetEmail = Nothing
If strServer = "" Then
strServer = "NOT SENT"
sendLater = "True"
End If
If sendLater = "True" Then strServer = "NOT SENT"
On Error Resume Next
If sendLater = "True" Then
Err.Number = 99
Err.Description = "Send Later"
Else
htmlFlag = "0"
set objMail = Server.CreateObject("JMail.SMTPMail")
If sendHTML = "True" Then
objMail.ContentType = "text/html"
htmlFlag = "1"
End If
objMail.AddRecipient strRecipientAddress
objMail.Sender = strSenderAddress
objMail.SenderName = strSenderName
objMail.Subject = strSubject
objMail.Body = strMessage
objMail.Execute
Set objMail = Nothing
End If
bitFailureDetected = "0"
If Err.Number <> 0 Then
Set RecordSetEmail = Server.CreateObject("ADODB.Recordset")
SQLStatementEmail = "clients.cl_ClientsEmailInsertEmailError ('" & CID & "', '" & strRecipientAddress & "', '" & ToSQL(strRecipientName) & "', '" & ToSQL(strSenderName) & "', '" & strSenderAddress & "', '" & ToSQL(strMessage) & "', '" & ToSQL(strSubject) & "', '" & strScript & "', '" & Err.Description & "', '" & Err.Number & "', '" & htmlFlag & "')"
bitFailureDetected = "1"
RecordSetEmail.Open SQLStatementEmail, DBConnectionEmail, 3, 3
Set RecordSetEmail=Nothing
If sendLater <> "True" Then
set objMail = Server.CreateObject("JMail.SMTPMail")
objMail.AddRecipient "jligda@ideasinmotion.com"
objMail.Sender = "script@steadyserve.net"
objMail.SenderName = "ASP SEND SCRIPT"
objMail.Subject = "EMAIL SEND ERROR"
objMail.Body = "Mailto: " & strRecipientAddress & vbCRLF & "To Name: " & strRecipientName & vbCRLF & "Mailfrom: " & strSenderAddress & vbCRLF & "From Name: " & strSenderName & vbCRLF & "Subject: " & strSubject & vbCRLF & "Message: " & strMessage & vbCRLF & vbCRLF & Err.Description
objMail.Execute
Set objMail = Nothing
End If
Err.Number = 0
End If
Set RecordSetEmail = Server.CreateObject("ADODB.Recordset")
SQLStatementEmail = "clients.cl_ClientsEmailSaveSendMail ('" & CID & "', '" & strSenderAddress & "', '', '" & ToSQL(strSenderName) & "', '" & ToSQL(strMessage) & "', '" & ToSQL(strSubject) & "', '" & strSiteURL & "', '" & strRecipientAddress & "', '" & ToSQL(strRecipientName) & "', '" & bitFailureDetected & "', '" & htmlFlag & "', '" & strServer & "', '" & strTemplateFile & "')"
RecordSetEmail.Open SQLStatementEmail, DBConnectionEmail, 3, 3
Set RecordSetEmail = Nothing
If err.number <> 0 Then
strErrorNumber = err.number
strErrorDescription = Err.Description
strErrorSource = Err.Source
strScript = "Function sendEmail"
strScriptProcess = "Function sendEmail"
SQLStatementEmail = "clients.al_AllAddScriptError ('" & CID & "', '" & strScript & "', '" & strErrorNumber & "', '" & strErrorSource & "', '" & ToSQL(Replace(Replace(strErrorDescription,")","]"),"(","[")) & "', '" & ToSQL(Replace(Replace(SQLStatementEmail,")","]"),"(","[")) & "', '" & intLineNumber & "', '" & ToSQL(Replace(Replace(strScriptProcess,")","]"),"(","[")) & "', '" & strOtherInfo & "', '" & Request.ServerVariables("LOCAL_ADDR") & "')"
Set RecordSetEmail = Server.CreateObject("ADODB.Recordset")
RecordSetEmail.Open SQLStatementEmail, DBConnectionEmail, 3, 3
Set RecordSetEmail = Nothing
err.number = 0
End If
DBConnectionEmail.Close
Set DBConnectionEmail = Nothing
' strRecipientAddress =
' strRecipientName =
' strSenderAddress =
' strSenderName =
' strSubject =
' strMessage =
' Call sendEmail(strRecipientAddress, strRecipientName, strSenderAddress, strSenderName, strSubject, strMessage)
End Function
Function processErrors(intLineNumber, strScriptProcess, strOtherInfo, errorNumber, errorDesc, errorSource)
strErrorNumber = errorNumber
strErrorDescription = errorDesc
strErrorSource = errorSource
DBConnectionError = Application("cl_ConnectionString")
Set DBConnectionError = Server.CreateObject("ADODB.Connection")
DBConnectionError.open DBConnectionError
strErrorMessage = "CID = " & CID & vbCRLF & "Script = " & strScript & vbCRLF & "Error Number = " & strErrorNumber & vbCRLF & "ErrorSource = " & strErrorSource & vbCRLF & "Error Description = " & strErrorDescription & vbCRLF & "SQLStatement = " & Replace(Replace(SQLStatement,")",""),"(","") & vbCRLF & "Approx Line = " & intLineNumber & vbCRLF & "Process = " & strScriptProcess & vbCRLF & "Other Info = " & strOtherInfo
set objMail = Server.CreateObject("JMail.SMTPMail")
objMail.AddRecipient "error@steadyserve.net"
objMail.Sender = "script@steadyserve.net"
objMail.SenderName = "FORM SCRIPT"
objMail.Subject = "SCRIPT ERROR"
objMail.Body = strErrorMessage
objMail.Execute
Set objMail = Nothing
SQLStatement = "clients.al_AllAddScriptError ('" & CID & "', '" & strScript & "', '" & strErrorNumber & "', '" & strErrorSource & "', '" & ToSQL(Replace(Replace(strErrorDescription,")","]"),"(","[")) & "', '" & ToSQL(Replace(Replace(SQLStatementEmail,")","]"),"(","[")) & "', '" & intLineNumber & "', '" & ToSQL(Replace(Replace(strScriptProcess,")","]"),"(","[")) & "', '" & strOtherInfo & "', '" & Request.ServerVariables("LOCAL_ADDR") & "')"
Set RecordSetError = Server.CreateObject("ADODB.Recordset")
RecordSetError.Open SQLStatement, DBConnection, 3, 3
Set RecordSetError = Nothing
DBConnectionError.Close
Set DBConnectionError = Nothing
processErrors = "True"
End Function
Function TitleCase(strString)
TitleCase = Trim(strString)
If TitleCase <> "" Then
If UCase(TitleCase) = TitleCase Or LCase(TitleCase) = TitleCase Then
TitleCase = LCase(TitleCase)
End If
TClength = Len(TitleCase)
TitleCase = UCase(Left(TitleCase,1)) & Right(TitleCase,TClength-1)
For pass = 1 to TClength
If Mid(TitleCase, pass, 1) = Chr(32) Then
TitleCase = Left(TitleCase, pass-1) & Chr(32) & UCase(Mid(TitleCase, pass+1, 1)) & Right(TitleCase, TClength-pass-1)
End If
Next
End If
End Function
Function IsPhone(thePhone)
IsPhone = "True"
If Left(thePhone,1) <> "(" Then IsPhone = "False"
If Mid(thePhone,5,2) <> ") " Then IsPhone = "False"
If Mid(thePhone,10,1) <> "-" Then IsPhone = "False"
If Len(thePhone) <> 14 Then IsPhone = "False"
End Function
Function IsEmail(theEmail)
IsEmail = "False"
For intPassLetter = 1 to Len(theEmail)
If Mid(theEmail,intPassLetter,1) = "@" Then
IsEmail = "True"
End If
Next
If IsEmail = "True" Then
IsEmail = "False"
For intPassLetter = 1 to Len(theEmail)
If Mid(theEmail,intPassLetter,1) = "." Then
IsEmail = "True"
End If
Next
End If
If IsEmail = "True" Then
If Left(theEmail,1) = "@" Then IsEmail = "False"
If Right(theEmail,1) = "@" Then IsEmail = "False"
If Left(theEmail,1) = "." Then IsEmail = "False"
If Right(theEmail,1) = "." Then IsEmail = "False"
End If
End Function
Function IsZip(theZip)
IsZip = "False"
If Len(theZip) > 5 Then
If Len(theZip) = 10 Then
If IsNumeric(Right(theZip,4)) Then IsZip = "True"
If Mid(theZip,6,1) <> "-" Then IsZip = "False"
End If
Else
If Len(theZip) = 5 Then
If IsNumeric(Left(theZip,5)) Then IsZip = "True"
End If
End If
End Function
Function convertLinks(strArticle)
strArticle = Replace(Replace(Replace(strArticle,"link:http://",""),":here","")
theCount = Len(strArticle)
ReDim aryLinks(theCount)
For theLoop = 1 to Len(strArticle)-7
If Mid(strArticle,theLoop,7) = "http://" Or Mid(strArticle,theLoop,7) = "mailto:" Then
theEnd = 99999
findEnd = (Len(strArticle)-theLoop)+1
strArticlePostLink = Right(strArticle,findEnd)
theCheck = InStr(strArticlePostLink,"<")
If theCheck > 0 Then theEnd = theCheck
theSpace = InStr(strArticlePostLink," ")
If theSpace > 0 And theSpace < theEnd Then theEnd = theSpace
If theSpace < theEnd Then theEnd = theSpace
If theEnd = 0 Then
theLink = strArticlePostLink
Else
theLink = Left(strArticlePostLink,theEnd)
End If
If Right(theLink,1) = "." Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "," Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "<" Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = " " Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "?" Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "!" Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = ")" Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "," Then theLink = Trim(Left(theLink,Len(theLink)-1))
If Right(theLink,1) = "." Then theLink = Trim(Left(theLink,Len(theLink)-1))
aryLinks(theLoop) = theLink
End If
Next
For theLoop = 1 to theCount
If InStr(aryLinks(theLoop),"mailto:") > 0 Then
If aryLinks(theLoop) <> "" Then strArticle = Replace(strArticle,aryLinks(theLoop),"" & Replace(aryLinks(theLoop),"mailto:","") & "")
Else
If aryLinks(theLoop) <> "" Then strArticle = Replace(strArticle,aryLinks(theLoop),"" & Replace(aryLinks(theLoop),"http://","") & "")
End If
Next
strArticle = Trim(strArticle)
Do While LCase(Right(strArticle,4)) = "
"
strArticle = Left(strArticle,Len(strArticle)-4)
strArticle = Trim(strArticle)
Do While LCase(Right(strArticle,6)) = " "
strArticle = Left(strArticle,Len(strArticle)-6)
strArticle = Trim(strArticle)
Loop
Loop
strArticle = Replace(strArticle,"mailto***","mailto:")
convertLinks = Replace(strArticle,"http***","http://")
End Function
Sub SelectList(DBConnectString,SQLStatement,formSelect,indexKey,selectWhat,strName,strKey,strAlt)
Set DBConnection = Server.CreateObject("ADODB.Connection")
DBConnection.open DBConnectString
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.EOF Then
RecordSet.MoveFirst
Response.Write ""
Else
If strAlt = "" Then strAlt = " "
Response.Write strAlt
End If
Set RecordSet = Nothing
DBConnection.Close
Set DBConnection = Nothing
End Sub
Function encodeURL(strURL)
encodeURL = Replace(strURL,"%","%25")
encodeURL = Replace(encodeURL,"?","%3F")
encodeURL = Replace(encodeURL,".","%2E")
encodeURL = Replace(encodeURL,":","%3A")
encodeURL = Replace(encodeURL,"/","%2F")
encodeURL = Replace(encodeURL,"$","%24")
encodeURL = Replace(encodeURL,"&","%26")
encodeURL = Replace(encodeURL,"<","%3C")
encodeURL = Replace(encodeURL,">","%3E")
encodeURL = Replace(encodeURL,";","%3B")
encodeURL = Replace(encodeURL,"#","%23")
encodeURL = Replace(encodeURL,",","%2C")
encodeURL = Replace(encodeURL,Chr(34),"%22")
encodeURL = Replace(encodeURL,"'","%27")
encodeURL = Replace(encodeURL,"~","%7E")
encodeURL = Replace(encodeURL,"+","%2B")
encodeURL = Replace(encodeURL,"(","%28")
encodeURL = Replace(encodeURL,")","%29")
encodeURL = Replace(encodeURL,"{","%7B")
encodeURL = Replace(encodeURL,"}","%7D")
encodeURL = Replace(encodeURL,"\","%5C")
encodeURL = Replace(encodeURL,"=","%3D")
encodeURL = Replace(encodeURL," ","%20")
End Function
Function decodeURL(strURL)
decodeURL = Replace(strURL,"%26","&")
decodeURL = Replace(decodeURL,"%20"," ")
decodeURL = Replace(decodeURL,"%3C","<")
decodeURL = Replace(decodeURL,"%3E",">")
decodeURL = Replace(decodeURL,"%3F","?")
decodeURL = Replace(decodeURL,"%3B",";")
decodeURL = Replace(decodeURL,"%23","#")
decodeURL = Replace(decodeURL,"%3A",":")
decodeURL = Replace(decodeURL,"%3D","=")
decodeURL = Replace(decodeURL,"%2C",",")
decodeURL = Replace(decodeURL,"%22",Chr(34))
decodeURL = Replace(decodeURL,"%27","'")
decodeURL = Replace(decodeURL,"%7E","~")
decodeURL = Replace(decodeURL,"%2B","+")
decodeURL = Replace(decodeURL,"%28","(")
decodeURL = Replace(decodeURL,"%29",")")
decodeURL = Replace(decodeURL,"%7B","{")
decodeURL = Replace(decodeURL,"%7D","}")
decodeURL = Replace(decodeURL,"%2F","/")
decodeURL = Replace(decodeURL,"%5C","\")
decodeURL = Replace(decodeURL,"%2E",".")
decodeURL = Replace(decodeURL,"%24","$")
decodeURL = Replace(decodeURL,"%25","%")
End Function
Function getRowColor(strCurrentColor,strRowOneColor,strRowTwoColor)
If strCurrentColor = strRowOneColor Then
getRowColor = strRowTwoColor
Else
getRowColor = strRowOneColor
End If
End Function
Sub addToEmailingList(strEmailAddress,strFullName,strClientEmail,strClient,CID)
yesConfirm = 0 'This feature is not ready yet. When it is this line of code can be removed.
If strEmailAddress <> "" Then
If yesConfirm = 1 Then
' Generates a random confirmation number
Randomize
Pass = 0
strConfirmEmail = ""
Length = 20
Do Until Pass = Length
intRandNum = int(rnd*87)+35
If (intRandNum <= 57 And intRandNum >= 48) Or (intRandNum <= 90 And intRandNum >= 65) Or (intRandNum <= 122 And intRandNum >= 97) Then
Pass = Pass + 1
strConfirmEmail = strConfirmEmail & Chr(intRandNum)
End If
Loop
' Send confirmation e-mail
strConfirmOne = Request.Form("ConfirmOne")
strConfirmTwo = Request.Form("ConfirmTwo")
htmlConfirmSalutation = Request.Form("ConfirmSalutation")
If strConfirmOne = "" Then
strConfirmOne = "Welcome to " & strClient & "'s email list. Please confirm your email address by clicking on, or cutting & pasting in your browser's address bar the link below:"
Else
strConfirmOne = Replace(strConfirmOne,"
",vbCRLF)
End If
If strConfirmTwo = "" Then
strConfirmTwo = "If you did not sign up for " & strClient & "'s emailing list, no worries. No action is needed. Without confirming this email address the record will be dropped from the database."
Else
strConfirmTwo = Replace(strConfirmTwo,"
",vbCRLF)
End If
If strConfirmSalutation = "" Then strConfirmSalutation = "Sincerely"
strConfirmSubject = "Please Confirm Your Email Address"
strSendMessage = strConfirmOne & vbCRLF & vbCRLF & "http://" & strSiteURL & "/confirmemail.asp?number=" & strConfirmEmail & vbCRLF & vbCRLF & strConfirmTwo
If htmlConfirmSalutation = "NONE" Then
strSendMessage = strSendMessage & vbCRLF & vbCRLF & strClient
ElseIf htmlConfirmSalutation = "NOSIGNATURE" Then
strSendMessage = strSendMessage
End If
strRecipientName = ""
Call sendEmail(strEmailAddress, strRecipientName, strClientEmail, strClient, strConfirmSubject, strSendMessage)
End If
strFirstName = firstName(strFullName)
strLastName = lastName(strFullName)
DBConnectionStringAdd = Application("cl_ConnectionString")
Set DBConnectionAdd = Server.CreateObject("ADODB.Connection")
DBConnectionAdd.open DBConnectionStringAdd
Set RecordSetAdd = Server.CreateObject("ADODB.Recordset")
SQLStatementAdd = "clients.cl_ClientsEmailAddToMailingList ('" & CID & "', '" & strEmailAddress & "', '" & strFirstName & "', '" & strLastName & "', '" & strSiteURL & "', '" & strConfirmEmail & "', '', '0', '" & strMailingList & "')"
RecordSetAdd.Open SQLStatementAdd, DBConnectionAdd, 3, 3
Set RecordSetAdd = Nothing
DBConnectionAdd.Close
Set DBConnectionAdd = Nothing
End If
End Sub
Sub sendTemplateEmailTemplate(strTemplateFile,strContent,strToName,strToEmail,strFromName,strFromEmail,strTemplateSubject)
strToNameFind = strToName
strToFirstName = firstName(strToNameFind)
strToLastName = lastName(strToNameFind)
strFromNameFind = strFromName
strFromFirstName = firstName(strFromNameFind)
strFromLastName = lastName(strFromNameFind)
strContentHTML = strContent
htmlFlag = "1"
strContentHTML = Replace(strContentHTML,"[TO_FIRST_NAME]",strToFirstName)
strContentHTML = Replace(strContentHTML,"[TO_LAST_NAME]",strToLastName)
strContentHTML = Replace(strContentHTML,"[TO_NAME]",strToName)
strContentHTML = Replace(strContentHTML,"[TO_EMAIL]",strToEmail)
strContentHTML = Replace(strContentHTML,"[FROM_FIRST_NAME]",strFromFirstName)
strContentHTML = Replace(strContentHTML,"[FROM_LAST_NAME]",strFromLastName)
strContentHTML = Replace(strContentHTML,"[FROM_NAME]",strFromName)
strContentHTML = Replace(strContentHTML,"[FROM_EMAIL]",strFromEmail)
Call sendEmail(strToEmail, strToName, strFromEmail, strFromName, strTemplateSubject, strContentHTML)
End Sub
' Version changes
' 2.47 - May. 2007: Added HTML flag to sendTemplateEmailTemplate.
' 2.46 - May. 2007: Fixed bug in firstName and lastName functions.
' 2.45 - Apr. 2007: Fixed bug in generate password function.
' 2.44 - Apr. 2007: Added the strTemplateFile to the sendEmail function so send emails can use an HTML template. This cuts back on the number of character stored in the database.
' 2.44 - Apr. 2007: Added send template HTML function
' 2.43 - Jan. 2007: Added space in stip tags function
' 2.42 - Dec. 2006: Added to and from SQL 2 functions for HTML
' 2.41 - Oct. 2006: Added firstName and lastName functions
' 2.40 - Oct. 2006: Added add to email list sub routine. Sub routine is not finished completely as it does not have the confirm email address feature functioning at this time
' 2.30 - Oct. 2006: Added encode and decode URL functions
' 2.25 - Oct. 2006: Added select list sub routine
' 2.20 - Oct. 2006: Added row color function
' 2.10 - Oct. 2006: Added link convert function
%>
<%
DBConnectString="$hostname="p50mysql55.secureserver.net";$db_name="BigLazyMall";$db_username="BigLazyMall";$db_password="Kyle8988";"
Sub SelectListSpecial(DBConnectString,SQLStatement,formSelect,indexKey,selectWhat,strName,strKey,strAlt)
Set DBConnection = Server.CreateObject("ADODB.Connection")
DBConnection.open DBConnectString
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.EOF Then
RecordSet.MoveFirst
Response.Write ""
Else
If strAlt = "" Then strAlt = " "
Response.Write strAlt
End If
Set RecordSet = Nothing
DBConnection.Close
Set DBConnection = Nothing
End Sub
%>
<%
DBConnectString = Application("cl_ConnectionString")
Set DBConnection = Server.CreateObject("ADODB.Connection")
DBConnection.open DBConnectString
'Gets client information per website address. This prevents script from being executed on other websites and protects the client information.
strSiteURL = Replace(Request.ServerVariables("HTTP_HOST"),"test.","www.")
If InStr(strSiteURL,".steadyserve.") Or strSiteURL = "192.168.1.45" Then
If strSiteURL = "192.168.1.45" Or strSiteURL = "library.steadyserve.net" Then Session("authUser") = 1
strSiteURL = "www.steadyserve.net"
End If
SQLStatement = "clients.cl_ClientsGetClientInfoPerURL ('" & strSiteURL & "')"
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.Eof Then
RecordSet.MoveFirst
CID = Trim(RecordSet.Fields("CID").Value)
strClient = Trim(RecordSet.Fields("strClient").Value)
SendEmailTo = Trim(RecordSet.Fields("strClientEmail").Value)
End If
Set RecordSet = Nothing
CAAIDMax = 0
SQLStatement = "clients.cl_ClientsAdminAreasSelectList"
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.Eof Then
RecordSet.MoveFirst
Do While Not RecordSet.EOF
CAAID = Trim(RecordSet.Fields("CAAID").Value)
If Cint(CAAIDMax) < Cint(CAAID) Then CAAIDMax = CAAID
RecordSet.MoveNext
Loop
End If
Set RecordSet = Nothing
Dim aryCAAID()
Redim aryCAAID(CAAIDMax)
For theLoop = 1 to CAAIDMax
aryCAAID(theLoop) = "False"
Next
SQLStatement = "clients.cl_ClientsAdminAreasSelectListPerCID ('" & CID & "')"
Set RecordSet = Server.CreateObject("ADODB.Recordset")
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.Eof Then
RecordSet.MoveFirst
Do While Not RecordSet.EOF
CAAID = Trim(RecordSet.Fields("CAAID").Value)
aryCAAID(CAAID) = "True"
RecordSet.MoveNext
Loop
End If
Set RecordSet = Nothing
DBConnection.Close
Set DBConnection = Nothing
MBID = Session("MBID")
If MBID <> "" Then
DBConnectString = Application("blm_ConnectionString")
Set DBConnection = Server.CreateObject("ADODB.Connection")
DBConnection.open DBConnectString
Set RecordSet = Server.CreateObject("ADODB.Recordset")
SQLStatement = "biglazymall.blm_MembersSelectPerMBID ('" & MBID & "')"
RecordSet.Open SQLStatement, DBConnection, 3, 3
If Not RecordSet.EOF Then
RecordSet.MoveFirst
strEmailMemberAddress= Trim(RecordSet.Fields("strEmailAddress").Value)
End If
Set RecordSet = Nothing
DBConnection.Close
Set DBConnection = Nothing
End If
If strEmailMemberAddress = "" Then
htmlLogin = "
LOGIN Email Address: Password:
" Else If Len(strEmailMemberAddress) > 25 Then strEmailMemberAddress = Left(strEmailMemberAddress,20) & " ..." htmlLogin = "You are logged in as " & strEmailMemberAddress & ". If this is not you Click Here
" End If %> //Enter Your Site Name $sitename="www.biglazymall.com"; // -------- START EDITABLE SECTION ----------------- /*$hostname="p50mysql55.secureserver.net"; $db_name="BigLazyMall"; $db_username="BigLazyMall"; $db_password="Kyle8988";*/ $hostname="p50mysql55.secureserver.net"; $db_name="BigLazyMall"; $db_username="BigLazyMall"; $db_password="Kyle8988"; // -------- END EDITABLE SECTION ----------------- //------------ NOT TO EDIT ------------------------- $con=mysql_connect($hostname,$db_username,$db_password) or die ("could not connect the server"); $db=mysql_select_db($db_name,$con) or die("could not select the database"); ?>| <%If InStr(Request.ServerVariables("URL"),"storefront") > 0 Then searchWhat = "stores"%> | ||||
|
|
|||