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

📄 listforums.jsp

📁 用java 写的论坛
💻 JSP
字号:
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/listforums.jsp,v 1.15 2003/06/08 19:17:16 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.15 $
 - $Date: 2003/06/08 19:17:16 $
 -
 - ====================================================================
 -
 - 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 mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.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.mvnForum.com/mvnforum/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.ArrayList" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.db.*" %>
<%@ page import="net.myvietnam.mvncore.util.DateUtil" %>
<%@ page import="net.myvietnam.mvnplugin.mvnforum.MyUtil" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<html>
<head>
    <title>mvnForum - Hiển thị tất cả diễn đàn</title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
</head>
<link href="<%=contextPath%>/mvnplugin/mvnforum/css/style.css" rel=stylesheet type=text/css>
<body leftmargin=0 topmargin=0>

<%@ include file="header.jsp"%>
<p>

<table width="95%" align="center">
<tr class="nav">
    <td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
    <td width="100%" nowrap>
    <a class="navLink" href="index">mvnForum</a>&nbsp;&raquo;&nbsp;
    Hiển thị tất cả diễn đàn
    </td>
</tr>
</table>
<p>

<%
int numberOfTopics = ((Integer)request.getAttribute("NumberOfThreads")).intValue();
int numberOfPosts = ((Integer)request.getAttribute("NumberOfPosts")).intValue();
%>
<table width="95%" align="center">
<tr>
    <td class="hightlight">Tất cả các diễn đàn: (<%=numberOfPosts%> Bài viết trong <%=numberOfTopics%> Luồng)</td>
</tr>
</table>

<table width="95%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#999999">
<tr bgcolor="#666699" class="header">
    <td colspan="2">Tên/Mô tả của diễn đàn</td>
    <td align="center">Số luồng</td>
    <td align="center">Số bài gửi</td>
    <td align="center">Bài gửi cuối</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>
        <td colspan="5" bgcolor="Silver">
        <font class="messageTextBold"><%=categoryBean.getCategoryName()%></font><br>
        <font class="messageText"><%=MyUtil.filter(categoryBean.getCategoryDesc(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%></font>
        </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 = "white";
            } else {
                color = "#f5f5f5";
            }
%>
<tr bgColor=<%=color%>>
    <td width="16"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/<%=MyUtil.getForumIconName(onlineUser.getLastLogonTimestamp().getTime(), forumBean.getForumLastPostDate().getTime())%>" border="0"></td>
    <td>
        <a class="messageTopic" href="listthreads?forum=<%=forumBean.getForumID()%>"><%=forumBean.getForumName()%></a><br>
        <font class="messageText"><%=MyUtil.filter(forumBean.getForumDesc(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%></font>
    </td>
    <td align="center" class="messageTextBold"><%=forumBean.getForumThreadCount()%></td>
    <td align="center" class="messageTextBold"><%=forumBean.getForumPostCount()%></td>
    <td align="center" nowrap class="messageText">
<%if ( (forumBean.getLastPostMemberName().length() == 0) || (forumBean.getForumThreadCount() == 0) ) {%>
    Không có bài gửi
<%} else {%>
    <%=onlineUser.getGMTTimestampFormat(forumBean.getForumLastPostDate())%><br>bởi
    <a href="viewmember?member=<%=forumBean.getLastPostMemberName()%>" class="messageTextBoldBlue">
    <%=forumBean.getLastPostMemberName()%>
    </a>
<%} // else %>
    </td>
</tr>
<%
        }//if the forum is in the current category
    } //for forumIndex
    if (forumCountInCurrentCategory == 0) {
%>
<tr bgColor="White">
  <td colspan="5" align="center" class="messageText">Không có diễn đàn nào trong nhóm này</td>
</tr>
<%
    }// if no forum in this category
} //for catIndex
%>
<%
if (maxCat == 0) {
%>
<tr bgColor="White">
  <td colspan="5" align="center" class="messageText">Không có nhóm diễn đàn nào</td>
</tr>
<%
}// if no category
%>
</table>

<p>
&nbsp;
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

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