<%@ page import="java.util.*" %> <%@ page import="net99.util.Functions" %> <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> <% net99.util.Database db = new net99.util.Database(); long timeStart = System.currentTimeMillis(); request.setCharacterEncoding("ISO-8859-1"); String pre = "cms_"; int keepTime = 86400; int content_other = 256; HashMap conf = new HashMap(); conf.put("page_size", request.getParameterMap().containsKey("psize") ? request.getParameter("psize").toString() : "10"); conf.put("page_other", "5"); conf.put("page_start", "首页"); conf.put("page_up", "上一页"); conf.put("page_next", "下一页"); conf.put("page_end", "尾页"); boolean actResult = srh.processRequest(db, request, response, pre, keepTime); List lsResult = null; if(actResult) { lsResult = srh.listResult(db, pre, conf); } db.Close(); float timeExec = (float)(System.currentTimeMillis() - timeStart) / 1000; out.clearBuffer(); %> <%= srh.get("q") %>(高级搜索-中国公众科技网)
高级搜索
搜索结果 " /> 搜索内容 " size="20" maxlength="64"/>
搜索标题 0) ? srh.get("q") : "" %>" size="20" maxlength="64"/> " />
搜索图片 0) ? srh.get("q") : "" %>" size="20" maxlength="64"/> " />
搜索作者 " size="20" maxlength="64"/>
搜索结果显示条数 选择搜索结果显示的条数
时间 限定要搜索的网页时间是 开始: 月 结束:
栏目 限定要搜索的网页栏目是
<% if(!actResult) {%> <% } else { %>
搜索结果: 共找到 <%= srh.get("result_count") %> 条记录, 用时 <%= timeExec %> 秒
<% List lsKey = srh.listKey(srh.get("q")); ListIterator li = lsResult.listIterator(); ListIterator liTmp; HashMap hm; String content, key; while(li.hasNext()) { hm = (HashMap)li.next(); content = hm.get("news_content").toString(); content = content.replaceAll("<[^>]+>", ""); liTmp = lsKey.listIterator(); key = liTmp.next().toString(); int index = content.indexOf(key); if(index > content_other && (index + content_other / 2) < content.length()) { content = "... " + content.substring(index - content_other / 2, index + content_other / 2) + " ..."; } else if(index > content_other) { content = "... " + content.substring(index - content_other); } else if(content.length() >= content_other) { content = content.substring(0, content_other) + " ..."; } liTmp = lsKey.listIterator(); while(liTmp.hasNext()) { key = liTmp.next().toString(); content = content.replaceAll(key, "" + key + ""); } String title_list = hm.get("title_list").toString(); liTmp = lsKey.listIterator(); while(liTmp.hasNext()) { key = liTmp.next().toString(); title_list = title_list.replaceAll(key, "" + key + ""); } %>
"><%= title_list %>
<%= content %>
<%= hm.get("publish_url") %> <%= Functions.DateFormat("yyyy-MM-dd HH:mm", Functions.toInt((String)hm.get("news_time"))) %> <%= hm.get("news_author") %>(<%= hm.get("news_from") %>)

<% } %>
  <%= srh.navigatePage(srh.getInt("page_size"), srh.getInt("result_count"), srh.getInt("pg") , Functions.getHref(request, "", "", "q, c, img, author, from, starty, startm, endy, endm, encode, pg, submit", "q=" + Functions.encodeUrl(srh.get("q")) + "&c=" + srh.get("c") + "&img=" + srh.get("img") + "&author=" + Functions.encodeUrl(srh.get("author")) + "&from=" + Functions.encodeUrl(srh.get("from")) + "&starty=" + srh.get("starty") + "&startm=" + srh.get("startm") + "&endy=" + srh.get("endy") + "&endm=" + srh.get("endm") + "&pg=#"), "", conf) %>
<% } %>

<%= "" %>