<!--#include file="BlogCommon.asp" -->
<!--#include file="header.asp" -->
<!--#include file="common/ModSet.asp" -->
<!--#include file="plugins.asp" -->
<%
'==================================
'  查询页面
'    更新时间: 2005-10-28
'==================================

'处理面板
Dim searchType
IF CheckStr(Request.QueryString("searchType"))<>Empty Then
  searchType=CheckStr(Request.QueryString("searchType"))
Else
  searchType="title"
End if
function getSType(searchType)
  select case searchType
      case "title"
      getSType="日志标题"
      case "Content"
      getSType="日志内容"
      case "Comments"
      getSType="日志评论"
      case "trackback"
      getSType="引用通告"
     end select
end function
%>
 <!--内容-->
  <div id="Tbody">
   <div id="mainContent">
   <div id="innermainContent">
       <div id="mainContent-topimg"></div>
       <div id="Content_ContentList" class="content-width">
       	<div class="Content">
	     <div class="Content-top"><div class="ContentLeft"></div><div class="ContentRight"></div>
		      <h1 class="ContentTitle"><img src="images/search.gif" alt="" style="margin:0px 4px -3px 0px" class="CateIcon"/><strong>查询结果</strong></h1>
              <h2 class="ContentAuthor">search result</h2>
          </div>
          <%
          dim blog_Search,SearchContent
          SearchContent=CheckStr(Request.QueryString("SearchContent"))
          Url_Add="?SearchContent="&Server.URLEncode(SearchContent)&"&amp;searchType="&searchType&"&amp;"
          	Set blog_Search=Server.CreateObject("ADODB.RecordSet")
          	select case searchType
          	  case "title"
          	    if len(SearchContent)>0 then
          	      SQL="SELECT * FROM blog_Content WHERE log_IsShow=true AND log_Title LIKE '%"&SearchContent&"%'"
          	     else
          	      Response.Redirect("default.asp")
          	    end if
			  case "Content"
          	    if len(SearchContent)>0 then
			      SQL="SELECT * FROM blog_Content WHERE log_IsShow=true AND (log_Title LIKE '%"&SearchContent&"%' OR log_Content LIKE '%"&SearchContent&"%')"
          	     else
          	      Response.Redirect("default.asp")
          	    end if
          	 case "Comments"
			   if len(SearchContent)>0 then
			    SQL="SELECT T.*,C.* FROM blog_Comment C,blog_Content T WHERE C.blog_ID=T.log_ID AND T.log_IsShow=true AND C.comm_Content LIKE '%"&SearchContent&"%'"
          	   else
			    SQL="SELECT T.*,C.* FROM blog_Comment C,blog_Content T WHERE C.blog_ID=T.log_ID AND T.log_IsShow=true order by comm_ID desc"
          	   end if
          	  case "trackback"
			  if len(SearchContent)>0 then
          	    SQL="SELECT T.*,C.log_Title FROM blog_Content C,blog_Trackback T WHERE T.blog_ID=C.log_ID AND C.log_IsShow=true AND (tb_Title LIKE '%"&SearchContent&"%' or tb_Intro LIKE '%"&SearchContent&"%')"
          	   else
          	    SQL="SELECT T.*,C.log_Title FROM blog_Content C,blog_Trackback T WHERE T.blog_ID=C.log_ID AND C.log_IsShow=true order by tb_ID desc"
          	   end if
          	  case else
          	    if len(SearchContent)>0 then
          	      SQL="SELECT * FROM blog_Content WHERE log_IsShow=true AND log_Title LIKE '%"&SearchContent&"%'"
          	     else
          	      Response.Redirect("default.asp")
          	    end if
          	 end select
          	blog_Search.Open SQL,Conn,1,1
          	%>
      <div class="Content-Info">
		 <div class="InfoAuthor"> 查询类型 <b><%=getSType(searchType)%></b> | 关键词 <b><%=SearchContent%></b> | 共找到 <b><%=blog_Search.RecordCount%></b> 条记录</div>
     </div>
           
