%
search = Request("search")
criteria = Request("criteria")
set conn = GetSQLServerConnection()
if search = "" then
SQL = "Select * from Counseling_forum where fdate <='" & date &"' order by fdate desc, tdate desc"
set rs = GetSQLServerRecordset(conn,SQL)
ElseIf criteria = "both" Then
SQL = "Select * from Counseling_forum where main = '1' And (title Like '%" & search & "%' Or content Like '%" & search & "%') and fdate <= '" & date & "' Order By fdate asc, tdate asc"
Set rs = GetSQLServerRecordset(conn, SQL)
Else
SQL = "Select * from Counseling_forum where main = '1' And " & criteria & " Like '%" & search & "%' and fdate <= '" & date & "' order By fdate asc, tdate asc"
Set rs = GetSQLServerRecordset(conn, SQL)
End If
cid = request("cid")
cid = CInt(cid)
set conn = GetSQLServerConnection()
if cid = 0 then
response.redirect "forum.asp"
else
SQL = "Select * from Counseling_forum where cid = " & cid & " and main = 1"
set rs = GetSQLServerRecordset(conn, SQL)
SQL = "Select * from Counseling_forum where reply_cid = '" & cid & "' and main = '0' and flag = '1' order by rid desc"
set reply_rs = GetSQLServerRecordset(conn, SQL)
end if
reply_rs.PageSize = 10
if page = "" or page < 1 then
page = 1
elseif page > rs.PageCount then
page = 1
end if
%>
Youth-2000.com [滅罪會 On-line Counseling]