<%@ page contentType="text/html;charset=GBK" %>

<%
/**
 *	$RCSfile: index.jsp,v $
 *	$Revision: 1.3 $
 *	$Date: 2002/09/30 14:56:16 $
 */
%>
<%@ page import="java.sql.ResultSet,gbase.db.*" %>
<%@ 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");
    String title="BBS论坛";
%>
<%@ 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="/"
     >首页</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") %>-->
    <%=web_jive_desc%>
    </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>
<%
String String_forumIDS="--_--";
DBOperation theSelectDBOperation = new DBOperation();
String select_sql="select forumID from web_jive where web_account='"+web_account+"'  order by forumID asc ";
ResultSet select_rs =theSelectDBOperation.getResultSet(select_sql);
while(select_rs.next()){
String_forumIDS=String_forumIDS+select_rs.getString("forumID")+"--_--";
}
//out.println("String_forumIDS"+String_forumIDS);
%>
<%      Iterator forums = myEnv.getForumFactory().forums();
        while (forums.hasNext()) {
            Forum forum = (Forum)forums.next();
            //out.println("Long.toString(forum.getID())"+Long.toString(forum.getID()));
            if(String_forumIDS.indexOf("--_--"+Long.toString(forum.getID())+"--_--")<0)
            continue;
            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>
    
    
</tr></table>

<p>

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