<%@page contentType="text/html" pageEncoding="GB2312" import="java.util.*,vportal.*"%> <%@ page import="java.text.*" %> <%@ page import="java.util.*" %> <%@ page import="org.dom4j.io.SAXReader" %> <%@ page import="java.net.URL" %> <%@ page import="openv.base.*" %> <%@ page import = "java.util.regex.*"%> <%! private String replaceHTMLCode(String s){ try{ s = s.replaceAll("(?s)<.*?>",""); }catch(Exception e){ } return s; } %> <% //request.setCharacterEncoding("GB2312"); String sortDefult = "r"; // String swDefult = "list"; // String q = vportal.Util.getStrDef(request.getParameter("q"),""); q = new String(q.getBytes("iso-8859-1"),"GBK").replaceAll("'|\"|<|>|&|\\$","").replaceAll("\\\\",""); if("".equals(q)){ q="news"; } String db = vportal.Util.getStrDef(request.getParameter("db"),"cctv9"); String sort = vportal.Util.getStrDef(request.getParameter("sort"),sortDefult).toLowerCase(); String sw = vportal.Util.getStrDef(request.getParameter("sw"),swDefult).toLowerCase(); if("".equals(sw)){ sw = "list"; } int pageIndex = vportal.Util.strToInt(request.getParameter("pageIndex")); if(pageIndex == 0){ pageIndex = 1; } int swfCount = 10; if("view".equals(sw)){swfCount=12;} CookieBean theCookieBean = new CookieBean(); int totalhits = vportal.Util.strToInt(theCookieBean.getCookieValue(request,"totalhits")); String cctvport = "31010"; Dre theDre = new Dre(); theDre.setPort(cctvport); theDre.setTotalhits(totalhits); java.util.HashMap paraMap = new java.util.HashMap(); if(sort.equals("d")){ paraMap.put("sort","date+Relevance"); }else{ paraMap.put("sort","Relevance+date"); } paraMap.put("highlight","terms+summaryterms"); paraMap.put("summary","context"); paraMap.put("characters","130"); paraMap.put("StartTag",""); theDre.setParaMap(paraMap); theDre.setDb(db); ArrayList listArrayList = theDre.queryAci(q,pageIndex,swfCount); totalhits = theDre.getTotalhits(); theCookieBean.addCookie(response,"totalhits",String.valueOf(totalhits)); //out.println("cmd:"+theDre.getCmd()); %> <%=q%>-CCTV
<% if(!"".equals(q)){ %>
About <%=q%>Search <%=totalhits%>Videos
<% }else{ %>
Search <%=totalhits%>Videos
<% } %>
<% if(sw.equals("list")){ %>
<% }else{ %>
<% } %>
    <% Video theVideo; if(listArrayList!=null){ int i = 0; for(Iterator it=listArrayList.iterator(); it.hasNext();) { i++; theVideo=(Video)it.next(); String link = "player.jsp?ref="+theVideo.getDrereference()+"&db="+db+"&kw="+vportal.Util.URLEncoderLoop(q,"utf-8",1); String title = theVideo.getDretitle(); title = replaceHTMLCode(title).replaceAll("'","£§"); if(sw.equals("list")){ String content = theVideo.getSummary(); %>
  • <%=theVideo.getDretitle()%>
    <%=content%>
    <%=theVideo.getDredbname()+"   "+theVideo.getProgramtitle()%>   <%=theVideo.getDredate10()%>
  • <% }else{ %>
  • <%=theVideo.getDredbname()+"   "%>
    <%=theVideo.getDredate10()%>
  • <% if(i%4 == 0 && i < (listArrayList.size()-1)){ out.println("
\n
    "); } } } } %>
<% java.util.HashMap map = new java.util.HashMap(); map.put("total",""+totalhits); map.put("perpage",""+swfCount); map.put("nowindex",""+pageIndex); map.put("url",""+"tvsearch.jsp?q="+java.net.URLEncoder.encode(q,"GBK")+"&sw="+sw+"&sort="+sort); map.put("page_name","pageIndex"); map.put("ajax",""); openv.base.Page thePage = new openv.base.Page(map); thePage.setFormat_left(""); thePage.setFormat_right(""); out.print(thePage.show(8)); %>