<!--#include file="inc/system.asp" -->
<%
function tempclass(mb)
yidacms=yidat1(mb):yidacms=sys(yidacms):yidacms=memu(yidacms):yidacms=Y_memu(yidacms):yidacms=Flash(yidacms)
yidacms=News(yidacms):yidacms=Newsclass(yidacms):yidacms=About(yidacms):yidacms=Connect(yidacms):yidacms=Aboutclass(yidacms)
yidacms=Products(yidacms):yidacms=Productsclass(yidacms):yidacms=Productsxunhuan(yidacms):yidacms=Liuyan(yidacms)
yidacms=Dingdan(yidacms):yidacms=Yidong(yidacms):yidacms=video(yidacms):yidacms=Fanhui(yidacms):yidacms=Swsy(yidacms)
yidacms=Scbz(yidacms):yidacms=qqkefu(yidacms):yidacms=shijian(yidacms):yidacms=gb_music(yidacms):yidacms=Yidacms_tag(yidacms)
yidacms=Yidacms_ad(yidacms):yidacms=Yidacms_ad_floating(yidacms):yidacms=Yidacms_ad_couplets(yidacms):yidacms=Yidacms_ad_popup(yidacms)
yidacms=Search(yidacms):yidacms=Photoclass(yidacms):yidacms=Photo(yidacms)
%>
<!--#include file="inc/chajian.asp" -->
<%
'##########################
tempclass=yidacms
end function
response.write search_temp() & o

'*******************************************************
'易达CMS中小企业快速建站系统
'软件开发 黑龙江省世纪伟成网络科技有限公司
'网址：http://yidacms.com
'软件享有著作权，未经公司或开发者同意禁止更改以下代码。
'*******************************************************

'以下是搜索样式代码

function tSearch()
yidacms_l=request("l")
yidacms_n=request("n")
yidacms_y=request("yidacms_search")

if yidacms_n = "" then
		response.write ("<script language=javascript> alert('请输入搜索关键字!');history.back(-1);</script>")
		response.end
end if

if yidacms_y = "baidu" then
		Response.Redirect("http://www.baidu.com/s?wd="&yidacms_n&"")
		response.end
		
				else

if yidacms_l = "" then
		response.write ("<script language=javascript> alert('请选择搜索对应的栏目!');history.back(-1);</script>")
		response.end
end if

end if

set rs = server.createobject("adodb.recordset")
if yidacms_l = "news" then
	sql="select * from [shuaiweb_news] where (shuaiweb_newstitle like '%"&yidacms_n&"%') or (shuaiweb_newsContent like '%"&yidacms_n&"%') order by id desc" 
		elseif yidacms_l = "products" then
			sql="select * from [shuaiweb_products] where (shuaiweb_productsname like '%"&yidacms_n&"%') or (shuaiweb_productscontent like '%"&yidacms_n&"%') or (shuaiweb_productsbprice like '%"&yidacms_n&"%') or (shuaiweb_productsmodel like '%"&yidacms_n&"%') order by id desc" 
						elseif yidacms_l = "photo" then
							sql="select * from [shuaiweb_photo] where shuaiweb_photoname like '%"&yidacms_n&"%'  order by id desc" 
end if

rs.open sql,dbok,1,1

		if rs.bof and rs.eof then
      		tSearch = tSearch & "暂无记录!"&vbcrlf
				Else
      tSearch = tSearch & "<table width='100%' border='0' align='left' cellpadding='5' cellspacing='0'>"&vbcrlf
do while not rs.eof

if yidacms_l = "news" then
	yidacms_search_rsnt = rs("shuaiweb_newstitle")
	yidacms_search_rsnc = left(RemoveHTML(rs("shuaiweb_newsContent")),130)
		elseif yidacms_l = "products" then
	yidacms_search_rspt = rs("shuaiweb_productsname")
	yidacms_search_rspc = left(RemoveHTML(rs("shuaiweb_productscontent")),130)
		elseif yidacms_l = "photo" then
	yidacms_search_rspt = rs("shuaiweb_photoname")
	yidacms_search_rspc = left(RemoveHTML(rs("shuaiweb_photocontent")),130)
end if

yidacms_search_red = "<font color='red'>" & yidacms_n & "</font>"
yidacms_search_rsred_news = replace (yidacms_search_rsnt,yidacms_n,yidacms_search_red)
yidacms_search_rsred_newsc = replace (yidacms_search_rsnc,yidacms_n,yidacms_search_red)
yidacms_search_rsred_products = replace (yidacms_search_rspt,yidacms_n,yidacms_search_red)
yidacms_search_rsred_productsc = replace (yidacms_search_rspc,yidacms_n,yidacms_search_red)
yidacms_search_rsred_photo = replace (yidacms_search_rspt,yidacms_n,yidacms_search_red)
yidacms_search_rsred_photoc = replace (yidacms_search_rspc,yidacms_n,yidacms_search_red)

