mywatch.jsp

来自「一个完整的网络订餐系统」· JSP 代码 · 共 248 行

JSP
248
字号
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/user/mywatch.jsp,v 1.31 2005/01/18 11:01:46 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.31 $
 - $Date: 2005/01/18 11:01:46 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 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.*" %>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ page import="net.myvietnam.mvncore.util.StringUtil" %>
<%@ page import="net.myvietnam.mvncore.filter.EnableEmotionFilter" %>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MyUtil" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html <fmt:message key="mvnforum.common.i18n.html_dir"/>>
<head>
  <title><fmt:message key="mvnforum.common.forum.title_name"/> - <fmt:message key="mvnforum.user.mywatch.title"/></title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>

<table width="95%" align="center">
  <tr class="nav">
    <td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
    <td width="100%" nowrap>
    <a class="nav" href="index"><fmt:message key="mvnforum.common.nav.index"/></a>&nbsp;&raquo;&nbsp;
    <a class="nav" href="myprofile"><fmt:message key="mvnforum.user.header.my_profile"/></a>&nbsp;&raquo;&nbsp;
    <fmt:message key="mvnforum.user.mywatch.title"/>
    </td>
  </tr>
</table>
<br/>

<%
Collection globalWatchBeans = (Collection) request.getAttribute("GlobalWatchBeans");
Collection categoryWatchBeans = (Collection) request.getAttribute("CategoryWatchBeans");
Collection forumWatchBeans = (Collection) request.getAttribute("ForumWatchBeans");
Collection threadWatchBeans = (Collection) request.getAttribute("ThreadWatchBeans");

CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
%>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="pagedesc">
    <td>
    <fmt:message key="mvnforum.user.mywatch.guide"/><br>
    <%if (globalWatchBeans.size()==0) {%>
    <fmt:message key="mvnforum.common.prompt.choose_tasks"/><br/>
    <a class="command" href="addwatch"><fmt:message key="mvnforum.user.mywatch.add_watch"/></a><br/>
    <%}%>
    </td>
  </tr>
</table>
<br/>

<table width="95%" align="center">
  <tr>
    <td class="highlight"><fmt:message key="mvnforum.user.mywatch.my_global_watch"/>:
    <%if(globalWatchBeans.size()>=1){%><fmt:message key="mvnforum.common.yes"/><%}else{%><fmt:message key="mvnforum.common.no"/><%}%>
    </td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td><fmt:message key="mvnforum.user.mywatch.my_global_watch"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.start_on"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.last_sent"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.delete"/></td>
  </tr>
<%if (globalWatchBeans.size() == 1) {
    Iterator globalIterator = globalWatchBeans.iterator();
    WatchBean watchBean = (WatchBean) globalIterator.next();
%>
  <tr class="trow1">
    <td><b><fmt:message key="mvnforum.user.mywatch.my_global_watch"/></b></td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchCreationDate())%></td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchLastSentDate())%></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><a href="deletewatchprocess?watch=<%=watchBean.getWatchID()%>" class="command"><fmt:message key="mvnforum.common.action.delete"/></a></td>
  </tr>
<%} else {%>
  <tr class="trow1"><td colspan="8" align="center"><fmt:message key="mvnforum.user.mywatch.no_global_watch"/></td></tr>
<%}%>
</table>
<br/>

<table width="95%" align="center">
  <tr>
    <td class="highlight"><fmt:message key="mvnforum.user.mywatch.my_category_watch"/> (<%=categoryWatchBeans.size()%>):</td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td><fmt:message key="mvnforum.common.category"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.start_on"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.last_sent"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.delete"/></td>
  </tr>
<%
int rowIndex = 0;
for (Iterator catIterator = categoryWatchBeans.iterator(); catIterator.hasNext(); ) {
    WatchBean watchBean = (WatchBean)catIterator.next();
    CategoryBean categoryBean = categoryCache.getBean(watchBean.getCategoryID());
%>
  <tr class="trow<%=(rowIndex++)%2 + 1%>">
    <td>
      <b><%=categoryBean.getCategoryName()%></b><br/>
      <%=MyUtil.filter(categoryBean.getCategoryDesc(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%>
    </td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchCreationDate())%></td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchLastSentDate())%></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><a href="deletewatchprocess?watch=<%=watchBean.getWatchID()%>" class="command"><fmt:message key="mvnforum.common.action.delete"/></a></td>
  </tr>
<%
}//for
if (categoryWatchBeans.size() == 0) {%>
  <tr class="trow1"><td colspan="8" align="center"><fmt:message key="mvnforum.user.mywatch.no_category_watch"/></td></tr>
<%}%>
</table>
<br/>

