⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 listforums.jsp

📁 飞鱼论坛 (java)
💻 JSP
字号:
<%--
 - $Header: /cvsroot/fiyuforum/fiyuforum/srcweb/fiyuplugin/fiyuforum/user/listforums.jsp,v 1.32 2003/10/20 19:25:18 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.32 $
 - $Date: 2003/10/20 19:25:18 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002, 2003 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding fiyuForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.fiyuForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.fiyuForum.com/fiyuforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.Timestamp" %>
<%@ page import="fiyuforum.db.*" %>
<%@ page import="fiyucore.util.DateUtil" %>
<%@ page import="fiyuforum.MyUtil" %>
<%@ page import="fiyuforum.auth.OnlineUserAction" %>
<%@ page import="fiyuforum.fiyuForumConstant" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<html >
<head>
  <title><%=fiyuForumConfig.getWebName()%> - 列出所有讨论区</title>
<%@ include file="/fiyuplugin/fiyuforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/fiyuplugin/fiyuforum/css/style.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>

<table width="95%" align="center">
  <tr class="nav">
    <td><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/nav.gif"></td>
    <td width="100%" nowrap> <a class="nav" href="index"><%=fiyuForumConfig.getWebName()%></a>&raquo;&nbsp; 
      列出所有讨论区 </td>
  </tr>
</table>
<br/>

<%
int numberOfTopics = ((Integer)request.getAttribute("NumberOfThreads")).intValue();
int numberOfPosts = ((Integer)request.getAttribute("NumberOfPosts")).intValue();
MemberBean lastMember= (MemberBean)request.getAttribute("MemberBean");
long numberOfMembers= ((Integer)request.getAttribute("NumberOfMembers")).intValue();

//Copy code from listonlineusers.jsp
Collection onlineUserActions = (Collection) request.getAttribute("OnlineUserActions");
Iterator countIterator = onlineUserActions.iterator();
int guestCount = 0;
int memberCount = 0;
int anonymousCount = 0;
while (countIterator.hasNext()) {
    OnlineUserAction onlineUserAction = (OnlineUserAction)countIterator.next();
    int mID = onlineUserAction.getMemberID();
    if ( (mID==0) || (mID==fiyuForumConstant.MEMBER_ID_OF_GUEST) ) {
        guestCount++;
    } else {
        memberCount++;
    }
}
%>

<table width="95%" align="center">
  <tr>
    <td class="hightlight">所有讨论区 (<%=numberOfPosts%> 文章 在 <%=numberOfTopics%> 话题)</td>
  </tr>
</table>

<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="welcomeHeader">
    <td colspan="2" background="<%=contextPath%>/fiyuplugin/fiyuforum/images/004.gif"><strong>讨论区名称/描述</strong></td>
    <td width="65" align="center" background="<%=contextPath%>/fiyuplugin/fiyuforum/images/004.gif"><strong>话题</strong></td>
    <td width="42" align="center" background="<%=contextPath%>/fiyuplugin/fiyuforum/images/004.gif"><strong>文章</strong></td>
    <td width="237" align="center" background="<%=contextPath%>/fiyuplugin/fiyuforum/images/004.gif"><strong>最后发表</strong></td>
  </tr>
<%
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
ArrayList categoryBeans = categoryCache.getBeans();
ArrayList forumBeans = forumCache.getBeans();
int maxCat = categoryBeans.size();
int maxForum = forumBeans.size();

