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

📄 index.jsp~1~

📁 jive-jdon是非常值得研究的一个开源项目
💻 JSP~1~
字号:
<%@ page contentType="text/html;charset=ISO8859_1" %>

<%
/**
 *	$RCSfile: index.jsp,v $
 *	$Revision: 1.3 $
 *	$Date: 2002/09/30 14:56:16 $
 */
%>

<%@ page import="java.util.*,
                 com.jivesoftware.forum.*,
                 com.jivesoftware.forum.util.*"
    errorPage="error.jsp"
%>

<%  // global.jsp is a collection of utility methods and global variables.
    // Page authorization and the creation of the authToken and forumFactory
    // variables is handled there.
%>
<%@ include file="global.jsp" %>

<%  // The title of this page. The header page assumes the "title" variable.
    String title = JiveGlobals.getJiveProperty("websiteconf.name");
%>
<%@ include file="header.jsp" %>

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
    <td valign="top" width="98%">

    <%-- breadcrumbs --%>

    <font face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
     color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>">
    <b>
    <a href="<%= JiveGlobals.getJiveProperty("websiteconf.url") %>"
     >首页</a>
    &raquo;
    <a href="index.jsp" title="返回论坛列表"
     >论坛</a>
    </b>
    </font>
    <p>

    <%-- text describing your community --%>

    <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
    color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
    <%= JiveGlobals.getJiveProperty("skin.default.communityDescription") %>
    </font>

    </td>
    <td width="1%"><img src="images/blank.gif" width="10" height="1" border="0"></td>
    <td valign="top" width="1%" align="center">
    <%@ include file="loginbox.jsp" %>
    </td>
</tr>
</table>

<p>

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="98%" valign="top">

    <%-- forum listing cell --%>

    <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
     cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr><td>
        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
         cellpadding="4" cellspacing="1" border="0" width="100%">
        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderBgColor") %>">
            <td width="1%"><img src="images/blank.gif" width="1" height="1" border="0"></td>
            <td width="97%"><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>论坛名称</b></font></td>
            <td width="1%" nowrap><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>主题 / 消息</b></font></td>
            <td width="1%" nowrap align="center"><font class="p4" color="<%= JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"><b>最后更新</b></font></td>
        </tr>