<%		
  IF blog_Search.EOF AND blog_Search.BOF Then
   response.write ("<b>没有找到符合条件的数据</b><br/><br/><a href=""default.asp"">返回</a><br/><br/>")
  else
	blog_Search.PageSize=10
	blog_Search.AbsolutePage=CurPage
	Dim Search_Nums
	Search_Nums=blog_Search.RecordCount
	Dim MultiPages,PageCount
	SQLQueryNums=SQLQueryNums+1
    response.write "<div class=""pageContent"">"&MultiPage(Search_Nums,10,CurPage,Url_Add,"","float:left")&"</div><div class=""Content-body"" style=""line-height:200%"">"
	Do Until blog_Search.EOF OR PageCount=blog_Search.PageSize
          	select case searchType
          	  case "title"
	          	Response.Write("<a href=""article.asp?id="&blog_Search("log_ID")&""" target=""_blank""> "&highlight(blog_Search("log_Title"),SearchContent)&" [ 日期: "&blog_Search("log_PostTime")&" | 评论数:"&blog_Search("log_CommNums")&"]</a><br/>")
			  case "Content"
	          	Response.Write("<a href=""article.asp?id="&blog_Search("log_ID")&"&keyword="&Server.URLEncode(SearchContent)&""" target=""_blank""> "&highlight(blog_Search("log_Title"),SearchContent)&" [ 日期: "&blog_Search("log_PostTime")&" | 评论数:"&blog_Search("log_CommNums")&"]</a><br/>")
			  case "Comments"
			  %>
	                <div class="commenttop"><img border="0" src="images/icon_quote.gif" alt="" style="margin:0px 4px -3px 0px"/></a><strong><%=blog_Search("comm_Author")%></strong> <span class="commentinfo">[<%=DateToStr(blog_Search("comm_PostTime"),"Y-m-d H:I A")%>]</span></div>
	                <div class="commentcontent"><%=highlight(UBBCode(HtmlEncode(blog_Search("comm_Content")),blog_Search("comm_DisSM"),blog_commUBB,blog_commIMG,blog_Search("comm_AutoURL"),blog_Search("comm_AutoKEY")),SearchContent)%></div>
	         <%
	         	Response.Write("<div class=""Content-bottom"">相关日志: <a href=""article.asp?id="&blog_Search("log_ID")&"#comm_"&blog_Search("comm_ID")&"""><b>"&blog_Search("log_Title")&"</b></a></div>")
          	  case "trackback"
          	  %>
	             <div class="commenttop"><img src="images/icon_trackback.gif" alt="" style="margin:0px 4px -3px 0px"/><strong><%=("<a href="""&blog_Search("tb_URL")&""">"&blog_Search("tb_Site")&"</a>")%></strong> <span class="commentinfo">[<%=DateToStr(blog_Search("tb_PostTime"),"Y-m-d H:I A")%>]</span></div>
	             <div class="commentcontent">
	            	<b>标题:</b> <%=highlight(blog_Search("tb_Title"),SearchContent)%><br/>
		            <b>链接:</b> <%=("<a href="""&blog_Search("tb_URL")&""" target=""_blank"">"&blog_Search("tb_URL")&"</a>")%><br/>
	             	<b>摘要:</b> <%=highlight(HTMLDecode(blog_Search("tb_Intro")),SearchContent)%><br/>
		         </div>
		   <%
	         	Response.Write("<div class=""Content-bottom"">相关日志: <a href=""article.asp?id="&blog_Search("blog_ID")&""" target=""_blank""><b>"&blog_Search("log_Title")&"</b></a></div>")
          	  case else
	        	Response.Write("<a href=""article.asp?id="&blog_Search("log_ID")&"""> "&blog_Search("log_Title")&" [ 日期: "&blog_Search("log_PostTime")&" | 评论数:"&blog_Search("log_CommNums")&"]</a><br/>")
          	end select
     	blog_Search.MoveNext
	    PageCount=PageCount+1
	loop
    response.write "</div><div class=""pageContent"">"&MultiPage(Search_Nums,10,CurPage,Url_Add,"","float:left")&"</div>"
    blog_Search.Close
    Set blog_Search=Nothing
  end if
%>         
         </div>
        </div>
       <div id="mainContent-bottomimg"></div>
   </div>
   </div>
   
   <%Side_Module_Replace '处理系统侧栏模块信息%>
   <div id="sidebar">
	   <div id="innersidebar">
		     <div id="sidebar-topimg"><!--工具条顶部图象--></div>
			  <%=side_html%>
		     <div id="sidebar-bottomimg"></div>
	   </div>
   </div>
   <div style="clear: both;height:1px;overflow:hidden;margin-top:-1px;"></div>
  </div>
 <!--#include file="footer.asp" -->