Movies Seen & Rated - Data powered by HanDBase
<%
' 010324 - Todd Ogasawara
' 011222 - Converted from client-side Javascript to ASP+VBScript
' Source code Copyright 2001 Todd Ogasawara
Dim DoubleQuote
DoubleQuote = chr(34)
function writeln(args)
Response.Write args
Response.Write " "
end function
function writeBold(args)
Response.Write ""
Response.Write args
Response.Write ""
end function
function setFontColor(fontColor)
Response.Write ""
end function
function endFont()
Response.Write ""
end function
function TRbegin()
Response.Write "
"
end function
function TRend()
Response.Write "
"
end function
function TDbegin()
Response.Write "
"
end function
function TDend()
Response.Write "
"
end function
function loadXML()
Dim xmlDoc, objRootElement, numRecords, i
Dim sRecord, MovieTitle, DateSeen, MovieRating, SeenWhere
' Instantiate the XML Processor
set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
' Have the processor validate the document
xmlDoc.validateOnParse=True
' Load the XML document
xmlDoc.load(Server.MapPath("./MoviesSeen.xml"))
' Set the document element
Set objRootElement = xmlDoc.documentElement
' Force the file to load synchronously (all at once)
xmlDoc.async = false
numRecords = objRootElement.childnodes.length
Response.Write ""
Response.Write "Number of Movies Rated= "
Response.Write numRecords
Response.Write ""
Response.Write ""
' Get Today's date
Today = Date
For i = 0 to numRecords - 1
sRecord = objRootElement.childNodes(i).nodeName
MovieTitle = objRootElement.childNodes(i).firstChild.text
DateSeen = objRootElement.childNodes(i).childNodes(1).text
MovieRating = objRootElement.childNodes(i).childNodes(2).text
SeenWhere = objRootElement.childNodes(i).childNodes(3).text
KidFriendly = objRootElement.childNodes(i).lastChild.text
TRbegin 'begin table row
TDbegin
if sDateEntered <> "NO DATE" then
if DateDiff("d", DateSeen, Today) < 31 then
setFontColor("red")
Response.Write DateSeen
endFont
else
Response.Write DateSeen
end if
else
Response.Write " "
end if
TDend
TDbegin
if MovieRating >= 3.6 then
setFontColor "blue"
else
setFontColor "black"
end if
writeBold(MovieTitle)
endFont
TDend
TDbegin
if MovieRating >= 3.3 then
setFontColor "red"
else
setFontColor "black"
end if
Response.Write MovieRating
endFont
TDend
TDbegin
Response.Write SeenWhere
TDend
TDbegin
if KidFriendly = "Y" then
Response.Write ""
Response.Write "" & "☺" & ""
Response.Write ""
end if
TDend
TRend 'end table row
Next ' For loop
end function 'loadXML()
%>
Todd's Movie Rating Scheme 3.6 - 4.0: Excellent! This is a classic! 3.3 - 3.5: Liked it a lot. I recommend it to everyone. 3.0 - 3.2: Enjoyed it. I recommend it to some people based on their interests. 2.1 - 2.9: I was entertained some of the time. Would not recommend it. 1.0 - 2.0: Truly heinous. Wish I hadn't seen it! Note 1: I sometimes go back and re-rate the movies as I see more movies to compare against it. Note 2: A smiley face
☺
indicates what I consider to be a child-friendly movie (i.e., I took my child to see it)