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

Java书籍

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ page import="net.acai.util.*,
  3.  net.acai.forum.*,
  4.  net.acai.forum.util.*,
  5.  java.util.Vector"%>
  6. <%@ include file="INC/const.jsp"%>
  7. <%
  8. int perPage=ParamUtil.getInt(request,"perPage",25);
  9. int Page=ParamUtil.getInt(request,"Page",1);
  10. int startPage=((Page-1)/10)*10+1;
  11. int start=(Page-1)*perPage+1;
  12. try{
  13. Forum theForum=ForumFactory.getForum(request,response,session,forumID);
  14. stats=theForum.getForumType();
  15. %>
  16. <%@ include file="INC/theme.jsp"%>
  17. <script language=javascript src="INC/list.js"></script>
  18. <% out.println(headLine(forumID,forumName,forumLogo,theForum.getForumType(),1,stats));
  19. %>
  20. <script language="javascript">
  21. var AutoRegStr="";
  22. var IsRoot = false;
  23. </script>
  24. <script language="javascript" src="js/Adv.js"></script>
  25. <script language="javascript" src="js/CheckClick.js"></script>
  26. <script language="javascript">Adv("","","","<a href=list.jsp?forumID=<%=forumID%>><img src=pic/ad.gif alt=<%=forumName%> border=0></a>","提示信息");</script>
  27. <script language="javascript">Adv("","");</script>
  28. <TABLE cellSpacing=0 cellPadding=0 width=95% border=0 align=center>
  29. <TBODY><tr>
  30. <td align=center width=34 valign=middle> <img src='pic/gb.gif' border=0 alt=本分论坛的公告!不可不看!! width=20 height=17> 
  31. </td>
  32. <td valign=middle align=left>
  33. <%
  34. try{
  35. ForumNews forumNews=ForumNewsManager.getForumNews(forumID);
  36. out.println("<b><a href=announcements.jsp?forumID="+forumID+"><ACRONYM TITLE="+forumNews.getTitle()+">"+forumNews.getTitle()+"</ACRONYM></a></b> ("+forumNews.getAddTime()+")" );
  37. }
  38. catch(ForumNewsNotFoundException e){
  39. out.println("<b><a href=announcements.jsp?forumID="+forumID+" target=_blank><ACRONYM TITLE=当前没有公告>当前没有公告</ACRONYM></a></b>("+NDate+")");
  40. }
  41. %>
  42. </td>
  43. <td align=right valign=middle><p>
  44. <form action=list.jsp method=get>
  45. <input type=hidden name=forumID value=<%=forumID%>>
  46. <select name=selTimeLimit onchange='javascript:submit()'>
  47. <option value=all>查看所有的主题
  48. <option value=1>查看一天内的主题
  49. <option value=2>查看两天内的主题
  50. <option value=7>查看一星期内的主题
  51. <option value=15>查看半个月内的主题
  52. <option value=30>查看一个月内的主题
  53. <option value=60>查看两个月内的主题
  54. <option value=180>查看半年内的主题
  55. </select>
  56. </form></p></td></tr></TBODY></TABLE>
  57. <table cellspacing=0 border=0 width=95% bgcolor="<%=tableBackColor%>" align=center>
  58. <tr><td height=1></td></tr></table>
  59. <TABLE border=1 cellpadding=0 cellspacing=0 width=95% align=center bordercolor=<%=tableBackColor%>>
  60.   <TBODY><TR>
  61.    <TD height=27 width="95%" bgColor=<%=tableTitleColor%>><font color=<%=tableFontColor%>>目前论坛总在线<b><%=ForumFactory.getOLUsersNum()%></b>人,其中<%=theForum.getForumType()%>上共有 <b><%=theForum.getForumOLMemberUsersNum()%></b> 位会员与 <b><%=theForum.getForumOLGuestUsersNum()%></b> 位客人.今日贴子 <font color="<%=alertFontColor%>"><b><%=theForum.getTodayNum()%></b></font>
  62. <%
  63. if(!"online".equals(ParamUtil.getString(request,"action")))
  64. out.println( "[<a href=list.jsp?action=online&forumID="+forumID+"><font color="+tableFontColor+">关闭详细列表</font></a>]");
  65. else
  66. out.println( "[<a href=list.jsp?forumID="+forumID+"><font color="+tableFontColor+">显示详细列表</font></a>]");
  67. out.println( "&nbsp;[<a href=online.jsp?forumID="+forumID+"><font color="+tableFontColor+">在线用户</font></a>]</TD><TD bgColor="+tableTitleColor+" width="5%" align=center><a href='list.jsp?forumID="+ forumID+"&Page=1&skin="+ParamUtil.getString(request,"skin","")+"'>"+
  68. "<img src='pic/refresh_1.gif' border=0 alt='刷新'></a></TD></TR>");
  69. if (!"online".equals(ParamUtil.getString(request,"action"))){
  70. out.println( "<tr><td colspan=2 bgcolor="+tableBodyColor+"><table cellpadding=6 cellspacing=1 border=0 width="100%" style="word-break:break-all;">");
  71. Vector OLUsers=ForumFactory.getOLUsers("member");
  72. for(i=0;i<OLUsers.size();i++){
  73. OLUser theUser=(OLUser)OLUsers.get(i);
  74. if(theUser.getStats().indexOf(theForum.getForumType())<0)
  75. continue;
  76. if(i%7==0) 
  77. out.println("<tr><td width="14%">");
  78. else
  79. out.println("<td width="14%">");
  80. if (theUser.getUserClass().equals("总版主"))
  81. out.println( "<img src="+picURL+picOM+" alt=总坛主 width=12 height=11>&nbsp;");
  82. else if (theUser.getUserClass().equals("版主"))
  83. out.println( "<img src="+picURL+picOB+" alt=版主 width=12 height=11>&nbsp;");
  84. else if (theUser.getUserClass().equals("贵宾"))
  85. out.println( "<img src="+picURL+picOV+" alt=贵宾 width=12 height=11>&nbsp;");
  86. else
  87. out.println( "<img src="+picURL+picOH+" width=12 height=11>&nbsp;");
  88. out.println( "<a href=dispuser.jsp?name="+response.encodeURL(theUser.getUserName())+" target=_blank>");
  89. out.println( "<ACRONYM TITLE="目前位置:"+response.encodeURL(theUser.getStats())+"<br>来访时间:"+theUser.getStartTime()+"<br>活动时间:"+theUser.getLastTimeBK()+"<br>"+theUser.getUserSystem()+"<br>"+theUser.getUserBrowser());
  90. out.println( "<br>真实IP:");
  91.     if(("0").equals(ipFlag)){
  92. if (forumMaster || master) {
  93. if (theUser.getUserIP()!=null)
  94. out.println(theUser.getUserIP());
  95. }
  96.         else
  97. out.println( "已设置保密");
  98. }
  99. else
  100. if (theUser.getUserIP()!=null)
  101. out.println(theUser.getUserIP());
  102.     out.println( "<br>来源鉴定:");
  103. if (fromFlag.equals("0")){
  104. if (forumMaster || master){ 
  105. if (theUser.getComeFrom()!=null)
  106. out.println(theUser.getComeFrom());
  107. }
  108.         else
  109. out.println( "已设置保密");
  110. }
  111. else
  112. if (theUser.getComeFrom()!=null)
  113. out.println(theUser.getComeFrom());
  114. out.println( "">");
  115. out.println(response.encodeURL(theUser.getUserName()));
  116. out.println( "</ACRONYM></a>&nbsp;");
  117. out.println( "</td>");
  118. if(i%7==0)  out.println( "</tr>");
  119. }
  120. out.println( "</TABLE></tr>");
  121. }
  122. out.println( "</TBODY></TABLE>");
  123. out.println( "<br><table cellpadding=0 cellspacing=0 border=0 width=95% align=center><tr>"+
  124. "<td align=center width=2 valign=middle> </td>"+
  125. "<td align=left valign=middle> <a href='announce.jsp?forumID="+ forumID +"'>"+
  126. "<img src='pic/post.gif' border=0 alt='发新帖'></a>"+
  127. "&nbsp;&nbsp;<a href='vote.jsp?forumID="+forumID+"'>"+
  128. "<img src='pic/newpoll.gif' border=0 alt='发起新投票'></a></td>"+
  129. "<td align=right> ");
  130. if ((forumMaster&&theForum.getForumMaster().indexOf(userName)>-1)||master)
  131. out.println( "  <b><a href='admin_boardaset.jsp?forumID="+ forumID +"'>版务管理</a>");
  132. out.println( "<b><a href='elist.jsp?forumID="+forumID +"'>论坛精华</a>  "+
  133. "论坛版主</b>:");
  134. String masterName=theForum.getForumMaster();
  135. if(masterName==null||"".equals(masterName))
  136. out.println("暂缺");
  137. else{
  138. String [] masterNames=theForum.getForumMaster().split("\|");
  139.  masterName="";
  140. for(int k=0;k<masterNames.length;k++)
  141. {
  142. masterName=masterName+"<a href="javascript:openScript('dispuser.jsp?name="+masterNames[k]+"',350,300)">"+masterNames[k]+"</a><br>" ;
  143. if(k>2){
  144. masterName=masterName + "<font color=#000066>More...</font>";
  145. break;
  146. }
  147. }
  148. out.println(masterName);
  149. }
  150. out.println("</td></tr></table>");
  151. try{
  152. Vector forumTopics=theForum.getForumTopics(forumID,start,Page);
  153. %>
  154. <table cellspacing=0 border=0 width=95% bgcolor="<%=tableBackColor%>" align=center><tr><td height=1></td></tr></table>
  155. <TABLE style=color:"&tableFontColor&"  border=1 cellPadding=0 cellSpacing=0 width=95% align=center bordercolor="<%=tableBackColor%>">
  156.    <TBODY>
  157. <TR align=middle>
  158. <TD height=27 width=32 bgColor="<%=tableTitleColor%>"><font color="<%=tableFontColor%>">状态</TD> 
  159. <TD bgColor="<%=tableTitleColor%>" width=*><font color="<%=tableFontColor%>">主 题  (点<img src=pic/plus.gif>即可展开贴子列表)</TD>
  160. <TD bgColor="<%=tableTitleColor%>" width=80><font color="<%=tableFontColor%>">作 者</TD>
  161. <TD bgColor="<%=tableTitleColor%>" width=64><font color="<%=tableFontColor%>">回复/人气</TD>
  162. <TD bgColor="<%=tableTitleColor%>" width=210><font color="<%=tableFontColor%>">最后更新 | 回复人</TD>
  163. </TR> 
  164. </TBODY></TABLE>
  165. <%
  166. for( i=0;i<forumTopics.size();i++){
  167. ForumTopic forumTopic=(ForumTopic)forumTopics.get(i);
  168. %>
  169. <TABLE style=color:"<%=tableContentColor%>" border=1 cellPadding=0 cellSpacing=0 width=95% align=center bordercolor="<%=tableBackColor%>">
  170. <TBODY><TR align=middle>
  171. <TD bgColor="<%=aTableBodyColor%>" width=32 height=27>
  172. <%
  173. if(!forumTopic.getLockTopic()&&!forumTopic.getIsTop()&&!forumTopic.getIsVote()&&!forumTopic.getIsBest()&&!(forumTopic.getChildNum()>10))
  174. out.println( "<img src="pic//folder.gif" alt=开放主题>");
  175. else if(forumTopic.getIsVote())
  176. out.println("<img src="pic//closedb.gif" alt=投票贴子>");
  177. else if(forumTopic.getIsTop())
  178. out.println("<img src="pic//istop.gif" alt=固顶主题>");
  179. else if(forumTopic.getIsBest())
  180. out.println("<img src="pic//isbest.gif" alt=精华帖子>");
  181. else if(forumTopic.getChildNum()>10)
  182. out.println("<img src="pic//hotfolder.gif" alt=热门主题>");
  183. else if(forumTopic.getLockTopic())
  184. out.println("<img src="pic//lockfolder.gif" alt=本主题已锁定>");
  185. else
  186. out.println("<img src="pic//folder.gif" alt=开放主题>");
  187. %>
  188. </TD>
  189. <TD align=left bgcolor="<%=tableBodyColor%>" width=* onmouseover=javascript:this.bgColor='<%=aTableBodyColor%>' onmouseout=javascript:this.bgColor='<%=tableBodyColor%>'>
  190. <%
  191. if (forumTopic.getChildNum()==0)
  192. out.println("<img src='"+picURL +"nofollow.gif' id='followImg"+forumTopic.getRootID()+"'>");
  193. else
  194. out.println("<img loaded=no src='"+picURL +"plus.gif' id='followImg"+forumTopic.getRootID()+"'   style='cursor:hand;'  onclick='loadThreadFollow("+forumTopic.getRootID()+","+forumTopic.getAnnounceID()+","+forumID+")' title=展开贴子列表>");
  195. out.println("<a href="dispbbs.jsp?forumID="+forumID+"&rootID="+forumTopic.getRootID()+"&announceID="+forumTopic.getAnnounceID()+"" title="《"+ forumTopic.getNoFilterTopic()+"》<br>作者:"+forumTopic.getUserName()+"<br>发表于"+forumTopic.getDateAndTime()+"<br>最后跟贴:"+response.encodeURL(forumTopic.getFollowMSG())+"...">");
  196. out.println(forumTopic.getNoFilterTopic());
  197. out.println("</a>");
  198. %> </TD>
  199. <TD bgColor="<%=aTableBodyColor%>" width=80><a href=javascript:openUser('<%=forumTopic.getUserName()%>')><%=forumTopic.getUserName()%></a></TD>
  200. <TD bgColor="<%=tableBodyColor%>" width=64>
  201. <font color="<%=tableContentColor%>"><%=forumTopic.getChildNum()%>/<%=forumTopic.getHits()%></font>
  202. </TD>
  203. <TD align=left bgColor="<%=aTableBodyColor%>" width=210>
  204. &nbsp;<a href=dispbbs.jsp?forumID=<%=forumID%>&rootID=<%=forumTopic.getRootID()%>&id=<%=forumTopic.getTimes()%>>
  205. <%=forumTopic.getFollowDateAndTime()%>
  206. </a>&nbsp;<font color=#990000>|</font>&nbsp;
  207. <a href=javascript:openUser('<%=forumTopic.getFollowUser()%>')><%=forumTopic.getFollowUser()%></a>
  208. </TD></TR>
  209. <tr style=display:none id='follow<%=forumTopic.getAnnounceID()%>'><td colspan=5 id='followTd<%=forumTopic.getAnnounceID()%>' style=padding:0px><div style='width:240px;margin-left:18px;border:1px solid black;background-color:lightyellow;color:black;padding:2px' onclick=loadThreadFollow(<%=forumTopic.getAnnounceID()%>)>正在读取关于本主题的跟贴,请稍侯……</div></td></tr>
  210. </TBODY></TABLE>
  211. <%
  212. }
  213. }
  214. catch(ForumTopicNotFoundException e)
  215. {
  216. e.printStackTrace();
  217. out.println("没有帖子!");
  218. }
  219. int forumTopicNum=theForum.getForumTopicNum();
  220. int totalPage=forumTopicNum/perPage+1;
  221. %>
  222. <table border=0 cellpadding=0 cellspacing=3 width=95% align=center >
  223. <form method=post action=list.jsp name=frmList2 >
  224. <input type=hidden name=selTimeLimit value="">
  225. <tr>
  226. <td valign=middle><span class=smallFont >页次:<strong><%=Page%></strong>/<strong><%=totalPage%></strong>页 每页<strong><%=perPage%></strong> 主题数<strong><%=forumTopicNum%></strong></td><td valign=middle><div align=right ><p>分页:
  227. <%
  228. if (startPage>10) 
  229. out.println("<a href='list.jsp?forumID="+forumID+"&Page="+(startPage-1)+"' >[<<]</a>");
  230. for(i=startPage;i<startPage+10;i++){
  231. if (i==Page)
  232.     out.println("<font color=gray>["+i+"]</font> ");
  233.    else
  234.        out.println("<a href='list.jsp?forumID="+forumID+"&Page="+i+"' >["+i+"]</a>   ");
  235.    
  236. if(i==totalPage) break;
  237. }
  238. if(i<totalPage)
  239. out.println("<a href='list.jsp?forumID="+forumID+"&Page="+i+"'>[>>]</a>   ");
  240. out.println("<span class=smallFont >转到:<input type=text name=Page size=3 maxlength=10  value='"+ Page+"'><input type='submit' value=Go   id=button1 name=button1 ></span></p>"+     
  241. "</div></td></tr>"+
  242. "<input type=hidden name=forumID value='"+ forumID +"'>"+
  243. "</form></table>");
  244. %>
  245. <table border=0 cellpadding=0 cellspacing=3 width=95% align=center>
  246. <tr>
  247. <td valign=middle nowrap> <div align=right>
  248. <select  onchange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}">
  249. <option value=''>论坛跳转至...</option>
  250. <%
  251. try{
  252. Vector gateWayVector=GateWayFactory.getGateWays();
  253. for( i=0;i<gateWayVector.size();i++)
  254. {
  255.      GateWay gateWay=(GateWay)gateWayVector.get(i);
  256.      int gateWayID=gateWay.getGateWayID();
  257.      String gateWayName=gateWay.getGateWayName();
  258. out.println("<option style=BACKGROUND-COLOR:#99ccff>╋ "+gateWayName+"</option>");
  259. try{
  260. Vector forumVector=ForumFactory.getForums(gateWayID);
  261. for(int j=0;j<forumVector.size();j++){
  262. Forum theListForum=(Forum)forumVector.get(j);
  263. out.println("<option value="list.jsp?forumID="+theListForum.getForumID()+""> ├"+theListForum.getForumType()+"</option>");
  264. }
  265. }
  266. catch(Exception e){
  267. e.printStackTrace();
  268. }
  269. }
  270. }
  271. catch(Exception e){
  272. e.printStackTrace();
  273. }
  274. %>
  275. </select><div></td></tr></form></table>
  276. <table cellspacing=0 cellpadding=0 width=95% align=center bgcolor="<%=tableBackColor%>" border=0>
  277. <tr><td><table cellspacing=1 cellpadding=3 width=100% border=0><tr bgcolor="<%=tableTitleColor%>">
  278. <td width=80% ><font color="<%=tableFontColor%>"><b> -=> <%=forumName%>图例</b></font></td>
  279. <td noWrap width=20% align=right><font color="<%=tableFontColor%>">所有时间均为 - 北京时间 &nbsp;</td>
  280. </tr><tr><td colspan=3 bgcolor="<%= tableBodyColor%>">
  281. <table cellspacing=4 cellpadding=0 width=92% border=0 align=center>
  282. <tr><td><img src=pic/folder.gif> 开放的主题</td>
  283. <td><img src=pic/hotfolder.gif> 回复超过10贴</td>
  284. <td><img src=pic/lockfolder.gif> 锁定的主题</td>
  285. <td><img src=pic/istop.gif> 固定顶端的主题 </td>
  286. <td> <img src=pic/isbest.gif> 精华帖子 </td>
  287. </tr><tr><td width=100% colspan=5>
  288. <%
  289. if (theForum.getStrAllowHTML())
  290. out.println( "HTML标签:<font color=#003399>ON</font>.");
  291. else
  292. out.println( "HTML标签:<font color=#990000>OFF</font>.");
  293. if (!theForum.getStrAllowForumCode())
  294. out.println( " UBB标签:<font color=#990000>OFF</font>.");
  295. else
  296. out.println( " UBB标签:<font color=#003399>ON</font>.");
  297. if (!theForum.getStrIcons())
  298. out.println( " 贴图标签:<font color=#990000>OFF</font>.");
  299. else
  300. out.println( " 贴图标签:<font color=#003399>ON</font>.");
  301. if (!theForum.getStrFlash())
  302. out.println( " Flash标签:<font color=#990000>OFF</font>.");
  303. else
  304. out.println( " Flash标签:<font color=#003399>ON</font>.");
  305. if (!theForum.getStrIMGInPosts())
  306. out.println( " 表情字符转换:<font color=#990000>OFF</font>.");
  307. else
  308. out.println( " 表情字符转换:<font color=#003399>ON</font>.");
  309. if (!"1".equals(uploadFlag)) 
  310. out.println( " 头像上传:<font color=#990000>OFF</font>.");
  311. else
  312. out.println( " 头像上传:<font color=#003399>ON</font>.");
  313. if (!"1".equals(titleFlag))
  314. out.println( " 用户头衔:<font color=#990000>OFF</font>.");
  315. else
  316. out.println( " 用户头衔:<font color=#003399>ON</font>.");
  317. %>
  318. </td></tr></table></td></tr></table></td></tr></table><BR>
  319. <%  }
  320. catch(ForumNotFoundException e){
  321. e.printStackTrace();
  322. }
  323. %>
  324. <%@ include file="foot.jsp"%>
  325. <iframe width=0 height=0 src="" id="hiddenframe"></iframe>