<% ID = Request.QueryString("ID") Set DB = New clsDatabase DB.OpenDatabase DATABASE_NAME, "", "" numOfPrograms = DB.RunQuery("SELECT library_categories.id, library_categories.name, library_programs.id, library_programs.name, library_programs.large_image FROM library_categories, library_programs WHERE library_categories.id = library_programs.category_id ORDER BY library_categories.id, library_categories.name, library_programs.id, library_programs.name") - 1 If numOfPrograms > -1 Then allPrograms = DB.GetLastResults() numOfProgram = -1: numOfBroadcasters = -1 If LenB(ID) > 0 Then numOfProgram = DB.RunQuery("SELECT p.name, p.large_image, p.description, p.duration, p.link, c.id FROM library_programs AS p INNER JOIN library_categories AS c ON p.category_id = c.id WHERE p.id = " & ID) - 1 If numOfProgram > - 1 Then myProgram = DB.GetLastResults() numOfBroadcasters = DB.RunQuery("SELECT b.id, b.name, b.logo, b.link FROM library_broadcasters AS b INNER JOIN library_program_broadcasters AS pb ON b.id = pb.broadcaster_id WHERE pb.program_id = " & ID & " ORDER BY b.id") - 1 If numOfBroadcasters > -1 Then allBroadcasters = DB.GetLastResults() End If Set DB = Nothing If numOfPrograms > - 1 Then doResizeImg = IsObjectInstalled("Persits.Jpeg") strLastCategory = "": strLastCategoryLBL = "": intFilmCount = 0: intCategoryCount = 0 For x = 0 To numOfPrograms If strLastCategory <> allPrograms(0,x) Then strLastCategory = allPrograms(0,x) If strLastCategory = cPLID1 Then strColor = cPLCategory1 strSubColor = cPLCategory1Sub ElseIf strLastCategory = cPLID2 Then strColor = cPLCategory2 strSubColor = cPLCategory2Sub ElseIf strLastCategory = cPLID3 Then strColor = cPLCategory3 strSubColor = cPLCategory3Sub End If If numOfProgram > -1 Then If strLastCategory = myProgram(5,0) Then strMainColor = strColor strMainSubColor = strSubColor End If End If If LenB(strFilmsTables) > 0 Then 'Close Previous Category If Right(strFilmsTables, 8) <> "" Then strFilmsTables = strFilmsTables _ & " " _ & " " _ & " " & strLastCategoryLBL & "" _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & "" End If End If 'Start New category strFilmsTables = strFilmsTables _ & "" _ & " " _ & " " _ & " " _ & "
" intFilmCount = 0 intCategoryCount = intCategoryCount + 1 End If If intFilmCount = 13 Then strFilmsTables = strFilmsTables & "
" intFilmCount = 0 End If If doResizeImg Then imgPath = "/img.asp?path=" & PROGRAM_IMAGE_PATH & allPrograms(4,x) & "&w=40&h=40" Else imgPath = PROGRAM_IMAGE_PATH & allPrograms(4,x) End If strFilmsTables = strFilmsTables _ & "" 'bgcolor=""#FFFFFF"" strDivHTML = strDivHTML & "

" & allPrograms(3,x) & "

" strLastCategoryLBL = Trim("" & allPrograms(1,x)) intFilmCount = intFilmCount + 1 Next If LenB(strFilmsTables) > 0 Then 'Close Previous Category If Right(strFilmsTables, 8) <> "
" Then strFilmsTables = strFilmsTables _ & " " _ & " " _ & " " & strLastCategoryLBL & "" _ & " " _ & " " _ & " " _ & " " _ & " " _ & "" End If End If strProgramDetails = "" If numOfProgram > -1 Then strTitle = Trim("" & myProgram(0,0)) strImage = Trim("" & myProgram(1,0)) strDescription = Replace(Trim("" & myProgram(2,0)), vbCrLf, "
") strProgramLink = Trim("" & myProgram(4,0)) If doResizeImg Then imgPath = "/img.asp?path=" & PROGRAM_IMAGE_PATH & strImage & "&w=280&h=210" Else imgPath = PROGRAM_IMAGE_PATH & strImage End If strProgramDetails = "" _ & "" _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " _ & "
" & UCase(strTitle) & "

" & strDescription & "

" Else strProgramDetails = "" _ & "" _ & " " _ & " " _ & " " _ & " " _ & " " _ & "
PROGRAM LIBRARY
" End If strBroadcastersList = "" If numOfBroadcasters > -1 Then strBroadcastersList = "" _ & "" _ & " " For x = 0 To numOfBroadcasters strName = Trim("" & allBroadcasters(1,x)) strLogo = Trim("" & allBroadcasters(2,x)) strLink = Trim("" & allBroadcasters(3,x)) If doResizeImg Then 'imgPath = "/img.asp?path=" & BROADCASTER_IMAGE_PATH & strLogo imgPath = BROADCASTER_IMAGE_PATH & strLogo Else imgPath = BROADCASTER_IMAGE_PATH & strLogo End If strHSpace = "" If x = 0 Then strBroadcastersList = strBroadcastersList _ & " " _ & " " _ & " " _ & " " _ & " " _ & " " If LenB(strProgramLink) > 0 Then strBroadcastersList = strBroadcastersList _ & " " _ & "
BROADCASTERS:
" ElseIf x MOD 10 = 0 Then strBroadcastersList = strBroadcastersList _ & "
" Else strHSpace = " hspace=""15""" End If strAnchor = "": strAnchorEnd = "" If LenB(strLink) > 0 Then strAnchor = "" strAnchorEnd = "" End If strBroadcastersList = strBroadcastersList _ & strAnchor & "" & strAnchorEnd Next strBroadcastersList = strBroadcastersList _ & "
Visit the " & strTitle & " website.
" Else strBroadcastersList = strBroadcastersList _ & "" End If Else If LenB(strProgramLink) > 0 Then strLinkLine = "Visit the " & strTitle & " website." Else strLinkLine = "" End If strBroadcastersList = "" _ & "" _ & " " _ & "
" & strLinkLine & "
" End If Else strFilmsTable = "

No programs were found! Please come back soon to check for updates!

" End If Response.Write strDivHTML & strFilmsTables & strProgramDetails & strBroadcastersList %>