<%      Iterator forums = myEnv.getForumFactory().forums();
        while (forums.hasNext()) {
            Forum forum = (Forum)forums.next();
            String description = forum.getDescription();
            boolean isNew = (forum.getModifiedDate().getTime() > lastVisited.getTime());
            ForumMessage lastPost = myEnv.du.getLastPost(forum);
%>
        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>">
            <td width="1%" align="center" valign="top">
                <font size="-2" color="#ff0000">
            <%  if (isNew) { %>
                <img src="images/forum_new.gif" width="12" height="12" vspace="2" border="0">
            <%  } else { %>
                <img src="images/forum_old.gif" width="12" height="12" vspace="2" border="0">
            <%  } %>
                </font>
            </td>
            <td width="97%">
                <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
                color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
                <a href="forum.jsp?forum=<%= forum.getID() %>"><%= forum.getName() %></a>
                <br>
                <i><%= (description!=null)?description:"" %></i>
                </font>
            </td>
            <td width="1%" nowrap align="center" valign="top">
                <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
                color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
                <%= forum.getThreadCount() %> / <%= forum.getMessageCount() %>
                </font>
            </td>
            <td width="1%" nowrap valign="top">
                <font size="-1" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
                color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
                <%= SkinUtils.formatDate(request,response,pageUser,forum.getModifiedDate()) %>
                </font>
                <%  if (lastPost != null) {
                        User lastPostAuthor = lastPost.getUser();
                %>
                <br>
                <font size="-2" face="verdana">
                <%  if (lastPostAuthor == null) { %>
                    by: <i>Guest</i>
                <%  } else { %>
                    by: <a href="thread.jsp?forum=<%= lastPost.getForumThread().getForum().getID() %>&thread=<%= lastPost.getForumThread().getID() %>&message=<%= lastPost.getID() %>#<%= lastPost.getID() %>"
                         title="Jump to Message"
                         ><%= lastPostAuthor.getUsername() %> &raquo;</a>
                <%  } %>
                </font>
                <%  } %>
            </td>
        </tr>
<%      } %>

        </table>
    </td></tr>
    </table>

    <p>

    <table cellpadding="3" cellspacing="0" border="0">
    <tr><td>
        <img src="images/forum_new.gif" width="12" height="12" border="0">
    </td><td>
        <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"
        color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">
        <i>表示在你最后一次访问有新消息发布!</i>
        </font>
    </td></tr>
    </table>

    <%-- end forum listing cell --%>

    </td>
    <td width="1%"><img src="images/blank.gif" width="10" height="1" border="0"></td>
    <td width="1%" nowrap valign="top">




    <%  // Get an iterator of popular discussions
        Iterator popularDiscussions = myEnv.getForumFactory().popularThreads();

        // only show the popular discussions box if there *are* popular discussions:
        if (popularDiscussions.hasNext()) {
    %>
    <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
     cellpadding="1" cellspacing="0" border="0" width="200">
    <tr><td>
        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderBgColor") %>"
         cellpadding="4" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="center"><font class=p2 color="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"
                 ><b>热点讨论</b></font></td>
        </tr>
        </table>
    </td></tr>
    <tr><td>
        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarBgColor") %>"
         cellpadding="3" cellspacing="0" border="0" width="100%">
        <%  while (popularDiscussions.hasNext()) {
                ForumThread thread = (ForumThread)popularDiscussions.next();
                String subject = thread.getName();
                // Clip the length of the subject if it's over a certain length.
                // This prevents long subjects from screwing up the layout of
                // the page.
                if (subject.length() > 25) {
                    subject = StringUtils.chopAtWord(subject, 50) + "..";
                }
                // Get the forum associated with this thread
                Forum forum = thread.getForum();
                // Number of replies to the thread
                int numReplies = thread.getMessageCount()-1;
        %>
        <tr>
            <td valign="top" width="1%">
            <font size="-1" face="arial"><b>&#149;</b></font>
            </td>
            <td width="99%">
            <font class=p1 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
            <a href="thread.jsp?forum=<%= forum.getID() %>&thread=<%= thread.getID() %>"><%= subject %></a><br>
            <%= numReplies %> <%= (numReplies==1)?"回复":"回复" %>
            (<%= forum.getName() %>)
            </font>
        </td></tr>
        <%  } // end while %>
        </table>
		<p>
		   <%-- popular discussions / search box cell --%>

    <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>"
     cellpadding="1" cellspacing="0" border="0" width="200">
    <tr><td>
        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderBgColor") %>"
         cellpadding="4" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="center"><font class=p4 color="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>"
                 ><b>搜  索</b></font></td>
        </tr>
        </table>
    </td></tr>
    <tr><td>
        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarBgColor") %>"
         cellpadding="3" cellspacing="0" border="0" width="100%">
        <form action="search.jsp" method="post" >
        <input type="hidden" name="search" value="true">
        <tr>
        <td width="99%"><input type="text" name="q" style="width:100%;"></td>
        <td width="1%"><input type="image" src="images/go.gif" width="17" height="17" border="0" alt="单击进行搜索"></td>
        </tr>
        <tr>
        <td colspan="2">
            <font class=p2 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
            <select size="3" style="width:100%;" multiple name="forums">
            <option value="-1" selected> 所有论坛 (默认)
        <%  // get the iterator of forums again
            for (Iterator iter=myEnv.getForumFactory().forums(); iter.hasNext();) {
                Forum forum = (Forum)iter.next();
                // Trim the forum name
                String forumName = forum.getName();
                if (forumName.length() > 18) {
                    forumName = forumName.substring(0,18) + "..";
                }
        %>
            <option value="<%= forum.getID() %>">
                &nbsp;&#149;&nbsp; <%= forumName %>
        <%  } %>
            </select>
            </font>
        </td>
        </tr>
        </form>
        </table>
    </td></tr>
    </table>
    </td></tr>
    </table>
    <p>
    <%  } // end if popularDiscussions.hasNext() %>

    <%-- end popular discussions / search box cell --%>

    </td>
</tr></table>

<p>

<%@ include file="footer.jsp" %>

⌨️ 快捷键说明

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