<%
If mysql = "" Then
sql = "SELECT * FROM Vlinks"
End If
If mysql = "all" Then
sql = "SELECT * FROM Vlinks"
End If
If mysql = "30" Then
sql = "SELECT * FROM VLinks WHERE (((VLinks.LinkDate) Between Now() And Now()-30));"
End If
If mysql = "max" Then
sql = "SELECT VLinks.[Link Id], VLinks.LinkDate, VLinks.Hyperlink, VLinks.Submitter, VLinks.Comments, VLinks.Category, VLinks.SubCategory, VLinks.Picture, VLinks.Tires, VLinks.Electrical, VLinks.Carb, VLinks.Engine, VLinks.Exhaust, VLinks.Frame, VLinks.Body, VLinks.Bags, VLinks.Reference, VLinks.Misc, VLinks.VmaxSpec, VLinks.OwnerPage FROM VLinks WHERE (((VLinks.OwnerPage)=True));"
End If
If mysql = "pics" Then
sql = "SELECT VLinks.[Link Id], VLinks.LinkDate, VLinks.Hyperlink, VLinks.Submitter, VLinks.Comments, VLinks.Category, VLinks.SubCategory, VLinks.Picture, VLinks.Tires, VLinks.Electrical, VLinks.Carb, VLinks.Engine, VLinks.Exhaust, VLinks.Frame, VLinks.Body, VLinks.Bags, VLinks.Reference, VLinks.Misc, VLinks.VmaxSpec, VLinks.OwnerPage FROM VLinks WHERE (((VLinks.Picture)=True));"
End If
If mysql = "mine" Then
sql = "SELECT VLinks.* FROM VLinks WHERE ((VLinks.Submitter)=" & "'" & Session("username") & "'" & ");"
End If
If mysql = "favs" Then
sql = "SELECT VLinks.*, UFavorites.Username FROM UFavorites INNER JOIN VLinks ON UFavorites.[Link ID] = VLinks.[Link Id] WHERE ((UFavorites.Username)=" & "'" & Session("username") & "'" & ");"
End If
If mysql = "dlink" Then
sql = "SELECT VLinks.* FROM VLinks WHERE ((VLinks.[Link ID])=" & Request("LinkID") & ");"
End If
'Came from search form
If mysql="srch" Then
sql = "SELECT VLinks.[Link Id], VLinks.LinkDate, VLinks.Hyperlink, VLinks.Submitter, VLinks.Comments, VLinks.Category, VLinks.SubCategory, VLinks.Picture, VLinks.Tires, VLinks.Electrical, VLinks.Carb, VLinks.Engine, VLinks.Exhaust, VLinks.Frame, VLinks.Body, VLinks.Bags, VLinks.Reference, VLinks.Misc, VLinks.VmaxSpec, VLinks.OwnerPage FROM VLinks WHERE (((Vlinks.[Link ID]) Is not Null)"
sqlend=");"
If Request.Form("Keyword") <> "" Then
sql = sql & " AND ((VLinks.Comments) Like " & Chr(39) & "%" & Request.Form("Keyword") & "%" & chr(39) & ")"
End If
If Request.Form("Carb") = "ON" Then
sql = sql & " AND ((VLinks.Carb)=" & "True" & ")"
End If
If Request.Form("Engine") = "ON" Then
sql = sql & " AND ((VLinks.Engine)=" & "True" & ")"
End If
If Request.Form("Electrical") = "ON" Then
sql = sql & " AND ((VLinks.Electrical)=" & "True" & ")"
End If
If Request.Form("Tires") = "ON" Then
sql = sql & " AND ((VLinks.Tires)=" & "True" & ")"
End If
If Request.Form("Exhaust") = "ON" Then
sql = sql & " AND ((VLinks.Exhaust)=" & "True" & ")"
End If
If Request.Form("Frame") = "ON" Then
sql = sql & " AND ((VLinks.Frame)=" & "True" & ")"
End If
If Request.Form("Body") = "ON" Then
sql = sql & " AND ((VLinks.Body)=" & "True" & ")"
End If
If Request.Form("Reference") = "ON" Then
sql = sql & " AND ((VLinks.Reference)=" & "True" & ")"
End If
If Request.Form("Bags") = "ON" Then
sql = sql & " AND ((VLinks.Bags)=" & "True" & ")"
End If
If Request.Form("Misc") = "ON" Then
sql = sql & " AND ((VLinks.Misc)=" & "True" & ")"
End If
If Request.Form("VmaxSpec") = "ON" Then
sql = sql & " AND ((VLinks.VmaxSpec)=" & "True" & ")"
End If
If Request.Form("OwnerPage") = "ON" Then
sql = sql & " AND ((VLinks.OwnerPage)=" & "True" & ")"
End If
'Finish SQL
sql = sql & sqlend
End If
Set rs = Server.CreateObject("ADODB.Recordset")
rs.cursorlocation=aduseclient
rs.cachesize=5
rs.open sql, oconn, 3, 3
If rs.Eof<>True Then
rs.pagesize=10
maxpages=cint(rs.pagecount)
maxrecs=cint(rs.pagesize)
rs.absolutepage=mypage
howmanyrecs=0
howmanyfields=rs.fields.count -1
%>
<%If Session("username")<>"" AND mysql="favs" Then
Response.Write Session("username") & "'s Favorites"
End If
%>
|
Retrieved a total of <%Response.Write rs.RecordCount & " "%>
record(s).
| <%Call PageNavBar%>
|
<%
On Error Resume Next
DO UNTIL rs.eof OR howmanyrecs>=maxrecs
%>
Link
#
<%response.write rs.fields("Link ID")%>
|
<%response.write "" & Mid(rs.fields("Hyperlink"),1,50) & " "%>
|
Submitted by <%response.write rs.fields("Submitter")%> on <%Response.Write rs.Fields("LinkDate")%>
<%Response.Write rs.Fields("Comments")%>
<%
If rs.Fields("Picture") = True Then
Picture = Chr(34) & "ON" & Chr(34) & " checked"
Else
Picture = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Carb") = True Then
Carb = Chr(34) & "ON" & Chr(34) & " checked"
Else
Carb = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Engine") = True Then
Engine = Chr(34) & "ON" & Chr(34) & " checked"
Else
Engine = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Electrical") = True Then
Electrical = Chr(34) & "ON" & Chr(34) & " checked"
Else
Electrical = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Tires") = True Then
Tires = Chr(34) & "ON" & Chr(34) & " checked"
Else
Tires = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Exhaust") = True Then
Exhaust = Chr(34) & "ON" & Chr(34) & " checked"
Else
Exhaust = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Frame") = True Then
Frame = Chr(34) & "ON" & Chr(34) & " checked"
Else
Frame= Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Body") = True Then
Body = Chr(34) & "ON" & Chr(34) & " checked"
Else
Body = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Reference") = True Then
Reference = Chr(34) & "ON" & Chr(34) & " checked"
Else
Reference = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Bags") = True Then
Bags = Chr(34) & "ON" & Chr(34) & " checked"
Else
Bags = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("Misc") = True Then
Misc = Chr(34) & "ON" & Chr(34) & " checked"
Else
Misc= Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("VmaxSpec") = True Then
VmaxSpec = Chr(34) & "ON" & Chr(34) & " checked"
Else
VmaxSpec = Chr(34) & "ON" & Chr(34)
End If
If rs.Fields("OwnerPage") = True Then
OwnerPage = Chr(34) & "ON" & Chr(34) & " checked"
Else
OwnerPage = Chr(34) & "ON" & Chr(34)
End If
'Start option box table here
%>
<%If Session("username")<>"" AND mysql<>"favs" Then%>
<%Response.Write "Add to my favorites"%>
<%Else%>
<%End If%>
<%If Session("username")<>"" AND mysql="favs" Then%>
<%Response.Write "Remove from favorites"%>
<%End If%>
|
<%If rs.Fields("Picture") = True Then%>
<% Response.write ""
mystring = " "
Response.Write mystring
%>
<%End If%>
| |
<%If Session("Level") = "Admin" Or mySQL="mine" Then %>
|
<%End If%>
<%
rs.movenext
howmanyrecs=howmanyrecs+1
LOOP
' close, destroy
rs.close
set rs=nothing
' Now make the page _ of _ hyperlinks
%>
Page <%response.write mypage & " of " & maxpages & " "%>
|
<%Call PageNavBar%> |
<%Else%>
Sorry, there were no records returned.
|
<%End If%>
|