Quote:
quote:Originally posted by Imar
Hi Joshil,
Can you post the code for both problems? Since the Dreamweaver code is quite large, you may decide to skip some irrelevant parts of it. If you can't decide what to leave out, post it all.
To make things easier, maybe you can start a separate thread for the Menu problem. This way we can work on both problems without messing things up too much.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Interlude by Muse (Track 7 from the album: Absolution)
|
i think my testing server is not working. when i used the live data view option (chap 12 pg 446 point10) i got a 404 error suggesting the error maybe due to "C:/Inetpub/wwwroot/TheSoccerSite/" folder did not match "http://localhost/thesoccersite/" URL on the testing server. is suggests i verify URL prefix maps root of site. however my details regarding the server infor match the book word for word. i am confused. i have windows xp prof, iis and IE. obviously dynamic pages are not vbeing processed by the server. the server behaviours were copied and pasted from the Wrox code, because at first the arrow on the panel was forzen becase there was no tick beside the "set up sites testing server". however i thought if i copied the code it may work. however in the recordsets dialogue box the right results for the queries are made and therefore there is obviously a connection with the database however in the browser the results are not shown. the table is sometimes shown but the when the categories are selected there is not change, when there should be as the different categories represent different events.
i also noticed in windows explorer under the root of the soccer site the in the database folder there is the main database but there is aslo another file called TheSoccerSite.ldb but the type of file is Microsoft Access Record-Locking Information file. Should this be there? its not mentioned in the book...in dreamweaver the file is not in my local view but is in the remote and testing server view...very confusing..
the events.asp code in full is pasted below,
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim rsEvents__MMColParam
rsEvents__MMColParam = "1"
If (Request.QueryString("1stCategory") <> "") Then
rsEvents__MMColParam = Request.QueryString("1stCategory")
End If
%>
<%
Dim rsEvents
Dim rsEvents_numRows
Set rsEvents = Server.CreateObject("ADODB.Recordset")
rsEvents.ActiveConnection = MM_connTheSoccerSite_STRING
rsEvents.Source = "SELECT EndDate, ID, StartDate, Summary, Title FROM Events WHERE Category = " + Replace(rsEvents__MMColParam, "'", "''") + " ORDER BY StartDate ASC"
rsEvents.CursorType = 0
rsEvents.CursorLocation = 2
rsEvents.LockType = 1
rsEvents.Open()
rsEvents_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rsEvents_numRows = rsEvents_numRows + Repeat1__numRows
%>
<% SetFirstVisitedPage() %>
<%
Dim iLastCategory
If Request.QueryString("lstCategory") <> "" Then
' Category has been chosen, so let's save it in a cookie
iLastCategory = Request.QueryString("lstCategory")
Response.Cookies("LastCategory") = iLastCategory
Response.Cookies("LastCategory").Expires = Date() + 10
Else
' Page is requested directly, so get the cookie
If Len(Request.Cookies("LastCategory")) > 0 Then
iLastCategory = CInt(Request.Cookies("LastCategory"))
End If
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>
function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID
strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If
On Error Resume Next
If (nLCID > -1) Then
Session.LCID = nLCID
End If
If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If
If (nLCID > -1) Then
Session.LCID = oldLCID
End If
DoDateTime = strRet
End Function
</SCRIPT>
<html>
<head>
<title>GlobalSoocerEvents.com - Your source for up to date soccer events</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%
Dim sBackgroundColor
If Len(Request.Cookies("BackgroundColor")) > 0 Then
sBackgroundColor = Request.Cookies("BackgroundColor")
Else
sBackgroundColor = "#ffffff" ' Our default background color
End If
Dim iTheme
If Len(Request.Cookies("SiteTheme")) > 0 Then
iTheme = Request.Cookies("SiteTheme")
Else
iTheme = 1 ' Our default theme
End If
%>
<link href="Styles/mainStyles.css" rel="stylesheet" type="text/css">
<link href="Styles/mainStyles<%=iTheme%>.css" rel="stylesheet" type="text/css">
</head>
<body style="background-color: <%=sBackgroundColor%>"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="Images/Blue%20hills.jpg" width="257" height="58"></td>
<td><table border="0" align="right" cellspacing="0" cellpadding="0">
<tr>
<td><a href="home.asp" id="home">Home</a></td>
<td> </td>
<td><a href="events.asp" id="events">Events</a></td>
<td> </td>
<%
MM_authorizedUsers="Administrators,Members"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuth orization"))>=1) Then
%>
<td><a href="mySite.asp" id="mysite">My Site</a></td>
<td> </td>
<%
End If
End If
%>
<%
MM_authorizedUsers="Administrators"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuth orization"))>=1) Then
%>
<td><a href="Admin/admin..asp" id="admin">Admin</a></td>
<td> </td>
<%
End If
End If
%>
<td><a href="login.asp" id="login">Login</a></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<script language="Javascript" type="text/javascript">
var sPageName = '<%Request.ServerVariables("SCRIPT_NAME")%>';
sPageName = sPageName.substr(sPageName.lastIndexOf('/')
+ 1).toLowerCase ();
sPageName = sPageName.substr(0 sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontWeigh t = 'Bold';
document.getElementById(sPageName).style.fontSize = '14pt';
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><h2>Current Events</h2></td>
</tr>
<tr>
<td> <form action="events.asp" method="get" name="frmSelectCategory">
<select name="lstCategory" onChange="document.frmSelectCategory.submit();">
<option value="">Select a Category</option>
<% If iLastCategory = 1 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="1"<%=sSelected%>>Champions League</option>
<% If iLastCategory = 2 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="2"<%=sSelected%>>UEFA Cup</option>
<% If iLastCategory = 3 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="3"<%=sSelected%>>National League</option>
<% If iLastCategory = 4 Then sSelected = " selected=""selected""" _
Else sSelected = ""%>
<option value="4"<%=sSelected%>>US Major League Soccer</option>
</select>
<table width="600" border="1" cellspacing="2" cellpadding="2" class="clsSolidBlackBorder">
<%
While ((Repeat1__numRows <> 0) AND (NOT rsEvents.EOF))
%>
<tr>
<td class="clsHeading"><%=(rsEvents.Fields.Item("Title ").Value)%></td>
</tr>
<tr>
<td class="clsSummary"><%=(rsEvents.Fields.Item("Summa ry").Value)%></td>
</tr>
<tr>
<td>This Event will last from <%= DoDateTime((rsEvents.Fields.Item("StartDate").Valu e), 1, 1033) %> until <%= DoDateTime((rsEvents.Fields.Item("EndDate").Value) , 1, 1033) %></td>
</tr>
<tr>
<td></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsEvents.MoveNext()
Wend
%>
</table>
</form>
</td>
</tr>
<tr>
<td align="center"><div align="center"><br>
<br>
<br>
<br>
<br>
</div></td>
</tr>
</table>
</body>
</html>
<%
rsEvents.Close()
Set rsEvents = Nothing
%>
the second problem is the menu item does not enlarge and bold when selected...the code is below for mainMenu.lbi
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../Images/Blue%20hills.jpg" width="257" height="58"></td>
<td><table border="0" align="right" cellspacing="0" cellpadding="0">
<tr>
<td><a href="../home.asp" id="home">Home</a></td>
<td> </td>
<td><a href="../events.asp" id="events">Events</a></td>
<td> </td>
<%
MM_authorizedUsers="Administrators,Members"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuth orization"))>=1) Then
%>
<td><a href="../mySite.asp" id="mysite">My Site</a></td>
<td> </td>
<%
End If
End If
%>
<%
MM_authorizedUsers="Administrators"
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuth orization"))>=1) Then
%>
<td><a href="../Admin/admin..asp" id="admin">Admin</a></td>
<td> </td>
<%
End If
End If
%>
<td><a href="../login.asp" id="login">Login</a></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<script language="Javascript" type="text/javascript">
var sPageName = '<%Request.ServerVariables("SCRIPT_NAME")%>';
sPageName = sPageName.substr(sPageName.lastIndexOf('/')
+ 1).toLowerCase ();
sPageName = sPageName.substr(0 sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontWeigh t = 'Bold';
document.getElementById(sPageName).style.fontSize = '14pt';
}
</script>
Thanks for your help Imar.