Click to See Complete Forum and Search --> : i have no asp knowledge


rhsunderground
12-01-2006, 03:28 PM
i cannot find the reason for my distress with this code:

<%
Dim day, hour, msg, poop, smell

If day = 0 AND hour < 23 AND hour > 19 Then
poop = "Currently on air is Adam Burmood & John Thayer"
'ElseIf day = 0 AND hour < 23 AND $our>21 Then
'poop = "Currently on air is Brent Friedeman"
'ElseIf day = 1 AND hour < 1 AND hour > 0 Then
'poop = "Currently on air is Brent Friedeman"
'ElseIf day = 1 AND hour < 23 AND hour > 19 Then
'poop = "Currently on air is Tatton Jacob"
'ElseIf day = 0 AND hour < 23 AND $our>21 Then
'poop = "Currently on air is Nobody Cares About Crete"
'ElseIf day = 1 AND hour < 1 AND hour > 0 Then
'poop = "Currently on air is Nobody Cares About Crete"
'ElseIf day = 2 AND hour < 19 AND hour > 17 Then
'poop = "Currently on air is Megan Bowen"
'ElseIf day = 2 AND hour < 21 AND hour > 19 Then
'poop = "Currently on air is Jason Sitzman"
'ElseIf day = 2 AND hour < 23 AND hour > 21 Then
'poop = "Currently on air is Josh Hartwell"
'ElseIf day = 3 AND hour < 21 AND hour > 19 Then
'poop = "Currently on air is Distant Sound Sessions"
'ElseIf day = 3 AND hour < 21 AND hour > 19 Then
'poop = "Currently on air is The Last Resort"
'ElseIf day = 3 AND hour < 0 AND hour > 23 Then
'poop = "Currently on air is The Chopping Block"
'ElseIf day = 4 AND hour < 1 AND hour > 0 Then
'poop = "Currently on air is The Chopping Block"
'ElseIf day = 5 Then
'poop = "Currently on air is test."
Else
poop = "The station is currently on auto-play."
End If

If day = 0 AND hour < 21 Then
smell = "Adam Burmood and John Thayer tonight at 9:00"
' If day = 0 AND hour > 21 AND hour < 23 Then
' smell = "Brent Friedeman at 11:00"
' If day = 0 AND hour > 23
' smell = "Tatton Jacob tomorrow night at 9:00"
' If day = 1 and hour < 21 Then
' smell = "Tatton Jacob tonight at 9:00"
' If day = 1 AND hour > 21 AND hour < 23 Then
' smell = " Nobody Cares About Crete at 11:00"
' If day = 1 AND hour > 23
' smell = "Megan Bowen tomorrow night at 5:00"
' If day = 2 and hour < 17 Then
' smell = "Megan Bowen tonight at 5:00"
' If day = 2 and hour < 19 AND hour > 17 Then
' smell = "Jason Sitzman at 7:00"
' If day = 2 and hour < 21 AND hour > 19 Then
' smell = "Josh Hartwell at 9:00"
' If day = 2 and hour > 21 Then
' smell = "Distant Sound Sessions tomorrow night at 7:00"
' If day = 3 and hour < 19 Then
' smell = "Distant Sound Sessions tonight at 7:00"
' If day = 3 and hour > 19 and hour < 21 Then
' smell = "The Last Resort at 9:00"
' If day = 3 AND hour < 23 AND hour > 21 Then
' smell = "The Chopping Block at 11:00"
' If day = 3 and hour > 23 Then
' smell = "Adam Burmood and John Thayer Monday night at 9:00"
' If day > 3 Then
' smell = "Adam Burmood and John Thayer Monday night at 9:00"
Else
smell = "auto-play."
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">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>Accessibility - 91.9 The Kidney</title>
<link rel="shortcut icon" href="favicon.png" />
<link rel="stylesheet" href="screen.css" type="text/css" media="screen" />
</head>
<body>
<div id="content">

<div id="head">

</div>

<div id="leftside">
<img src="images/menu.gif" alt="Menu" class="imgcenter" />
<ul>

<li><a href="index.asp">Home</a></li><li><a href="listen.asp">Listen Now</a></li>
<li><a href="schedule.asp">DJ Schedule</a></li>
<li><a href="history.asp">Station History</a></li>
<li><a href="contact.asp">Contact Us</a></li>
<li><a href="adds.asp">Hot Adds</a></li>
<li><a href="http://www.doane.edu">Doane</a></li>
<li><a href="staff.asp">Staff</a></li>
<li><a href="dj.asp">DJs</a></li>
</ul>
</div>

<div id="main">
<img src="images/accessibility.jpg" alt="Accessibility" class="imgcenter" /><br />
<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwebcast.doane.edu"><img src="images/html.jpg" alt="Valid HTML" class="imgcenter" /></a><br />
<a href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwebcast.doane.edu%2F"><img src="images/css.jpg" alt="Valid CSS" class="imgcenter" /></a><br />
<a href="http://graybit.com/files/graybit.php?url=http%3A%2F%2Fwebcast.doane.edu%2F"><img src="images/graybit.jpg" alt="Graybit Tested" class="imgcenter" /></a><br />
<a href="http://www.contentquality.com/"><img src="images/cynthia.jpg" alt="Cynthia Approved" class="imgcenter" /></a><br />
<a href="http://www.opera.com/products/mobile/smallscreen/"><img src="images/smallscreen.jpg" alt="Small Screen Readable" class="imgcenter" /></a><br />
<a href="whydoicare.html"><img src="images/why.jpg" alt="Why Do I Care?" class="imgcenter" /></a>


</div>


<div id="rightside">
<img src="images/onair.gif" alt="On Air Now" class="imgcenter" />
<p><%= msg %><%= poop %> Up next is <%= smell %>.</p>
</div>

<div id="foot">

</div>


</div>
</body>
</html>

it's friday and it tells me The station is currently on auto-play. Up next is Adam Burmood and John Thayer tonight at 9:00., which is obviously not what i want. thoughts?

chrismartz
12-01-2006, 05:44 PM
I remember this script. It looks like day and hour isn't defined. Are those supposed to be the current date and time for this page?

rhsunderground
12-01-2006, 10:57 PM
hour and day should refer to GMT-6. i guess i didn't think to take that into account. how would i do that?

russell
12-01-2006, 11:46 PM
u declared variables, but didnt assign them

Dim day, hour, msg, poop, smell

day = DatePart("w" date())
hour = DatePart("h" date())
...

rhsunderground
12-02-2006, 01:35 PM
http://webcast.doane.edu/accessibility.asp :


Microsoft VBScript compilation error '800a03ee'

Expected ')'

/accessibility.asp, line 4
day = DatePart("w" date())

russell
12-02-2006, 02:01 PM
my bad. missing commas

Dim day, hour, msg, poop, smell

day = DatePart("w", date())
hour = DatePart("h", date())

rhsunderground
12-02-2006, 04:12 PM
that and a slight tweak and i've got it! thanks a bunch.