⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 本系统是一套开源WEB的网站管理系统
💻 ASP
字号:
<!--#include file="include/ms_setting.asp"-->
<%'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1   Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com   www.maosin.net
'      QQ:57861417  
'电子邮箱:maosin@163.com  maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
%>
<!--#include file="ms_start.asp"-->
<!--页面主体开始-->
<script language="JavaScript" src="include/wisdom.js"></script>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="mainMiddle_tdble"><tr>
<!--左栏开始-->
<td valign="top" class="mainMiddle_td_left">
		<div class="groupblock">
		<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">会员登录</span></td><td class="ltr"></td></tr></table>
		<div class="lmc"><%Call publiclogonModule()%></div>
		</div>
		<div class="groupblock">
		<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="ltl"><script type="text/javascript">ico()</script></td><td class="ltc"><span class="tt">站内搜索</span></td><td class="ltr"></td></tr></table>
		<div class="lmc"><%Call searchInput("art")%></div>
		</div>
</td>
<td class="mainMiddle_td_middle" onClick="switchCol(this)" title="关闭左栏"><img src="images/closeL.gif"></td>
<td width="*" valign="top" class="mainMiddle_td_right">
<%	dim column,modese,sekeyword,mysql,msgtitle,showUrl
	Call Search()
%>
</td></tr></table>
<!--#include file="ms_end.asp"-->
<%
Sub Search()
	column=Request("typeSelect")
	modeSe=Request("modeSelect")
	sekeyword=trim(Replace(Request("selectkeyword"),"'",""))
	if column<>"" then
	if sekeyword="" then
		showmsg "<li>请您输入要搜索的关键字</li>","出错信息"
		exit sub
	end if
	end if
	if ms_submit=0 then
	if chkIsOut=false then
		showmsg "<font color=""#ff0000"">茂 盛系统返回如下信息:</font><br><br>对不起,本站不允许从外部提交数据","系统出错信息"
		exit sub
	end if
	end if
	Select Case column
		Case "suart"
		msgtitle="搜索文章→"
			ShowUrl="showart.asp?id="
			Select Case modeSe
				Case "suCentent"
					msgtitle=msgtitle&"搜索方式[<font color='#ff0000'>按内容</font>]"
					mysql="select a.id,a.art_title,a.art_date,a.art_clicks,c.class,c.classID,cat.catID from ms_art as a,ms_art_class as c,ms_art_cat as cat Where a.classID=c.classID and a.catID=cat.catID and a.art_content like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
				Case "suTitle"
					msgtitle=msgtitle&"搜索方式[<font color=#ff0000>按标题</font>]"
					mysql="select a.id,a.art_title,a.art_date,a.art_clicks,c.class,c.classID,cat.catID from ms_art as a,ms_art_class as c,ms_art_cat as cat Where a.classID=c.classID and a.catID=cat.catID and a.art_title like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
			End Select
		Case "sunews"
		tables="ms_news"
		msgtitle="搜索新闻→"
			ShowUrl="shownews.asp?id="
			Select Case modeSe
				Case "suCentent"
					msgtitle=msgtitle&"搜索方式[<font color='#ff0000'>按内容</font>]"
					mysql="Select id,news_title,news_date,news_clicks From ms_news Where news_content like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
				Case "suTitle"
					msgtitle=msgtitle&"搜索方式[<font color=#ff0000>按标题</font>]"
					mysql="Select id,news_title,news_date,news_clicks From ms_news Where news_title like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
			End Select
		Case "susofter"
		tables="ms_down"
		msgtitle="搜索软件→"
			ShowUrl="showdown.asp?id="
			Select Case modeSe
				Case "suCentent"
					msgtitle=msgtitle&"搜索方式[<font color='#ff0000'>按内容</font>]"
					mysql="Select id,down_title,down_date,down_clicks From ms_down Where down_content like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
				Case "suTitle"
					msgtitle=msgtitle&"搜索方式[<font color=#ff0000>按标题</font>]"
					mysql="Select id,down_title,down_date,down_clicks from ms_down Where down_title like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
			End Select
		Case "supic"
			msgtitle="搜索图片→"
			ShowUrl="showpic.asp?id="
			Select Case modeSe
				Case "suCentent"
					msgtitle=msgtitle&"搜索方式[<font color='#ff0000'>按内容</font>]"
					mysql="Select id,pic_title,pic_date,pic_clicks From ms_pic Where pic_content like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
				Case "suTitle"
					msgtitle=msgtitle&"搜索方式[<font color=#ff0000>按标题</font>]"
					mysql="Select id,pic_title,pic_date,pic_clicks From ms_pic Where pic_title like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
			End Select
		Case "sures"
			msgtitle="搜索资源→"
			ShowUrl="showres.asp?id="
			Select Case modeSe
				Case "suCentent"
					msgtitle=msgtitle&"搜索方式[<font color='#ff0000'>按内容</font>]"
					mysql="Select id,res_title,res_date,res_clicks From ms_res Where res_content like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
				Case "suTitle"
					msgtitle=msgtitle&"搜索方式[<font color=#ff0000>按标题</font>]"
					mysql="Select id,res_title,res_date,res_clicks From ms_res Where res_title like '%"&chkSearchStr(sekeyword)&"%'"
					Call showSearch()
			End Select
		Case Else
			Call searchCode()	
	End Select
