Source Code for chat_content.asp



<% 	Name = Session("Name")
NewUserInput= Request("UserInput")
NewInputEmail = Session("Email")


If NewUserInput <> "" Or Not IsEmpty(NewUserInput) then
MaxLength = 100

If Not IsEmpty(Application("UserInput")) Then

If IsArray(Application("UserInput")) Then
UserInput = Application("UserInput")
Handle = Application("Handle")
InputEmail = Application("InputEmail")
TimeInput = Application("TimeInput")
NumofEntries = UBound(UserInput)

If NumofEntries > MaxLength then

'Move all the entries up one, deleting the first
For I = 0 to (NumofEntries - 2)
UserInput(I) = UserInput(I+1)
Handle(I) = Handle(I+1)
TimeInput(I) = TimeInput(I+1)
InputEmail(I) = InputEmail(I+1)
Next

'Assign values and put the new arrays to App level
UserInput(MaxLength) = NewUserInput
Handle(MaxLength) = Name
TimeInput(MaxLength) = Now
InputEmail(MaxLength)= NewInputEmail
Application("UserInput") = UserInput
Application("Handle") = Handle
Application("InputEmail") = InputEmail
Application("TimeInput")= TimeInput
Else
'ReDimension the array to include new input and return to App level

NumofEntries = NumofEntries + 1

ReDim Preserve UserInput(NumofEntries)
ReDim Preserve Handle(NumofEntries)
ReDim Preserve TimeInput(NumofEntries)
ReDim Preserve InputEmail(NumofEntries)
UserInput(NumofEntries -1) = NewUserInput
Handle(NumofEntries -1) = Name
InputEmail(NumofEntries -1) = NewInputEmail
TimeInput(NumofEntries -1)=Now
Application("UserInput") = UserInput
Application("Handle") = Handle
Application("TimeInput")= TimeInput
Application("InputEmail") = InputEmail
End If

Else
'ReDimension the variable to an array and put back to App level

ReDim UserInput(1)
ReDim Handle(1)
ReDim TimeInput(1)
ReDim InputEmail(1)
Handle(0) = Name
UserInput(0) = NewUserInput
TimeInput(0) = Now
InputEmail(0) = NewInputEmail
Application("Handle") = Handle
Application("UserInput") = UserInput
Application("TimeInput") = TimeInput
Application("InputEmail") = InputEmail

End If


Else
'Initialize Users Variable and give to the App
Dim NwUserInput()
ReDim NwUserInput(1)
Dim NwHandle()
ReDim NwHandle(1)
Dim NwTimeInput()
ReDim NwTimeInput(1)
Dim NwInputEmail()
ReDim NwInputEmail(1)
NwUserInput(0) = NewUserInput
NwHandle(0) = Name
NwInputEmail(0) = NewInputEmail
TimeInput(0)= Now
Application("UserInput") = NwUserInput
Application("Handle") = NwHandle
Application("TimeInput") = NwTimeInput
Application("InputEmail") = NwInputEmail

End If
End If

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>


<script language ="JavaScript">
<!--
//FUNCTIONS:

//UPDATE FUNCTION:

function update(){
document.location.href="chat_content.asp"

}

setTimeout("update()",<%=Session("RefreshRate")%>);


//AUTO SCROLLING FUNCTION:

var H=screen.availHeight
function ScrollDown(){
self.scrollTo(0,H);

}


//End SCRIPTS-->

</script>


<title>Hot Springs Chat Room</title>
<link rel = "stylesheet" type = "text/css" href="hse.css">
</head>


<body onLoad="ScrollDown()">



<table>
<%
Handle=Application("Handle")
InputEmail = Application("InputEmail")
UserInput=Application("UserInput")
TimeInput = Application("TimeInput")

If IsArray(Handle)then
NumberofEntries = UBound(Handle)

For J = 0 to (NumberofEntries -1)

'Write the information

If InputEmail(J)<>"none" then
Response.Write "<tr><td class = blksmaller>"
Response.Write "<strong><a href="
Response.Write "mailto:" & InputEmail(J)
Response.Write ">" & Handle(J) & "</a></strong></td><td class=evensmaller>" & TimeInput(J) & "</td><td class=arial>"
Else
Response.Write "<tr><td class=blksmaller><strong>" & Handle(J) & "</strong></td><td class=evensmaller>" & TimeInput(J) & "</td><td class=arial>"
End If

Response.Write UserInput(J) & "</td></tr>"
Next

End If
%>


</table>
<div align="center" style="margin:35px 0px 20px 0px">
<script type="text/javascript"><!--
amazon_ad_tag = "httpwwwhotspr-20"; amazon_ad_width = "728"; amazon_ad_height = "90"; amazon_ad_logo = "hide"; amazon_ad_link_target = "new"; amazon_color_border = "B8CD6F"; amazon_color_background = "F1F7DA"; amazon_color_link = "334141"; amazon_color_price = "232A23"; amazon_color_logo = "080808";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script>
</div>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-11415514-1");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>

<--Back