www.gusucode.com > 全球营销软件站整站源码4月最新数据 4.0源码程序 > 801wyxqf\adminadmin\article\admin_search.asp
<!--#include file="const.asp"--> <!--#include file="../../inc/cls_keyword.asp"--> <% Admin_header '===================================================================== ' 软件名称:801w软件代理系统 ' 当前版本:NewAsp Content Management System Version 4.0 ' 文件名称:admin_main.asp ' 更新日期:2008-5-16 ' 官方网站:801w代理系统(www.801w.cn www.801w.com) QQ:274667447 '===================================================================== ' Copyright 2003-2008 801w.cn - All Rights Reserved. ' newasp is a trademark of 801w.cn '===================================================================== Dim maxperpage,totalrec,Pcount,pagelinks,pagenow Dim classid,SQLQuery,SQLField,searchTopic,searchmode,searchfield,fieldName Dim ChildData,ischild,childstr,Keyword,searchMaxResult,ArryWords() Keyword = Trim(Request("word")) searchmode = NewAsp.ChkNumeric(Request("searchmode")) searchfield = NewAsp.ChkNumeric(Request("searchfield")) searchMaxResult = 1000 %> <table class="table1" cellspacing="1" cellpadding="3" align="center" border="0"> <tr> <td class="tableline" align="left"><form name="search_form" id="search_form" method="get" action="admin_search.asp"> <span style="position:relative"> <input type="hidden" name="ChannelID" value="<%=ChannelID%>"> <input type="text" class="alingmid" id="searchwordbox" name="word" size="45" onfocus="if(this.value=='请输入关键字')this.value=''" value="<%=Server.HTMLEncode(Keyword)%>" /> <select name="searchfield" class="alingmid"> <option value="0">标题</option> <option value="1"<%If searchfield=1 Then Response.Write " selected=""selected"""%>>录入者</option> <option value="2"<%If searchfield=2 Then Response.Write " selected=""selected"""%>>作者</option> <option value="3"<%If searchfield=3 Then Response.Write " selected=""selected"""%>>来源</option> <option value="9"<%If searchfield=9 Then Response.Write " selected=""selected"""%>>标签</option> </select> <input type="submit" value="开始搜索" name="search_submit" class="button alingmid" /> <input type="checkbox" id="searchmode" name="searchmode" value="1" class="alingmid"<%If searchmode=1 Then Response.Write " checked=""checked"""%> /><label for="searchmode">分词搜索</label> <div style="display:none" id="sugAutoComplete" onselectstart="return false"> </div></span> </form> </td> <td class="tableline" id="searchInfo" align="right"> </td> </tr> </table> <% Call LoadAutoComplete("search_form") If Not ChkAdmin("List_"&ChannelID) Then Call Transfer_error() End If If Len(Keyword)>1 Then Call showmain() End If Admin_footer NewAsp.PageEnd Sub showmain() Dim i,iCount,lCount,iIndex maxperpage=30 iIndex = 0 pagenow=NewAsp.ChkNumeric(Request("page")) If pagenow=0 Then pagenow=1 classid=NewAsp.ChkNumeric(Request("classid")) If classid>0 Then ChildData=NewAsp.GetChildData(ChannelID,classid,0) childstr=ChildData(0) ischild=CLng(ChildData(2)) End If SQLField = "A.ArticleID,A.ChannelID,A.classid,A.specialid,A.title,A.ColorMode,A.FontMode,A.BriefTopic,A.isTop,A.AllHits,A.WriteTime,A.username,A.isBest,A.isaccept,C.ClassName" %> <table id="tablehovered" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder"> <tr> <th width="5%" noWrap="noWrap">选择</th> <th width="60%"><%=NewAsp.ModuleName%>标题</th> <th width="9%" noWrap="noWrap">管理操作</th> <th width="5%" noWrap="noWrap">浏览数</th> <th width="9%" noWrap="noWrap">用户&评论</th> <th width="12%" noWrap="noWrap">整理日期</th> </tr> <tr> <td class="tablerow1" colspan="6" align="left" id="showNextPage"> </td> </tr> <form name="selform" method="post" action="admin_setting.asp?ChannelID=<%=ChannelID%>"> <input type="hidden" name="action" value="batch"> <% Call searchTopicList() iCount=2:lCount=2 If IsArray(searchTopic) Then For i=0 To Ubound(searchTopic,2) If Not Response.IsClientConnected Then Response.End If (i mod 2) = 0 Then iCount=2:lCount=1 Else iCount=1:lCount=2 End If %> <tr align="center"> <td class="tablerow<%=iCount%> hovered"><input type="checkbox" name="ArticleID" value="<%=searchTopic(0,i)%>"/></td> <td class="tablerow<%=iCount%> hovered" align="left">[<a href="admin_list.asp?ChannelID=<%=ChannelID%>&classid=<%=searchTopic(2,i)%>"><%=searchTopic(14,i)%></a>] <%=NewAsp.ReadBriefTopic(searchTopic(7,i))%> <a href="admin_list.asp?action=view&ChannelID=<%=ChannelID%>&ArticleID=<%=searchTopic(0,i)%>"><%=HighlightWord(searchTopic(4,i))%></a> <% If searchTopic(8,i)>0 Then Response.Write "<font color=""red""><b>顶</b></font>" If searchTopic(12,i)>0 Then Response.Write "<font color=""blue""><b>精</b></font>" %> </td> <td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><a href="admin_post.asp?action=edit&ChannelID=<%=ChannelID%>&ArticleID=<%=searchTopic(0,i)%>">编辑</a> | <a href="admin_setting.asp?action=del&ChannelID=<%=ChannelID%>&ArticleID=<%=searchTopic(0,i)%>" onclick="return confirm('<%=NewAsp.ModuleName%>删除后将不能恢复,您确定要删除吗?')">删除</a></td> <td class="tablerow<%=iCount%> hovered" noWrap="noWrap"><%=searchTopic(9,i)%></td> <td class="tablerow<%=iCount%> hovered" noWrap="noWrap" title="点击查看用户评论"><a href="admin_comment.asp?ChannelID=<%=ChannelID%>&ArticleID=<%=searchTopic(0,i)%>"><%=searchTopic(11,i)%></a></td> <td class="tablerow<%=iCount%>" noWrap="noWrap"><%=showDateTime(searchTopic(10,i),"yyyy-MM-dd")%></td> </tr> <% Next End If searchTopic=Null %> <tr> <td class="tablerow<%=lCount%>" colspan="6"><input class="button" type="button" name="chkall" value="全选" onClick="CheckAll(this.form)"><input class="button" type="button" name="chksel" value="反选" onClick="ContraSel(this.form)"> 管理选项: <select name="act"> <option value="0">请选择操作选项</option> <option value="批量删除">批量删除</option> <option value="批量置顶">批量置顶</option> <option value="取消置顶">取消置顶</option> <option value="批量推荐">批量推荐</option> <option value="取消推荐">取消推荐</option> <option value="批量审核">批量审核</option> <option value="取消审核">取消审核</option> <option value="更新时间">更新时间</option> <option value="生成HTML">生成HTML</option> </select> <input class="button" type="submit" name="submit_button1" value="执行操作" onclick="return confirm('您确定执行该操作吗?');"> <input class="button" type="submit" name="submit_button2" value="批量设置" onclick="document.selform.action.value='setting';"> <input class="button" type="submit" name="submit_button3" value="批量移动" onclick="document.selform.action.value='move';"> </td> </tr> </form> <tr> <td class="tablerow<%=iCount%>" align="right" colspan="6" id="NextPageText"> <var class="morePage"><%=showlistpage(pagenow,Pcount,maxperpage,totalrec,pagelinks)%></var></td> </tr> </table> <script type="text/javascript"> document.getElementById("showNextPage").innerHTML = document.getElementById("NextPageText").innerHTML; var searchEl=document.getElementById("searchInfo"); if(searchEl) searchEl.innerHTML = "找到相关结果约<%=totalrec%>条,用时<%=FormatNumber((Timer()-startime),3, -1)%>秒"; </script> <% End Sub Sub searchTopicList() Dim Rs,SQL,i,iCount,ArryKeyword totalrec=0 Select Case searchfield Case 0:fieldName="A.Title" Case 1:fieldName="A.username" Case 2:fieldName="A.Author" Case 3:fieldName="A.ComeFrom" Case 9:fieldName="A.Taglist" Case Else fieldName="A.Title" End Select pagelinks="admin_search.asp?channelid="&ChannelID&"&classid="&classid&"&word="&Keyword&"&searchmode="&searchmode&"&searchfield="&searchfield&"&" If Len(Keyword)>1 Then If searchmode=1 Then iCount=0 SQLQuery="" ArryKeyword = cmWords.ParseKeyword(Keyword) For i = 0 To UBound(ArryKeyword) If Len(ArryKeyword(i)) > 1 Then ReDim Preserve ArryWords(iCount) ArryWords(iCount)=ArryKeyword(i) If iCount=0 Then If IsSqlDataBase=1 Then SQLQuery=""&fieldName&" like '%"&ArryKeyword(i)&"%'" Else SQLQuery="InStr(1,LCase("&fieldName&"),LCase('"&ArryKeyword(i)&"'),0)>0" End If Else If IsSqlDataBase=1 Then SQLQuery=SQLQuery & " Or "&fieldName&" like '%"&ArryKeyword(i)&"%'" Else SQLQuery=SQLQuery & " Or InStr(1,LCase("&fieldName&"),LCase('"&ArryKeyword(i)&"'),0)>0" End If End If iCount=iCount+1 End If Next If iCount=0 Then SQLQuery="":ReDim Preserve ArryWords(0):ArryWords(0)="" Else If cmWords.CheckKeyword(Keyword) Then If IsSqlDataBase=1 Then SQLQuery = ""&fieldName&" like '%"&Keyword&"%'" Else SQLQuery = "InStr(1,LCase("&fieldName&"),LCase('"&Keyword&"'),0)>0" End If ReDim Preserve ArryWords(0):ArryWords(0)=Keyword Else SQLQuery="":ReDim Preserve ArryWords(0):ArryWords(0)="" End If End If If Len(SQLQuery) >10 Then SQLQuery=" And ("&SQLQuery&")" Else SQLQuery="" If classid>0 Then If ischild>0 Then SQLQuery=" And A.isAccept=1 And A.classid in (" & childstr & ") "&SQLQuery Else SQLQuery=" And A.isAccept=1 And A.classid="&classid&" "&SQLQuery End If Else SQLQuery=" And A.isAccept=1 "&SQLQuery End If If Not IsObject(Conn) Then ConnectionDatabase Set Rs=NewAsp.CreateAXObject("ADODB.Recordset") SQL="SELECT TOP "&searchMaxResult&" "& SQLField &" FROM [NC_Article] A INNER JOIN [NC_Classify] C on A.ClassID=C.ClassID WHERE A.ChannelID=" &ChannelID& " "&SQLQuery&" ORDER BY A.WriteTime DESC" Rs.Open SQL,Conn,1,1 If pagenow >1 Then Rs.Move (pagenow-1) * maxperpage End If If Not Rs.EOF Then totalrec = CLng(Rs.Recordcount) '###记录总数 searchTopic=Rs.GetRows(maxperpage) Else searchTopic=Null End If Rs.close() Set Rs=Nothing End If Pcount = CLng(totalrec / maxperpage) If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1 If pagenow>Pcount Then pagenow=1 End Sub Function HighlightWord(str) Dim i For i=0 To UBound(ArryWords) If ArryWords(i)<>"" Then str=Replace(str, ArryWords(i), "<font color=""red"">"& ArryWords(i) &"</font>") Next HighlightWord=str End Function %>