if yidacms_l = "news" then

if Language = "ch" then
 if yida_url = "asp" then
  Getnewsurl = webpath & "zh_news_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Getnewsurl = webpath & "html/news/news_"&rs("id")&".html"
 end if
elseif Language = "en" then
 if yida_url = "asp" then
  Getnewsurl = webpath & "en_news_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Getnewsurl = webpath & "html/en_news/news_"&rs("id")&".html"
 end if
end if

      tSearch = tSearch & "	<tr>"&vbcrlf
      tSearch = tSearch & "		<td>·<a href='"&Getnewsurl&"' style='font-size:14px' target='_blank'>"&yidacms_search_rsred_news&"</a></td></tr>"&vbcrlf
      tSearch = tSearch & "		<tr><td><div style='font-size:11px; color:#CCCCCC; border-bottom:1px #CCCCCC solid;'>"&yidacms_search_rsred_newsc&"</div></td>"&vbcrlf
      tSearch = tSearch & "	</tr>"&vbcrlf


elseif yidacms_l = "products" then

if Language = "ch" then
 if yida_url = "asp" then
  Productsurl = webpath & "zh_products_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Productsurl = webpath & "html/products/products_"&rs("id")&".html"
 end if
elseif Language = "en" then
 if yida_url = "asp" then
  Productsurl = webpath & "en_products_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  Productsurl = webpath & "html/en_products/products_"&rs("id")&".html"
 end if
end if

if trim(rs("shuaiweb_productsminpic")) <> "" then
 productsxiaotu = sw_dizhi & rs("shuaiweb_productsminpic")
  else
 productsxiaotu = sw_dizhi & "images/Without.gif"
end if

if trim(rs("shuaiweb_productsmaxpic")) <> "" then
 productsdatu = sw_dizhi & rs("shuaiweb_productsmaxpic")
  else
 productsdatu = sw_dizhi & "images/Without.gif"
end if


      tSearch = tSearch & "	<tr>"&vbcrlf
      tSearch = tSearch & "		<td width='120' rowspan='2'><img src='"&productsdatu&"' width='110' height='110' /></td>"&vbcrlf
      tSearch = tSearch & "		<td><a href='"&Productsurl&"' style='font-size:14px' target='_blank'>"&yidacms_search_rsred_products&"</a></td>"&vbcrlf
      tSearch = tSearch & "	</tr>"&vbcrlf
      tSearch = tSearch & "  	<tr>"&vbcrlf
      tSearch = tSearch & "     	<td><div style='font-size:12px; color:#CCCCCC; border-bottom:1px #CCCCCC solid;'>"&yidacms_search_rsred_productsc&"</div></td>"&vbcrlf
      tSearch = tSearch & "  	</tr>"&vbcrlf

elseif yidacms_l = "photo" then

if Language = "ch" then
 if yida_url = "asp" then
  GetPhotourl = webpath & "zh_photo_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  GetPhotourl = webpath & "html/photo/photo_"&rs("id")&".html"
 end if
elseif Language = "en" then
 if yida_url = "asp" then
  GetPhotourl = webpath & "en_photo_view.asp?id=" & rs("id")
   elseif yida_url = "html" or yida_url = "asphtml" then
  GetPhotourl = webpath & "html/en_photo/photo_"&rs("id")&".html"
 end if
end if

      tSearch = tSearch & "	<tr>"&vbcrlf
      tSearch = tSearch & "		<td width='120' rowspan='2'><img src='"&rs("shuaiweb_photoimg1")&"' width='110' height='110' /></td>"&vbcrlf
      tSearch = tSearch & "		<td><a href='"&GetPhotourl&"' style='font-size:14px' target='_blank'>"&yidacms_search_rsred_photo&"</a></td>"&vbcrlf
      tSearch = tSearch & "	</tr>"&vbcrlf
      tSearch = tSearch & "  	<tr>"&vbcrlf
      tSearch = tSearch & "     	<td><div style='font-size:12px; color:#CCCCCC; border-bottom:1px #CCCCCC solid;'>"&yidacms_search_rsred_photoc&"</div></td>"&vbcrlf
      tSearch = tSearch & "  	</tr>"&vbcrlf

end if

rs.MoveNext 
loop

      tSearch = tSearch & "</table>"&vbcrlf

		end if

	set rs=server.createobject("adodb.recordset")
	sql="select * from shuaiweb_search where searchtitle = '"&yidacms_n&"'"  
	rs.open sql,dbok,1,3

	if not rs.bof and not rs.eof then
			rs("searchnumber") = rs("searchnumber") + 1
				else
			rs.addnew
			rs("searchtitle") = yidacms_n
			rs("searchnumber") = 1	
	end if
	rs.update

end function

function Search(a)
a = replace(a,"{yidacms:search}",tSearch)
Search = a
end function
%>