#TOKEN-sNameShort# attends:
"
sVenues = sVenues & "" & rsCourtHouse("sName") & "
"
sVenues = sVenues & "(" & rsCourtHouse("sNameShort") & ")
"
sVenues = sVenues & "" & rsCourtHouse("sAddress1") & "
"
sVenues = sVenues & "" & rsCourtHouse("sCity") & ", Ontario, " & rsCourtHouse("sPostal") & "
"
If Numeric( rsCourtHouse("sPhone1") ) > 0 Then
'' sVenues = sVenues & "P: " & rsCourtHouse("sPhone1") & "
"
End If
If Numeric( rsCourtHouse("sPhone2") ) > 0 Then
'' sVenues = sVenues & "P: " & rsCourtHouse("sPhone2") & "
"
End If
If Numeric( rsCourtHouse("sPhoneFax") ) > 0 Then
'' sVenues = sVenues & "F: " & rsCourtHouse("sPhoneFax") & "
"
End If
sVenues = sVenues & "
Information is coming soon.
", "'", Chr( 34 ) ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, "'", Chr( 34 ) ) Else 'CleanAndFormatHTML = Replace( Replace( CleanAndFormatHTML, ". ", ". " ), ". ", ". " ) CleanAndFormatHTML = RegularExpression( CleanAndFormatHTML, "([.!?]) (\b[A-Z])", "$1 $2") 'Double space between sentences. CleanAndFormatHTML = Replace( CleanAndFormatHTML, "v. ", "v. " ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, " v. ", " v. " ) 'CleanAndFormatHTML = Replace( CleanAndFormatHTML, "? ", "? " ) '' CleanAndFormatHTML = Replace( CleanAndFormatHTML, "! ", "! " ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, "/admin/tel:", "tel:" ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, " class='MsoNormal'", "" ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, " ", "") aTemp = Split("289- 416- 647- 705- 800- 905-") For iLoop = 0 To UBound( aTemp ) aTemp( iLoop ) = Numeric( aTemp( iLoop ) ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, aTemp( iLoop ) & "-", "(" & aTemp( iLoop ) & ") ") Next CleanAndFormatHTML = Replace( CleanAndFormatHTML, "0pm", "0PM") CleanAndFormatHTML = Replace( CleanAndFormatHTML, "0am", "0AM") Do Until InStr( CleanAndFormatHTML, "Youtube movie:" ) = 0 iTemp1 = InStr( CleanAndFormatHTML, "Youtube movie:") - 1 iTemp2 = InStr( iTemp1, CleanAndFormatHTML, "" ) CleanAndFormatHTML = Left( CleanAndFormatHTML, iTemp1 ) & Mid( CleanAndFormatHTML, iTemp2, 1048576 ) Loop CleanAndFormatHTML = Replace( CleanAndFormatHTML, "Default preview for : Iframe", "" ) CleanAndFormatHTML = Replace( CleanAndFormatHTML, "Default preview for : Video", " " ) aTemp = Split("-xs -sm -lg -1x -2x -3x -4x -5x -6x -7x -10x") For iLoop = 0 To UBound( aTemp) CleanAndFormatHTML = Replace( CleanAndFormatHTML, "fa" & aTemp( iLoop ) & Chr( 34 ) & " />", "fa" & aTemp( iLoop ) & Chr( 34 ) & ">" ) Next CleanAndFormatHTML = Replace( CleanAndFormatHTML, "", "") End If End Function Function TextDoubleSpace( ByVal sText ) Dim oRegEx Set oRegEx = New RegExp oRegEx.Pattern = "([.!?]) ([A-Z])" oRegEx.IgnoreCase = False oRegEx.Global = True TextDoubleSpace = oRegEx.Replace( sText, "$1 $2" ) Destroy( oRegEx ) End Function 'Added 2022-02-01 Private Function ClioGrowInbox( sName, sEmail, sMessage, sPhone, sURLReferring, sSource, sClioGrowInboxKey ) On Error Resume Next 'Just in case the Clio account has any issue that we cannot control aName = Split( sName ) sNameFirst = aName( 0 ) sNameLast = aName( 1 ) Set jsonClioLead = Server.CreateObject("Chilkat_9_5_0.JsonObject") iIndex = -1 'An index value of -1 is used to append at the end. bSuccess = jsonClioLead.AddStringAt( iIndex, "from_first", sNameFirst ) bSuccess = jsonClioLead.AddStringAt( iIndex, "from_last", sNameLast ) bSuccess = jsonClioLead.AddStringAt( iIndex, "from_message", sMessage ) bSuccess = jsonClioLead.AddStringAt( iIndex, "from_email", sEmail ) bSuccess = jsonClioLead.AddStringAt( iIndex, "from_phone", sPhone ) bSuccess = jsonClioLead.AddStringAt( iIndex, "referring_url", sURLReferring ) bSuccess = jsonClioLead.AddStringAt( iIndex, "from_source", sSource ) Set jsonClioGrow = Server.CreateObject("Chilkat_9_5_0.JsonObject") bSuccess = jsonClioGrow.AddObjectAt( iIndex, "inbox_lead" ) Set jsonInfo = jsonClioGrow.ObjectOf("inbox_lead") bSuccess = jsonInfo.Load( jsonClioLead.Emit() ) bSuccess = jsonClioGrow.AddStringAt( iIndex, "inbox_lead_token", sClioGrowInboxKey ) jsonClioGrow.EmitCompact = 1 Set oHTTP = Server.CreateObject("Chilkat_9_5_0.Http") oHTTP.Accept = "application/json" sURLPost = "https://grow.clio.com/inbox_leads" Set oRESP = oHTTP.PostJson2( sURLPost, "application/json", jsonClioGrow.Emit() ) If ( oHTTP.LastMethodSuccess = 0 ) Then 'An Error Occured sError = Server.HTMLEncode( oHTTP.LastErrorText ) End If ClioGrowInbox = oRESP.StatusCode & " " & sError Destroy( oRESP ) Destroy( oHTTP ) Destroy( jsonInfo ) Destroy( jsonClioGrow ) Destroy( jsonClioLead ) On Error Goto 0 End Function Function Connection() Set Connection = Server.CreateObject("ADODB.Connection") 'Connection.Open "Driver={SQL Server};Server=tcp:wmc-sql-1.database.windows.net,1433;Database=_Marketing.legal;Uid=Steve;Pwd=PNuw38UtXKmZGCCv;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=15;" Connection.Open "Driver={SQL Server};Server=tcp:wmc-sql-1-ca.database.windows.net,1433;Database=_Marketing.legal;Uid=Steve;Pwd=PNuw38UtXKmZGCCv;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=15;" End Function Function ConnectionLong( iSeconds ) iSeconds = 300 Set ConnectionLong = Server.CreateObject("ADODB.Connection") 'ConnectionLong.Open "Driver={SQL Server};Server=tcp:wmc-sql-1.database.windows.net,1433;Database=_Marketing.legal;Uid=Steve;Pwd=PNuw38UtXKmZGCCv;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=" & iSeconds & ";" ConnectionLong.Open "Driver={SQL Server};Server=tcp:wmc-sql-1-ca.database.windows.net,1433;Database=_Marketing.legal;Uid=Steve;Pwd=PNuw38UtXKmZGCCv;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=" & iSeconds & ";" End Function Private Function CookieDel( sName ) CookieDelete( sName ) End Function Private Function CookieDelete( sName ) Response.Cookies( sName ).Expires = DateAdd("YYYY", -10, Now ) End Function Private Function CookieRemove( sName ) CookieDelete( sName ) End Function Private Function CookieGet( sName ) CookieGet = Request.Cookies( sName ) End Function Private Function CookieSet( sName, sValue, sExpires ) Response.Cookies( sName ) = sValue If IsDate( sExpires ) = True Then sExpires = CDate( sExpires ) Else sExpires = DateAdd("H", 1, Now ) End If Response.Cookies( sName ).Expires = sExpires End Function Private Function CopyFile( sPathFrom, sPathTo ) On Error Resume Next Set oASPUpload = Server.CreateObject("Persits.Upload.1") oASPUpload.MoveFile MapPath( sPathFrom ), MapPath( sPathTo ) Destroy( oASPUpload ) CopyFile = Err.Number & "|" & Err.Description End Function Private Function CreateAccount( sKey, bAdmin, iType, sEmail, sPassword, sName, sPhone ) 'LEGACY AS OF JANUARY 2 2022, NEW TO RECODE THIS TO WORK WITH THE NEW AccountUserCreate() If Len( sKey & "" ) < 15 Then sKey = Key( 15 ) End If If IsEmail( sEmail ) = True AND Len( Alpha( sName ) ) > 5 Then sSQL = "SELECT TOP 1 tblAccounts.* FROM tblAccounts WHERE sEmail LIKE '" & sEmail & "'" Set rsAccount = CreateObject("ADODB.RecordSet") rsAccount.CursorLocation = adUseClient rsAccount.Open sSQL, Connection, adOpenStatic, adLockOptimistic, adCmdText If rsAccount.EOF = True Then rsAccount.AddNew rsAccount("sKey") = sKey rsAccount("bAdmin") = Numeric( bAdmin ) rsAccount("iType") = Numeric( iType ) rsAccount("sEmail") = sEmail rsAccount("sName") = Trim( AlphaNumericSpace( sName ) ) rsAccount("sPhone") = Phone( sPhone ) If Len( sPassword ) < 8 Then rsAccount("sPassword") = Key( 10 ) End If rsAccount.Update 'EmailWelcome( CreateAccount ) End If End If CreateAccount = sKey Destroy( rsAccount ) End Function Private Function CreateDirectory( sPath ) 'IF ERRORS OCCUR, ENSURE THAT THE RESPECTIVE APP POOL HAS 32BIT APPLICATIONS ENABLED - Persits is 32Bit On Error Resume Next Set oASPUpload = Server.CreateObject("Persits.Upload.1") oASPUpload.CreateDirectory MapPath( sPath ), True Destroy( oASPUpload ) End Function Private Function DateString( sDate, bMonthShort ) DateString = Empty If IsDate( sDate ) = True Then DateString = MonthName( Month( sDate ), CBool( bMonthShort ) ) & " " & Right( "0" & Day( sDate ), 2 ) & " " & Year( sDate ) End If End Function Private Function DateTime( dDateTime ) 'CAUTION FormatDateTime IS A VBSCRIPT RESERVED WORD/SYNTAX, DateTime = Empty If IsDate( dDateTime ) = True Then DateTime = Year( dDateTime ) & "/" & Right( "0" & Month( dDateTime ), 2 ) & "/" & Right( "0" & Day( dDateTime ), 2 ) & " " & TwelveHourClock( dDateTime ) End If End Function Function FormatDateField( ByVal dDate, ByVal jsonData ) FormatDateField = Empty If IsDate( dDate ) Then FormatDateField = Year( dDate ) & "-" & Right( "0" & Month( dDate ), 2 ) & "-" & Right( "0" & Day( dDate ), 2 ) End If End Function Private Function DeleteDirectory( sPath ) On Error Resume Next Set oFSO = CreateObject("Scripting.FileSystemObject") oFSO.DeleteFolder( MapPath( sPath ) ) On Error Goto 0 Destroy( oFSO ) End Function Function Destroy( oRS ) On Error Resume Next oRS.Close Set oRS = Nothing End Function Private Function DistinctTerms( sString, sDelimiter ) sString = Trim( sString ) Set oDict = Server.CreateObject("Scripting.Dictionary") oDict.CompareMode = vbTextCompare For Each sTerm In Split( sString, sDelimiter ) oDict( sTerm ) = Null Next DistinctTerms = Join( oDict.Keys, sDelimiter ) Destroy( oDict ) End Function Private Function DomainAvailability( sDomain ) sTemp = Scrape("https://domain-availability.whoisxmlapi.com/api/v1?apiKey=at_Bb5uTVqL9LOs04NBEb6gUlxUwRfS1&domainName=" & sDomain & "&credits=DA") DomainAvailability = NOT CBool( InStr( sTemp, "UNAVAILABLE") ) End Function Private Function Email( sTo, sFrom, sSubject, sMessage ) sMessage = Replace( sMessage & "", "&vbCrLf;", "" & sMessage & "
" Else sHTML = sHTML & sMessage End If sHTML = sHTML & "This email was securely sent via Gmail, initiated on " & DateTime( Now ) & " from the IP Address: " & ServerVariable("REMOTE_ADDR") & " by a user on the website located at the domain " & Session("sDomain") & "; " sHTML = sHTML & "as is hosted on the Success.Legal | Referrals.Legal professional network and software platform serving all Canadians interacting among the legal community.
" sMessageShell = Scrape("/emails/shell-master.txt") sEmailHTML = Replace( sMessageShell, "#TOKEN-CONTENT#", sHTML ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sDomain#", Session("sDomain") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sName#", AppVar("sName") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sNameShort#", AppVar("sNameShort") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sButtonLogin#", "Login to " & AppVar("sNameShort") & "" ) sEmailHTML = Replace( Replace( sEmailHTML, "'", "'"), "’", "'") sEmailHTML = Replace( sEmailHTML, "#TOKEN-bg-primary#", AppVar("sColorPrimary") ) .HTMLBody = sEmailHTML .Sender = AppVar("sName") .Organization = AppVar("sName") .ReplyTo = sFrom End With Set oEmail.Configuration = oConf On Error Resume Next 'Fuck it, if GMail rejects, don't crash. oEmail.Send On Error Goto 0 Destroy( oEmail ) Destroy( oConf ) Destroy( oFlds ) End Function Private Function EmailViaMailGun( sTo, sFrom, sSubject, sMessage, aFileAttachments ) sSubject = Replace( NoHTML( sSubject ), "’", "'") sHTML = sMessage If InStr( sMessage, "<") = 0 Then sHTML = sHTML & "" & sMessage & "
" End If sHTML = sHTML & "This email was securely sent via MailGun, initiated on " & DateTime( Now ) & " from the IP Address: " & ServerVariable("REMOTE_ADDR") & " by a user on the " & AppVar("sNameShort") & " website; " sHTML = sHTML & "hosted on the Success.Legal ecosystem, serving Canadians interacting among the legal community.
" sMessageShell = Scrape("/emails/shell-master.txt") sEmailHTML = Replace( sMessageShell, "#TOKEN-CONTENT#", sHTML ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sDomain#", Session("sDomain") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sName#", AppVar("sName") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sNameShort#", AppVar("sNameShort") ) sEmailHTML = Replace( sEmailHTML, "#TOKEN-sButtonLogin#", "Login to " & AppVar("sNameShort") & "" ) sEmailHTML = Replace( Replace( sEmailHTML, "'", "'"), "’", "'") sEmailHTML = Replace( sEmailHTML, "#TOKEN-bg-primary#", AppVar("sColorPrimary") ) Set oEmail = Server.CreateObject("Chilkat.Email") oEmail.Subject = sSubject oEmail.From = UCase( Session("sDomain") ) & " | " & AppVar("sNameShort") & "" & rsTestimonials("sComment") & "
~ " & rsTestimonials("sAuthor") & "