%
Const SITE_NAME = "Sound Venture Productions"
Const SITE_EMAIL = "maria@soundventure.com"
Const SITE_CC_EMAIL = "info@soundventure.com"
Const SITE_CC2_EMAIL = "office@soundventure.com"
'Const SITE_EMAIL = "denis@bayteksystems.com"
'Const SITE_CC_EMAIL = "dtessier98@hotmail.com"
'Const SITE_CC2_EMAIL = "dtessier98@hotmail.com"
Const SITE_URL = "http://www.soundventure.com/onlinestore/"
Const PAYMENT_URL = "https://www.beanstream.com/scripts/payment/payment.asp"
Const CMS_USR = "admin"
Const CMS_PWD = "tsv001"
Const DATABASE_NAME = "tsv.mdb"
Const DATABASE_USERNAME = ""
Const DATABASE_PASSWORD = ""
Const cSESSION_TIME = 1
Const REQUIRED_TXT = "*"
Const PRODUCT_IMAGE_PATH = "/onlinestore/images/products/"
Const VIDEO_IMAGE_PATH = "/onlinestore/images/videos/"
Const cPRODUCT_ITEMS_PER_PAGE = 4
Const cVIDEO_ITEMS_PER_PAGE = 4
Const cFORMAT_LIST = ""
Const cLANGUAGE_LIST = ""
Const cSIZE_LIST = ""
province_list=""
valid_ext = array(".gif", ".jpg", ".jpeg", ".png", ".GIF", ".JPG", ".JPEG", ".PNG")
'=======================================================================
'
' GENERIC FUNCTIONS
'
'=======================================================================
Function IsObjectInstalled(objName)
On Error Resume Next
Set tmpObj = Server.CreateObject(objName)
If Err.Number = 0 Then
IsObjectInstalled = True
Set tmpObj = Nothing
Else
IsObjectInstalled = False
End If
On Error Goto 0
End Function
Function BuiltList(arrList, numOfDimension, includeEmptyRow)
Dim x
numOfItems = UBound(arrList, numOfDimension)
If includeEmptyRow Then BuiltList = ""
If numOfDimension = 1 Then
For x=0 To numOfItems
BuiltList = BuiltList & ""
Next
Else
For x=0 To numOfItems
BuiltList = BuiltList & ""
Next
End If
End Function
Function getUniqueName()
Dim d
d = Now()
getUniqueName=Year(d) & Month(d) & Day(d) & Hour(d) & Minute(d) & Second(d)
End Function
Sub myError(msg)
Set DB = Nothing
Response.Write "
Error
" & msg & "
" _
& "Back"
Response.End
End Sub
Function GetRandomPassword(intLength)
Randomize()
intPasswordLength = 0
strCurrentPassword = ""
do while intPasswordLength < intLength
chrCurrentLetter = Int((42 * Rnd()) + 48)
if chrCurrentLetter < 57 or chrCurrentLetter > 65 then
strCurrentPassword = strCurrentPassword & Chr(chrCurrentLetter)
intPasswordLength = intPasswordLength + 1
end if
loop
GetRandomPassword = strCurrentPassword
End Function
Sub SendEmail(strSender, strSubject, strContent, recipientName, recipientEmail, AttachmentFile)
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "smtp.thesmarterway.com"
Mail.username="smtp@thesmarterway.com"
Mail.password="smtp"
Mail.From = strSender
Mail.AddAddress recipientEmail, recipientName
If Trim("" & AttachmentFile) <> "" Then Mail.AddAttachment AttachmentFile
Mail.Subject = strSubject
Mail.Body = strContent
Mail.IsHTML = True
strErr = ""
bSuccess = False
On Error Resume Next ' catch errors
Mail.Send ' send message
If Err <> 0 Then ' error occurred
strErr = Err.Description
Response.Write "
Error
" & strErr & "
" _
& "Back"
Response.End
Else
bSuccess = True
End If
Set Mail = Nothing
If Trim("" & AttachmentFile) <> "" Then
Set FileSys = New clsFileSystem
FileSys.DeleteFile(AttachmentFile)
Set FileSys = Nothing
End If
End Sub
Function ResizeImg(strImgPath,intNewHeight)
Set jpeg = Server.CreateObject("Persits.Jpeg")
jpeg.Open(Server.MapPath(LISTING_IMAGE_PATH & strImgPath))
If jpeg.Height > intNewHeight Then
jpeg.Height = intNewHeight
jpeg.Width = jpeg.OriginalWidth * jpeg.Height / jpeg.OriginalHeight
End If
If UCase(Right(strImgPath, 3)) <> "JPG" Then
strOldPath = strImgPath
tmp=Right(fileName,Len(fileName)-InStrRev(fileName,"."))
strImgPath = Replace(strImgPath,tmp,"") & "jpg"
End If
jpeg.Save LCase(Server.MapPath(LISTING_IMAGE_PATH & strImgPath))
Set jpeg = Nothing
If strOldPath <> "" Then
Set FileSys = New clsFileSystem
FileSys.DeleteFile(LISTING_IMAGE_PATH & strOldPath)
Set FileSys = Nothing
End If
ResizeImg=strImgPath
End Function
'====================
'
' Specific Functions
'
'====================
Function GetCategoryList()
GetCategoryList = ""
strQuery = "SELECT id, name FROM tsv_categories ORDER BY ordering ASC, name ASC"
galleryNumOf = DB.RunQuery(strQuery) -1
If galleryNumOf > -1 Then
GalleryData = DB.GetLastResults()
For x = 0 to galleryNumOf
GetCategoryList = GetCategoryList & ""
Next
End If
End Function
Function getCategoryLinks()
intCategoryID = CInt(Request.QueryString("category"))
strQuery = "SELECT id, name FROM tsv_categories ORDER BY ordering ASC, name ASC"
numOf = DB.RunQuery(strQuery) -1
If numOf > -1 Then
LinkData = DB.GetLastResults
getCategoryLinks = getCategoryLinks & ""
For x = 0 To numOf
If intCategoryID = LinkData(0,x) Then
strBackground = " bgcolor=""#FCF4F6"" "
Else
strBackground = " bgcolor=""#FFFFFF"" "
End If
getCategoryLinks = getCategoryLinks & _
"