for (int catIndex = 0; catIndex < maxCat; catIndex++) {
    CategoryBean categoryBean = (CategoryBean)categoryBeans.get(catIndex);
%>
  <tr class="tcat">
    <td colspan="5">
      <b><%=categoryBean.getCategoryName()%></b><br/>
      <%=MyUtil.filter(categoryBean.getCategoryDesc(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, true/*newLine*/, true/*URL*/)%>
    </td>
  </tr>
<%
    int forumCountInCurrentCategory = 0;
    for (int forumIndex = 0; forumIndex < maxForum; forumIndex++) {
        ForumBean forumBean = (ForumBean)forumBeans.get(forumIndex);
        if (forumBean.getCategoryID() == categoryBean.getCategoryID()) {
            forumCountInCurrentCategory++;
            String color;
            if ((forumCountInCurrentCategory%2) != 0) {
                color = "trow1";
            } else {
                color = "trow2";
            }
%>
  <tr class="<%=color%>">
    <td width="44"><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/icon/<%=MyUtil.getForumIconName(onlineUser.getLastLogonTimestamp().getTime(), forumBean.getForumLastPostDate().getTime())%>" border="0"></td>
    <td width="517">
      <a href="listthreads?forum=<%=forumBean.getForumID()%>" class="messageTopic"><%=forumBean.getForumName()%></a><br/>
      <%=MyUtil.filter(forumBean.getForumDesc(), false/*html*/, true/*emotion*/, true/*fiyuCode*/, true/*newLine*/, true/*URL*/)%>
    </td>
    <td align="center"><b><%=forumBean.getForumThreadCount()%></b></td>
    <td align="center"><b><%=forumBean.getForumPostCount()%></b></td>
    <td align="center" nowrap>
<%if ( (forumBean.getLastPostMemberName().length() == 0) || (forumBean.getForumThreadCount() == 0) ) {%>
    没有文章
<%} else {%>
    <%=onlineUser.getGMTTimestampFormat(forumBean.getForumLastPostDate())%><br/>
    <a href="viewmember?member=<%=forumBean.getLastPostMemberName()%>" class="memberName"><%=forumBean.getLastPostMemberName()%></a>
<%} // else %>
    </td>
  </tr>
<%
        }//if the forum is in the current category
    } //for forumIndex
    if (forumCountInCurrentCategory == 0) {
%>
  <tr class="trow1">
    <td colspan="5" align="center"><b>此分类没有任何讨论区</b></td>
  </tr>
<%
    }// if no forum in this category
} //for catIndex
%>
<%
if (maxCat == 0) {
%>
  <tr class="trow1">
    <td colspan="5" align="center">没有任何分类</td>
  </tr>
<%
}// if no category
%>
</table>
<br/>

<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="welcomeHeader">
    <td colspan="2" background="<%=contextPath%>/fiyuplugin/fiyuforum/images/004.gif"><strong>一般资讯</strong></td>
  </tr>
  <tr class="trow1">
    <td width="30" class="trow1"><img src="<%=contextPath%>/fiyuplugin/fiyuforum/images/icon/user.gif"></td>
    <td>
      <table width="100%" cellspacing="1" cellpadding="3" align="center">
        <tr class="trow2">
          <td width="100%">
            分类总数: <b><%=maxCat%></b> &nbsp;&nbsp;        讨论区总数: <b><%=maxForum%></b><br/>
          </td>
        </tr>
        <tr class="trow2">
          <td width="100%">
            话题总数: <b><%=numberOfTopics%></b> &nbsp;&nbsp;        文章总数: <b><%=numberOfPosts%></b>&nbsp;&nbsp;
            会员总数: <b><%=numberOfMembers%></b>&nbsp;&nbsp;
            最新加入的会员: <a href="viewmember?memberid=<%=lastMember.getMemberID()%>" class="memberName"><%=lastMember.getMemberName()%></a>
          </td>
        </tr>
        <tr class="trow2">
          <td>
            目前有 <b><%=onlineUserActions.size()%></b> 线上使用者 (<b><%=guestCount%></b> 访客, <b><%=memberCount%></b> 会员) <br/>
            线上使用者:
              <%
                Iterator iterator = onlineUserActions.iterator();
                while (iterator.hasNext()) {
                  OnlineUserAction onlineUserAction = (OnlineUserAction)iterator.next();
                  int mID = onlineUserAction.getMemberID();
                  String mName = onlineUserAction.getMemberName();
				 
				  
                  if ( (mID!=0) && (mID!=fiyuForumConstant.MEMBER_ID_OF_GUEST) ) {
				   if ( fiyuForumConfig.getHidden(mID) == "1" ){
				   //out.print(fiyuForumConfig.getHidden(mID));
                %>
                	<font color="#CCCCCC">隐身会员</font>
                <%} 
				else{
				%>
				<a href="viewmember?memberid=<%=mID%>" class="memberName"><%=mName%></a>
				<%
				}/*else(!admin)*/
				}/*if (!guest)*/%>
              <%} /*while*/%>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

<br/>
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -