queryresult.jsp
上传用户:yuyunping
上传日期:2013-03-21
资源大小:1844k
文件大小:7k
源码类别:

Java书籍

开发平台:

Java

  1. <%@ page language="java"  contentType="text/html; charset=gb2312"%>
  2. <%@ include file="INC/const.jsp"%>
  3. <%@ page import = "java.util.Vector"%>
  4. <%
  5. stats=forumName+"论坛搜索结果";
  6. forumID=ParamUtil.getInt(request,"forumID",0);
  7. int perPage=ParamUtil.getInt(request,"perPage",10);
  8. int Page=ParamUtil.getInt(request,"Page",1);
  9. int startPage=((Page-1)/10)*10+1;
  10. int start=(Page-1)*perPage+1;
  11. %>
  12. <%@ include file="INC/theme.jsp"%>
  13. <%
  14. out.println(headLine(1,forumName,forumLogo,"",1,stats));
  15. %>
  16. <%
  17. try{
  18. ForumSearch forumSearch=new ForumSearch();
  19. Vector searchTopics=forumSearch.getResult(request,response);
  20. forumID=ParamUtil.getInt(request,"forumID",0);
  21. int sType=ParamUtil.getInt(request,"sType");
  22. int pSearch=ParamUtil.getInt(request,"pSearch",0);
  23. int nSearch=ParamUtil.getInt(request,"nSearch",0);
  24. String keyword=ParamUtil.getString(request,"keyword","");
  25. int searchDateLimit=30;
  26. String searchDate=ParamUtil.getString(request,"SearchDate");
  27. String orderName=forumSearch.getOrderName();
  28. int totalNum=forumSearch.getSearchTopicNum();
  29. %>
  30.             <table cellpadding=0 cellspacing=0 border=0 width="<%=tableWidth%>" align=center>
  31.             <tr><td><font color="<%=bodyFontColor%>">查询<%=searchDateLimit%>天内的帖子,<%=orderName%>共查询到<font color=<%=alertFontColor%>><%=totalNum%></font>个结果</font>
  32. </td>
  33.             </tr>
  34.             </table>
  35.             <table cellpadding=0 cellspacing=0 border=0 width="<%=tableWidth%>" bgcolor=<%=tableBackColor%> align=center>
  36.             <tr><td height=1>
  37. </td>
  38.             </tr>
  39.             </table>
  40. <TABLE bgColor="<%=tableBackColor%>" border=0 cellPadding=0 cellSpacing=0 width="<%=tableWidth%>" align=center>
  41.   <TBODY>
  42.   <TR>
  43.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  44.     <TD align=middle height=25 bgColor="<%=tableTitleColor%>" width=32><font color=<%=tableFontColor%>>状态</font></TD> 
  45.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  46.     <TD align=middle bgColor="<%=tableTitleColor%>" width=*><font color=<%=tableFontColor%>>主 题  (点心情符为开新窗浏览)</font></TD> 
  47.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  48.     <TD align=middle bgColor="<%=tableTitleColor%>" width=80><font color=<%=tableFontColor%>>作 者 </font></TD> 
  49.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  50.     <TD align=middle bgColor="<%=tableTitleColor%>" width=64><font color=<%=tableFontColor%>>回复/人气</font></TD>
  51.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td> 
  52.     <TD align=middle bgColor="<%=tableTitleColor%>" width=195><font color=<%=tableFontColor%>>作者 | 发表时间</font></TD>
  53.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td></TR> 
  54. </TBODY></TABLE>
  55.             <table cellpadding=0 cellspacing=0 border=0 width="<%=tableWidth%>" bgcolor=<%=tableBackColor%> align=center>
  56.             <tr><td height=1>
  57. </td>
  58.             </tr>
  59.             </table>
  60. <%
  61. for(i=0;i<searchTopics.size();i++){
  62. ForumTopic theTopic=(ForumTopic)searchTopics.get(i);
  63. %>
  64. <TABLE bgColor="<%=tableBackColor%>" border=0 cellPadding=0 cellSpacing=0 width="<%=tableWidth%>" align=center>
  65.   <TBODY>
  66.   <TR> 
  67.     <td bgcolor=<%=tableBackColor%> valign=middle width=1 height=24></td>
  68.     <TD align=middle bgColor="<%=tableBodyColor%>" width=32><font color=<%=tableContentColor%>>
  69. <%if (theTopic.getLockTopic()){%><img src=<%=picURL%>lockfolder.gif alt="本主题已锁定"><%} else {%><%if (theTopic.getChildNum()>10) {%><img src=<%=picURL%>hotfolder.gif><%}else{%><img src=<%=picURL%>folder.gif><%}%><%}%></font>
  70.     </TD> 
  71.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  72.     <TD bgColor=<%=tableBodyColor%> width=*><font color=<%=tableContentColor%>><a href='dispbbs.jsp?forumID=<%=theTopic.getForumID()%>&rootID=<%=theTopic.getRootID()%>&announceID=<%=theTopic.getAnnounceID()%>&skin=1' target=_blank><img src='<%=faceURL%><%if(theTopic.getExpression()!=null&&!"".equals(theTopic.getExpression())){%><%=theTopic.getExpression()%><%}else{%>face1.gif<%}%>' border=0 alt="开新窗口浏览此主题"></a> <a href='dispbbs.jsp?forumID=<%=theTopic.getForumID()%>&rootID=<%=theTopic.getRootID()%>&announceID=<%=theTopic.getAnnounceID()%>'><%=theTopic.getNoFilterTopic()%></a></font>    </TD> 
  73.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  74.     <TD align=middle bgColor="<%=tableBodyColor%>"  width=80><font color=<%=tableContentColor%>><a href="javascript:openScript('dispuser.jsp?name=<%=response.encodeURL(theTopic.getUserName())%>',350,300)"><%=response.encodeURL(theTopic.getUserName())%></a></font></TD> 
  75.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  76.     <TD align=middle bgColor="<%=tableBodyColor%>" width=64><font color=<%=tableContentColor%>><%=theTopic.getChildNum()%>/<%=theTopic.getHits()%></font></TD> 
  77.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td>
  78.     <TD bgColor=<%=tableBodyColor%> width=195><font color=<%=tableContentColor%>>&nbsp;
  79. <%=theTopic.getDateAndTime()%>
  80. &nbsp;<font color="<%=alertFontColor%>">|</font>&nbsp;
  81. <a href="javascript:openScript('dispuser.jsp?name=<%=response.encodeURL(theTopic.getUserName())%>',350,300)"><%=response.encodeURL(theTopic.getUserName())%></a>
  82. </FONT></TD>
  83.     <td bgcolor=<%=tableBackColor%> valign=middle width=1></td></TR> 
  84. </TBODY></TABLE>
  85.             <table cellpadding=0 cellspacing=0 border=0 width="<%=tableWidth%>" bgcolor=<%=tableBackColor%>  align=center>
  86.             <tr><td height=1>
  87. </td>
  88.             </tr>
  89.             </table>
  90. <%
  91. }
  92. int n;
  93.    if (totalNum % perPage==0)
  94.       n= totalNum/perPage;
  95.    else
  96.       n= totalNum / perPage+1;
  97.   
  98. %>
  99.    <script language="Javascript">
  100. function viewPage(ipage){
  101.         document.frmList2.Page.value=ipage
  102.         document.frmList2.submit() 
  103. }
  104.    </script>
  105. <table border="0" cellpadding="0" cellspacing="3" width="<%=tableWidth%>" align="center">
  106. <form method="post" action="queryresult.jsp" name="frmList2">
  107.   <tr>
  108.     <td valign="middle" nowrap><font color="<%=bodyFontColor%>">页次:<b><%=Page%></b>/<b><%=n%></strong>页 每页<b><%=perPage%></b> 总贴数<b><%=totalNum%></b></td>
  109.     <td valign="middle" nowrap><font color="<%=bodyFontColor%>">
  110.       <div align="right"><p>分页:
  111. <%
  112.   
  113.    for(int p=1;p<n+1;p++){
  114.    if (p<10){
  115.        if (p==Page){
  116.           out.println( "["+p+"] ");
  117.    }
  118.    else
  119.       out.println( "<a href='javascript:viewPage("+p+")' language='javascript'>["+p+"]</a>   ");
  120.    
  121. }
  122. }
  123. %>
  124. <span class="smallFont">转到:<input type="text" name="Page" size=3 maxlength=10  value="<%=Page%>"><input type="button" value="Go" language="javascript" onclick="viewPage(document.frmList2.Page.value)" id="button1" name="button1"></span></p>      
  125.       </div>    </font>
  126.     </td>
  127.   </tr>
  128. <input type="hidden" name="sType" value="<%=sType%>">
  129. <input type="hidden" name="pSearch" value="<%=pSearch%>">
  130. <input type="hidden" name="nSearch" value="<%=nSearch%>">
  131. <input type="hidden" name="keyword" value="<%=keyword%>">
  132. <input type="hidden" name="SearchDate" value="<%=ParamUtil.getString(request,"SearchDate")%>">
  133. <input type="hidden" name="forumID" value="<%=forumID%>">
  134. </form>
  135. </table>
  136. <%
  137. }
  138. catch(Exception e){
  139. e.printStackTrace();
  140. String errMsg=e.getMessage();
  141. %>
  142. <%@include file="INC/error.jsp"%>
  143. <%
  144. }%>
  145. <%@ include file="foot.jsp"%>