<% Const SITE_NAME = "The Sound Venture" Const SITE_EMAIL = "info@soundventure.com" Const SITE_URL = "http://www.soundventure.com" 'Const SITE_URL = "http://preview5.thesmarterway.com/" 'Const PAYMENT_URL = "https://www.beanstream.com/scripts/payment/payment.asp" Const CMS_USR = "admin" Const CMS_PWD = "d49fj53k" Const DATABASE_NAME = "tsv.mdb" Const DATABASE_USERNAME = "" Const DATABASE_PASSWORD = "" Const PROGRAM_IMAGE_PATH = "/images/programs/" Const BROADCASTER_IMAGE_PATH = "/images/broadcasters/" Const cPLDefault = "#B6134B" Const cPLID1 = 1 Const cPLCategory1 = "#EBA207" Const cPLCategory1Sub = "#F8F3D3" Const cPLID2 = 2 Const cPLCategory2 = "#57C4ED" Const cPLCategory2Sub = "#DBEFF8" Const cPLID3 = 3 Const cPLCategory3 = "#85AD54" Const cPLCategory3Sub = "#E6F3D7" Const REQUIRED_TXT = "*" Const YES_NO_LIST = "" valid_ext = array(".gif", ".jpg", ".jpeg", ".png", ".GIF", ".JPG", ".JPEG", ".PNG") Function GetLibraryCategoryList() GetLibraryCategoryList = "" strQuery = "SELECT id, name FROM library_categories ORDER BY id" galleryNumOf = DB.RunQuery(strQuery) -1 If galleryNumOf > -1 Then GalleryData = DB.GetLastResults() For x = 0 to galleryNumOf GetLibraryCategoryList = GetLibraryCategoryList & "" Next End If End Function '======================================================================= ' ' 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 Function getPageContent(strPageKey) Dim strPageContent Set DB = New clsDatabase DB.OpenDatabase DATABASE_NAME, DATABASE_USERNAME, DATABASE_PASSWORD numOfPages = DB.RunQuery("SELECT content FROM tsv_webpages WHERE page_key = '" & strPageKey & "';") - 1 If numOfPages > -1 Then myPage = DB.GetLastResults() Set DB = Nothing If numOfPages > -1 Then strPageContent = myPage(0,0) Else strPageContent = "

Page under construction!

Come back soon for updates!

" End If getPageContent = strPageContent End Function Function encodeHTML(sHTML) sHTML=replace(sHTML,"&","&") sHTML=replace(sHTML,"<","<") sHTML=replace(sHTML,">",">") encodeHTML=sHTML End Function %>