%
Server.ScriptTimeout = 1000000
dsn="DBQ=" & Server.Mappath("admin/etsfaq.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open dsn
Set RSBODY = Server.CreateObject("ADODB.Recordset")
SQLBODY = "SELECT * from Settings"
RSBODY.Open SQLBODY, Conn, 1, 3
If request("Action") = "Cat" Then
Set RSCat = Server.CreateObject("ADODB.Recordset")
SQLCat = "SELECT * from Categories WHERE ID=" & request("ID")
RSCat.Open SQLCat, Conn, 1, 3
CatName = RSCat("Category")
RSCat.close
Set RSCat = Nothing
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Category=" & request("ID") & " AND NOT Pending ORDER BY Question"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Q" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.Find "ID=" & request("ID")
RS("Views") = RS("Views") + 1
RS.update
RS.close
Set RS = Nothing
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE ID=" & request("ID") & " AND NOT Pending"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Search" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE Question LIKE '%" & request("Keyword") & "%' OR Answer LIKE '%" & request("Keyword") & "%' AND NOT Pending"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "New" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RSSQL = "SELECT * from Questions WHERE NOT Pending ORDER BY DateCreated Desc"
RS.Open RSSQL, Conn, 1, 3
ElseIf request("Action") = "Ask2" Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Questions", Conn, 2, 2
RS.addnew
RS("Question") = Request("Question")
RS("Category") = Request("Category")
RS("DateCreated") = Date
RS("Pending") = True
RS.update
End If
%>
The Ultimate Personal Locator Beacon (PLB) FAQ - EQUIPPED TO SURVIVE (tm)
" text="<%=RSBODY("Text_Color")%>" link="<%=RSBODY("Link_Color")%>" vlink="<%=RSBODY("Link_Color")%>" alink="<%=RSBODY("Link_Hover_Color")%>">
<%=RSBODY("Header")%>
" size="<%=RSBODY("Title_Size")%>" color="<%=RSBODY("Title_Color")%>"> <%=RSBODY("Page_Title")%> |
"> |
" align="right">
" size="<%=RSBODY("Text_Cat_Size")%>"><%If request("Action") = "Q" Then%><<<Back | PLB FAQ Home | Ask A New Question<%ElseIf request("Action") = "Ask" OR request("Action") = "Ask2" Then%>Ask A New Question<%ElseIf request("Action") = "New" Then%>New Questions<%ElseIf request("Action") = "Search" Then%>Search Results for <%=request("Keyword")%><%Else%><%If request("Action") = "Cat" Then%><<<Back | <%=CatName%> <%End If%><%End If%> |
|
"> |
<%If request("Action") = "Ask" Then%>
<%ElseIf request("Action") = "Ask2" Then%>
" size="<%=RSBODY("Text_Size")%>">Thank you for submitting your question. |
<%ElseIf request("Action") = "Q" Then%>
" valign="top">" size="<%=RSBODY("Title_Size")%>" color="<%=RSBODY("Link_Color")%>">Q: |
" width="100%">" size="<%=RSBODY("Text_Size")%>"><%=RS("Question")%> |
" valign="top">" size="<%=RSBODY("Title_Size")%>" color="<%=RSBODY("Link_Color")%>">A: |
">" size="<%=RSBODY("Text_Size")%>"><%Answer = replace(RS("Answer"), vbcrlf, " ")%>
<%=Answer%> |
" size="1">Date Created: <%=RS("DateCreated")%> |
" size="1">Last Updated: <%=RS("DateUpdated")%> |
|
<%ElseIf request("Action") = "Cat" Then
color = RSBODY("Row1_Color")
If RS.BOF AND RS.EOF Then%>
" size="<%=RSBODY("Text_Size")%>">There are currently no questions in this category. |
<%Else%>
<%Do while NOT RS.EOF%>
" size="<%=RSBODY("Text_Size")%>">"><%=RS("Question")%> |
" size="<%=RSBODY("Text_Size")%>"><%=RS("DateUpdated")%> |
<%RS.movenext
If color = RSBODY("Row1_Color") Then
color = RSBODY("Row2_Color")
Else
color = RSBODY("Row1_Color")
End If
Loop%>
<%End If
ElseIf request("Action") = "Search" Then
color = RSBODY("Row1_Color")
If RS.BOF AND RS.EOF Then%>
" size="<%=RSBODY("Text_Size")%>">There are currently no matches for your search. |
<%Else%>
<%Do while NOT RS.EOF%>
" size="<%=RSBODY("Text_Size")%>">"><%=RS("Question")%> |
" size="<%=RSBODY("Text_Size")%>"><%=RS("DateUpdated")%> |
<%RS.movenext
If color = RSBODY("Row1_Color") Then
color = RSBODY("Row2_Color")
Else
color = RSBODY("Row1_Color")
End If
Loop%>
<%End If
ElseIf request("Action") = "New" Then
color = RSBODY("Row1_Color")
i = 1
If RS.BOF AND RS.EOF Then%>
" size="<%=RSBODY("Text_Size")%>">There are currently no new questions. |
<%Else%>
<%Do while NOT RS.EOF AND i <= 5%>
" size="<%=RSBODY("Text_Size")%>">"><%=RS("Question")%> |
" size="<%=RSBODY("Text_Size")%>"><%=RS("DateUpdated")%> |
<%RS.movenext
i = i + 1
If color = RSBODY("Row1_Color") Then
color = RSBODY("Row2_Color")
Else
color = RSBODY("Row1_Color")
End If
Loop%>
<%End If
Else
Set RSCat = Server.CreateObject("ADODB.Recordset")
SQLCat = "SELECT * from Categories ORDER BY Category"
RSCat.Open SQLCat, Conn, 1, 3
If NOT (RSCat.BOF AND RSCat.EOF) Then
Set RSQ = Server.CreateObject("ADODB.Recordset")
%>
<%Do While NOT RSCat.EOF%>
<%SQLQ = "SELECT * from Questions WHERE Category=" & RSCat("ID") & " AND NOT Pending"
RSQ.Open SQLQ, Conn, 1, 3%>
" size="<%=RSBODY("Text_Cat_Size")%>">"><%=RSCat("Category")%> (<%=RSQ.recordcount%>) |
<%RSQ.close
RSCat.movenext
If NOT RSCat.EOF Then
SQLQ = "SELECT * from Questions WHERE Category=" & RSCat("ID") & " AND NOT Pending"
RSQ.Open SQLQ, Conn, 1, 3%>
" size="<%=RSBODY("Text_Cat_Size")%>">"><%=RSCat("Category")%> (<%=RSQ.recordcount%>) |
<%RSQ.close
RSCat.movenext
End If
Loop%>
<%Set RSQ = Nothing
End If
RSCat.close
Set RSCat = Nothing
End If%>
|
"> |
|
"> |
Maintained with the Ocean12 FAQ Manager Pro v1.01
©2002 Ocean12 Technologies, all rights reserved. |
<%=RSBODY("Footer")%>
<%
RSBODY.close
Set RSBODY = Nothing
Conn.close
set Conn = nothing
%>