End Sub
Sub showSearch()
	Set rs=Server.CreateObject("ADODB.RecordSet")
	rs.Open mysql,connstr,1,1
	rs.pagesize=5%>
	<div class="groupblock">
	<table cellspacing="0" class="naviTable"><tr><td class="naviL"></td><td class="naviM"><span class="rtt">站内搜索→<%=msgtitle%></span></td><td class="naviR"></td></tr></table>
	<div class="search_rmc">
	<div style="word-break:break-all;">搜索您输入的关键字:<font color="#FF0000"><%=replace(replace(sekeyword,"<","&lt;"),">","&gt;")%></font></div><br/>
	<%
	if rs.RecordCount=0 then
	Response.write("对不起,没有搜到你要的信息,请重新输入其它关键字再试试!")
	end if%>
	<div style="text-align:right;">共为您找到<font color="#FF0000"><%=rs.RecordCount%></font>条记录</div>
	</div>
	</div>
	<%If rs.RecordCount<>0 Then		
		n=20'每页显示记录数
		url=CurNamePage&"?typeSelect="&column&"&modeSelect="&modeSe&"&selectkeywords="&sekeyword&"&"
		nextpage=pagetitle(rs,n,url,"条记录")%>
		<table border="0" width="100%" cellpadding="4" bgcolor="#dddddd" cellspacing="1" class="tableBC">
		<tr valign="middle"><td width="*" align="center" class="seach_title">标&nbsp;&nbsp;&nbsp;&nbsp;题</td><td width="110" align="center" class="seach_title">发 表 时 间</td><td width="40" align="center" class="seach_title">浏 览</td></tr>
		<%lineNo=1
		Do While NOT rs.EOF AND lineNo<=rs.pagesize%>
		<tr class="tdBC">
			<td>☉<a href="<%=ShowUrl&rs(0)%>"><%=replace(rs(1),sekeyword,"<font color=#ff0000>"&sekeyword&"</font>")%></a></td>
			<td align="center"><%=rs(2)%></td>
			<td align="center"><%=rs(3)%></td>
		</tr>
		<%rs.MoveNext
		lineNo=lineNo+1
		Loop
		response.write("</table>")
	if rs.RecordCount>n then
		response.write("<div class=""page"">"&nextpage&"</div>")
	end if
	End If
	rs.close
	Set rs=Nothing
End Sub
Sub searchCode()%>
<table cellspacing="0" class="naviTable"><tr><td class="naviL"></td><td class="naviM"><span class="rtt">当前位置:<a class="classNavig" href="index.asp">本站首页</a>→<a class="classNavig" href="站内搜索.asp">站内搜索</a></span></td><td class="naviR"></td></tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="40" align="center" valign="middle"> <p>欢迎使用站内搜索</p></td>
  </tr>
<form name="ms_search" action="search.asp" method="post">
  <tr> 
    <td height="250" valign="middle" style="padding-left:70px;"> 搜索栏目: 
      <input type="radio" name="typeSelect" id="news" value="sunews" checked><label for="news">新闻</label> 
	  <input type="radio" name="typeSelect" id="art" value="suart"><label for="art">文章</label> 
	  <input type="radio" name="typeSelect" id="soft" value="susofter"><label for="soft">软件</label> 
      <input type="radio" name="typeSelect" id="pic" value="supic"><label for="pic">图片</label> 
	  <input type="radio" name="typeSelect" id="res" value="sures"><label for="res">资源</label><br><br>
      搜索方式: 
      <input type="radio" name="modeSelect" id="title" value="suTitle" checked><label for="title">标题</label> 
	  <input type="radio" name="modeSelect" id="centent" value="suCentent"><label for="centent">内容</label> <br><br>
      关 键 字:
	  <input name="selectkeyword" class="wenbenkang" type="text" size="30"> 
      <br><br> 
	  <span style="padding-left:70px;"><input type="submit" name="Submit" value="开始搜索" class="but1" onMouseOver="this.className='but2'" onMouseOut="this.className='but1'"></span>
	<p>
	<b>搜索说明:</b><br/>
	1、选择您要搜索的栏目。<br/>
	2、选择您要搜索方式,如按“标题”或“内容”。<br/>
	3、输入的关健字越简短,越容易搜索到您想要的结果。<br/>
	</p>
	  </td>
  </tr>
</form>
</table>
<%End Sub
'========================================================
'MaoSin CMS 1.1      Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com  http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -