<% on error resume next dirs = "../" CatID = 56 SYear = Request("SYear") SMonth = Request("SMonth") EYear = Request("EYear") EMonth = Request("EMonth") SCatID = Request("SCatID") SType = Request("SType") q = Request("q") %> 台灣 噶瑪滇真聽列惹薩‧噶瑪噶居寺資訊網‧法音訊息
      <%=Cascade%>
 資料庫檢索    選擇分類 關鍵字 Google™ 資料庫
 
<% if q <> "" then q = Replace(q, "'", "''") if SType = "每日一語" then sql = "select p.Subject, p.Abstract, p.Content, p.CatID, p.PID, p.CatD, p.PostTime from tblPost p, Category c where (p.Abstract like '%" & q & "%') " sql = sql & " and c.CatPIDList like '%,20,%' and c.CatD = 'l' and p.CatID = c.CatID " sql = sql & " order by p.pOrder desc" elseif SType = "上師開示" then sql = "select p.Subject, p.Content, p.CatID, p.PID, p.CatD from tblPost p, Category c where online = 'y' and (subject like '%" & q & "%' or Content like '%" & q & "%') " sql = sql & " and c.CatPIDList like '%,34,%' and c.CatD = 'l' and p.CatID = c.CatID " sql = sql & " order by p.pOrder desc" else sql = "select Subject, Content, CatID, PID, PostTime, filepath from tblPost where online = 'y' and (subject not like '%每日一語%') and (CatID <> 89) and (CatD = 'l')" sql = sql & " and (subject like '%" & q & "%' or Content like '%" & q & "%' or Author like '%" & q & "%') " if Trim(SYear) <> "" and Trim(SMonth) <> "" and Trim(SDate) <> "" then if IsNumeric(SYear) then if IsNumeric(SMonth) then SDate = SYear & "/" & SMonth & "/1" else SDate = SYear & "/1/1" end if sql = sql & " and PostTime > '" & SDate & "' " end if end if if Trim(EYear) <> "" and Trim(EMonth) <> "" and Trim(EDate) <> "" then if IsNumeric(EYear) then if IsNumeric(EMonth) then EDate = dateadd("m", 1, EYear & "/" & EMonth & "/1") else EDate = dateadd("y", 1, EYear & "/1/1") end if sql = sql & " and PostTime < '" & EDate & "' " end if end if sql = sql & " order by pOrder desc " end if else sql = "select Subject, Content, CatID, PID, PostTime, filepath from tblPost where online = 'y' and (CatD = 'l') order by pOrder desc " end if set rs = server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3, 1 %>
<%=rs.RecordCount%> 筆
<% if not rs.EOF then %> <% response.Write("") end if rs.close set rs = nothing %>
<% rs.PageSize = 10 if Request("PageNo") = "" then PageNo = 1 else PageNo = Cint(Request("PageNo")) End if rs.AbsolutePage = PageNo response.Write("
    ") For I = 1 to rs.PageSize if SType <> "每日一語" then response.Write("
  1. " & rs("Subject") & "  " & rs("PostTime") & "
    ") body = rs("Content") body = Replace(body, " ", "") body = Replace(body, " ", "") While InStr(body,"<")>0 start = InStr(body,"<") endstart = InStr(body,">") body = Mid(body,1,start-1) & Mid(body,endstart+1) Wend start = InStr(body,q) if start>31 then sword = "......" & Replace(mid(body,start-30,100), q, ""& q &"",1) & "......" else sword = Replace(mid(body,1,100), q, ""& q &"",1) & "......" end if response.Write(sword) response.Write("
  2. ") else response.Write("
  3. " & rs("PostTime") & "
    " & rs("Abstract") & "
  4. ") end if rs.MoveNext If rs.EOF then Exit for Next response.Write("
") %>
") pagestart = (((PageNo-1)\10)) * 10 +1 j = pagestart + 9 if PageNo > 10 then response.Write("上10頁") end if For i = pagestart to j If i = Cint(PageNo) then response.Write("[" & i & "]  ") else response.Write("" & i & "  ") End if if i = rs.PageCount then exit for Next if rs.PageCount > 10 and j < rs.PageCount then response.Write("下10頁") end if response.write("
<% %>