index.jsp

来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 581 行 · 第 1/2 页

JSP
581
字号
                    <%      }                        }                        else {                            lastPostLink = StringUtils.replace(lastPostLink, "[[name]]", lastPostAuthor.getUsername());                            List nameDisplay = new ArrayList(1);                            nameDisplay.add(lastPostLink);                    %>                            <%= SkinUtils.getLocalizedString("skin.default.global.last_post_by", locale, nameDisplay) %>                    <%  } %>                </font>                <%  } %>            </td>        </tr><%      } // end of while loop to display forums        // Now display any subcategories in this forum:        Iterator subCategories = category.categories();        while (subCategories.hasNext()) {            ForumCategory subCategory = (ForumCategory)subCategories.next();            // There are 2 ways to display this subcategory. It will be either            // "closed" or "open". "Closed" means we'll print out the category            // name and we'll make it a link so the user can click on it and            // drill down to the category. No forums will be displayed. "Open"            // means we'll show the category name (not a link) and the forums            // under it. We only show a category open when 1) the current            // category is the root category and 2) when the total depth of the            // category tree is 1 (meaning only 1 level of subcategories).            // "Closed" case:            if (category.getID() != rootCategory.getID() || !oneCategoryLevel) {%>        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.categoryCellBgColor") %>">            <td width="1%" align="center" valign="top">                <img src="images/blank.gif" width="12" height="12" vspace="2" border="0">            </td>            <td width="99%" colspan="3">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.categoryFontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.categoryFontFace") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.categoryTextColor") %>">                <a href="index.jsp?cat=<%= subCategory.getID() %>"                 ><b><%= subCategory.getName() %></b></a>                </font>                <%  if (subCategory.getDescription() != null) { %>                    <font size="-2" face="verdana">                    <br>                    <%= subCategory.getDescription() %>                    </font>                <%  } %>            </td>        </tr><%          }            // "Open" case:            else {%>        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.categoryCellBgColor") %>">            <td colspan="4">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.categoryFontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.categoryFontFace") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.categoryTextColor") %>">                <a href="index.jsp?cat=<%= subCategory.getID() %>"                 ><b><%= subCategory.getName() %></b></a>                <%  if (subCategory.getDescription() != null) { %>                    <font size="-2" face="verdana">                    <br>                    <%= subCategory.getDescription() %>                    </font>                <%  } %>            </td>        </tr><%              // Iterate through the forums in this subcategory, print them:                Iterator subForums = subCategory.forums();                if (!subForums.hasNext()) {%>        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>">            <td width="1%" align="center" valign="top">                <img src="images/blank.gif" width="12" height="12" vspace="2" border="0">            </td>            <td width="99%" colspan="3">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">                <i><%= SkinUtils.getLocalizedString("skin.default.index.no_forums_in_category", locale) %></i>                </font>            </td>        </tr><%              }                while (subForums.hasNext()) {                    Forum forum = (Forum)subForums.next();                    String description = forum.getDescription();                    ForumMessage lastPost = null;                    if (!"false".equals(JiveGlobals.getJiveProperty("skin.default.showLastPostLink"))) {                        lastPost = SkinUtils.getLastPost(forum);                    }%>        <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>">            <td width="1%" align="center" valign="top">            <%  if (SkinUtils.isNew(forum, lastVisited)) { %>                <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">            <%  } %>            </td>            <td width="97%" valign="top">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 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="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">                <%= SkinUtils.getLocalizedNumber(forum.getThreadCount(),locale) %>  <%= SkinUtils.getLocalizedString("skin.default.global.slash",locale) %> <%= SkinUtils.getLocalizedNumber(forum.getMessageCount(),locale) %>                </font>            </td>            <td width="1%" nowrap valign="top">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">                <%= SkinUtils.formatDate(request,pageUser,forum.getModifiedDate()) %>                </font>                <%  if (lastPost != null) {                        User lastPostAuthor = lastPost.getUser();                %>                <br>                <font size="-2" face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">                    <%  StringBuffer buf = new StringBuffer("<a href=\"thread.jsp?forum=");                        buf.append(lastPost.getForumThread().getForum().getID());                        buf.append("&thread=").append(lastPost.getForumThread().getID()).append("&message=");                        buf.append(lastPost.getID()).append("#").append(lastPost.getID()).append("\"");                        buf.append("title=\"").append(SkinUtils.getLocalizedString("skin.default.index.jump_to_message",locale));                        buf.append("\">[[name]] &raquo;</a>");                        String lastPostLink = buf.toString();                        if (lastPostAuthor == null) {                            String name = lastPost.getProperty("name");                            if (name != null) {                                lastPostLink = StringUtils.replace(lastPostLink, "[[name]]", "<i>"+name+"</i>");                                List nameDisplay = new ArrayList(1);                                nameDisplay.add(lastPostLink);                    %>                            <%= SkinUtils.getLocalizedString("skin.default.global.last_post_by", locale, nameDisplay) %>                    <%      } else {                                lastPostLink = StringUtils.replace(lastPostLink, "[[name]]", "<i>Guest</i>");                                List nameDisplay = new ArrayList(1);                                nameDisplay.add(lastPostLink);                    %>                            <%= SkinUtils.getLocalizedString("skin.default.global.last_post_by", locale, nameDisplay) %>                    <%      }                        }                        else {                            lastPostLink = StringUtils.replace(lastPostLink, "[[name]]", lastPostAuthor.getUsername());                            List nameDisplay = new ArrayList(1);                            nameDisplay.add(lastPostLink);                    %>                            <%= SkinUtils.getLocalizedString("skin.default.global.last_post_by", locale, nameDisplay) %>                    <%  } %>                </font>                <%  } %>            </td>        </tr><%              } // end while to print out sub-forums            } // end "open" case        } // end while for print out subscategories%>        </table>    </td></tr>    </table>    <p>    <%-- The message "Denotes new messages since your last visit": --%>    <table cellpadding="3" cellspacing="0" border="0">    <tr><td>        <img src="images/forum_new.gif" width="12" height="12" border="0">    </td><td>        <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"         face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"         color="<%= JiveGlobals.getJiveProperty("skin.default.textColor") %>">        <i><%= SkinUtils.getLocalizedString("skin.default.index.new_messages_explained",locale) %></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">    <%-- Popular discussions / search box cell: --%>    <%  // Only show search if it is enabled:        if ("true".equals(JiveGlobals.getJiveProperty("search.enabled"))) {    %>        <%@ include file="searchbox.jsp" %>        <p>    <%  } // end if search is enabled %>    <%  // Get an iterator of popular discussions        Iterator popularDiscussions = forumFactory.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 size="<%= JiveGlobals.getJiveProperty("skin.default.headerFontSize") %>"                 color="<%= JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.headerFontFace") %>">                <b><%= SkinUtils.getLocalizedString("skin.default.index.popular_discussions",locale).toUpperCase(locale) %></b>                </font>            </td>        </tr>        </table>    </td></tr>    <tr><td>        <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.sidebarBgColor") %>"         cellpadding="3" cellspacing="0" border="0" width="100%">        <%  // Loop through the iterator of popular discussions:            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)                            + SkinUtils.getLocalizedString("skin.default.global.elipse",locale);                }                // 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%">                <%-- Bullet: --%>                <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">                 <b>&#149;</b>                </font>            </td>            <td width="99%">                <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">                <a href="thread.jsp?forum=<%= forum.getID() %>&thread=<%= thread.getID() %>"                ><%= subject %></a>                <br>                <%= SkinUtils.getLocalizedString("skin.default.global.replies",locale) %><%= SkinUtils.getLocalizedString("skin.default.global.colon",locale) %>                <%= SkinUtils.getLocalizedNumber(numReplies,locale) %>                <br>                </font>                <font size="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontSize") %>"                 face="<%= JiveGlobals.getJiveProperty("skin.default.buttonFontFace") %>">                <%= forum.getName() %>                </font>            </td>        </tr>        <%  } // end while %>        </table>    </td></tr>    </table>    <%  } // end if popularDiscussions.hasNext() %>    <%-- end popular discussions / search box cell --%>    <img src="images/blank.gif" width="200" height="1" border="0">    </td></tr></table><p><%@ include file="footer.jsp" %>

⌨️ 快捷键说明

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