<%
action=request.QueryString("action")
if action="submit" then
question_title=trim(request.form("question_title"))
question_author=trim(request.form("question_author"))
question_text=request.Form("question_text")
dir_id=request.form("dir_id")
if len(question_title)<1 or len(question_text)<1 then
Response.Write("")
connclose
Response.End()
end if
'添加排名
sql="select top 1 * from faq"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("question_title")=question_title
rs("question_author")=question_author
rs("question_text")=question_text
rs("dir_id")=dir_id
rs("question_date")=now
rs.update
rs.close
set rs=nothing
Response.Write("")
end if
if id=0 then
where_dir="dir_id<>0"
else
where_dir="dir_id="&id
end if
where_dir="answer_text<>'' and "&where_dir
'列表
num=conn.execute("select count(post_id) from faq where "&where_dir)(0)
pagenum=(num-1)\NumPerPage+1
page=Request.QueryString("page")
if page-1<=0 then page=1
if page-pagenum>0 then page=pagenum
num_now=NumPerPage
if page-pagenum=0 then num_now=num-NumPerPage*(pagenum-1)
if num>0 then
'if begin
Response.Write("
"&vbcrlf)
set rs=conn.execute("select * from (select top "&num_now&" * from faq where (post_id >= (select min(post_id) from (select top "&NumPerPage*Page&" post_id from faq where "&where_dir&" order by question_date desc) as temp)) and "&where_dir&" order by question_date) order by question_date desc")
i=1
while not rs.eof
set rs_list=conn.execute("select dir_name,path_name from faq_dir where dir_id="&rs("dir_id"))
if not rs_list.eof then
path_name=rs_list("path_name")
dir_name=rs_list("dir_name")
dir_name=rs_list("dir_name")
end if
set rs_list=nothing
if i mod 2 <> 0 then
Response.Write("
"&vbcrlf)
else
Response.Write("
"&vbcrlf)
end if
rs.movenext
i=i+1
wend
set rs=nothing
Response.Write("
"&vbcrlf)
'end if
end if
%>