 |
|
 |
<%
If Request.QueryString("artID") <> "" Then
%>
<% Else 'No article ID specified in the URL %>
<%
'Dim Conn 'Main connection to the DB
'Dim LocSet 'Will hold the recordset of stuff for this URL
'Dim MetSet 'Set for the meta information
'Dim Name 'Location Name
'Dim Street 'Street address
'Dim City 'City address
'Dim Phone 'Main phone number
'Dim Fax 'Fax number
'Dim Brief 'Description from DB
'Dim MetaID 'Grabs Location ID
'Dim URL 'Holds the URL entered used to access page
'Dim Rating
'Dim Cost
'Dim LocID
%>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub ListArticles(LocID) 'Lists the articles for this page. Displays the first available according to ArticleStart
SQL = "SELECT * FROM tblArticle WHERE LocationID = " & LocID & "AND ArticleStart <= Date() AND ArticleExpire >= Date() ORDER BY ArticleStart ASC"
Set ArtSet = Server.CreateObject("ADODB.RecordSet")
ArtSet.Open SQL, Conn
If Not (ArtSet.BOF And ArtSet.EOF) Then
%>
Related Articles:
<%
Do Until ArtSet.EOF
More = ""
More = More & ArtSet("ArticleTitle") & ""
%>
<%=More%>
<%
ArtSet.MoveNext
Loop
%>
<%
End If
End Sub 'ListArticles
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<%
If Right(Request.ServerVariables("URL"), 1) = "/" Then 'The URL is ending in a backslash (ie, no index was specified)
URL = "http://www.acnights.com" & Lcase(Request.ServerVariables("URL")) & "index.asp"
Else
URL = "http://www.acnights.com" & LCase(Request.ServerVariables("URL"))
End If
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=acnights"
SQL = "SELECT DISTINCTROW ID FROM tblMeta WHERE PageURL LIKE '%" & URL & "%'"
Set MetSet = Server.CreateObject("ADODB.RecordSet")
MetSet.Open SQL, Conn
IF Not (MetSet.BOF And MetSet.EOF) Then 'There's a match in the database!
MetaID = MetSet("ID")
SQL = "SELECT * FROM tblLocation WHERE LocationURL = " & MetaID
Set LocSet = Server.CreateObject("ADODB.RecordSet")
LocSet.Open SQL, Conn
If Not (LocSet.BOF And LocSet.EOF) Then 'Woohoo, location write up!
DB_Art = "Yes"
Do Until LocSet.EOF
Name = LocSet("LocationName")
Street = LocSet("LocationStreet")
City = LocSet("LocationCity")
Phone = LocSet("LocationPhone")
Fax = LocSet("LocationFax")
Brief = LocSet("LocationBrief")
Rating = LocSet("LocationRating")
Cost = LocSet("LocationCost")
LocID = LocSet("LocationID")
If Rating <> "" Then
Rating = "http://www.acnights.com/images/"&Rating&"-rate.gif"
End If
If Cost <> "" Then
Cost = "http://www.acnights.com/images/"&Cost&"-cost.gif"
End If
%>
<%If Name <> "" Then %>
<%=Name%>
<% End If %>
<%If Street <> "" Then%>
<%=Street%>,<%=City%>
<%End If%>
<%If Phone <> "" Then%>
Phone: <%=phone%>
<%End If%>
<%If Fax <> "" Then%>
Fax: <%=fax%>
<% End If %>
<%If Rating <> "" Then%>
Bender Rating:
<%End If%>
<%If Cost <> "" Then%>
Avg. Cost:
<%End If%>
<%
If Brief = "" Then
ListArticles LocID
Else
%>
<%=Brief%>
<% ListArticles LocID %>
<%
End If
%>
|
<%
LocSet.MoveNext
Loop
Else 'No match in location table
ListArticles LocID
End If 'Location writeup
End If 'match in meta db
%>
<% End If 'Top check for an article ID %>
|
 |
|
 |