<table width="95%" align="center">
  <tr>
    <td class="highlight"><fmt:message key="mvnforum.user.mywatch.my_forum_watch"/> (<%=forumWatchBeans.size()%>):</td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td><fmt:message key="mvnforum.common.forum"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.start_on"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.last_sent"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.delete"/></td>
  </tr>
<%
rowIndex = 0;
for (Iterator forumIterator = forumWatchBeans.iterator(); forumIterator.hasNext(); ) {
    WatchBean watchBean = (WatchBean)forumIterator.next();
    ForumBean forumBean = forumCache.getBean(watchBean.getForumID());
%>
  <tr class="trow<%=(rowIndex++)%2 + 1%>">
    <td>
      <b><%=forumBean.getForumName()%></b><br>
      <%=MyUtil.filter(forumBean.getForumDesc(), false/*html*/, true/*emotion*/, true/*mvnCode*/, true/*newLine*/, true/*URL*/)%>
    </td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchCreationDate())%></td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchLastSentDate())%></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><a href="deletewatchprocess?watch=<%=watchBean.getWatchID()%>" class="command"><fmt:message key="mvnforum.common.action.delete"/></a></td>
  </tr>
<%
}//for
if (forumWatchBeans.size() == 0) {%>
  <tr class="trow1"><td colspan="8" align="center"><fmt:message key="mvnforum.user.mywatch.no_forum_watch"/></td></tr>
<%}%>
</table>
<br/>

<table width="95%" align="center">
  <tr>
    <td class="highlight"><fmt:message key="mvnforum.user.mywatch.my_thread_watch"/> (<%=threadWatchBeans.size()%>):</td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td colspan="3"><fmt:message key="mvnforum.common.thread"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.start_on"/></td>
    <td align="center"><fmt:message key="mvnforum.user.mywatch.last_sent"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><fmt:message key="mvnforum.common.action.delete"/></td>
  </tr>
<%
rowIndex = 0;
for (Iterator threadIterator = threadWatchBeans.iterator(); threadIterator.hasNext(); ) {
    WatchBean watchBean = (WatchBean)threadIterator.next();
    ThreadBean threadBean = watchBean.getThreadBean();
%>
  <tr class="trow<%=(rowIndex++)%2 + 1%>">
    <td width="16"><img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/<%=MyUtil.getThreadIconName(onlineUser.getLastLogonTimestamp().getTime(), threadBean.getThreadLastPostDate().getTime(), threadBean.getThreadReplyCount()+1)%>" border="0"></td>
    <td width="16"><%=EnableEmotionFilter.filter(threadBean.getThreadIcon(), ParamUtil.getContextPath() + MVNForumGlobal.EMOTION_DIR)%></td>
    <td>
      <a class="messageTopic" href="viewthread?thread=<%=threadBean.getThreadID()%>">
      <%=MyUtil.filter(threadBean.getThreadTopic(), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
      </a><br/>
      <%=MyUtil.filter(StringUtil.getShorterString(threadBean.getThreadBody(), MVNForumConfig.getMaxCharsInShortSummary()), false/*html*/, true/*emotion*/, false/*mvnCode*/, false/*newLine*/, false/*URL*/)%>
    </td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchCreationDate())%></td>
    <td align="center"><%=onlineUser.getGMTTimestampFormat(watchBean.getWatchLastSentDate())%></td>
    <td align="center"><fmt:message key="mvnforum.common.action.edit"/></td>
    <td align="center"><a href="deletewatchprocess?watch=<%=watchBean.getWatchID()%>" class="command"><fmt:message key="mvnforum.common.action.delete"/></a></td>
  </tr>
<%
}//for
if (threadWatchBeans.size() == 0) {%>
  <tr class="trow1"><td colspan="8" align="center"><fmt:message key="mvnforum.user.mywatch.no_thread_watch"/></td></tr>
<%}%>
</table>

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

⌨️ 快捷键说明

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