?? index.jsp
字號(hào):
<%@ page contentType="text/html;charset=gbk" errorPage="error.jsp"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="com.hongshee.ejforum.util.PageUtils"%>
<%@ page import="com.hongshee.ejforum.util.AppUtils"%>
<%@ page import="com.hongshee.ejforum.common.CacheManager"%>
<%@ page import="com.hongshee.ejforum.common.AppContext"%>
<%@ page import="com.hongshee.ejforum.common.ForumSetting"%>
<%@ page import="com.hongshee.ejforum.data.UserDAO.UserInfo"%>
<%@ page import="com.hongshee.ejforum.data.SectionDAO.SectionVO"%>
<%@ page import="com.hongshee.ejforum.data.BoardDAO.BoardVO"%>
<%@ page import="com.hongshee.ejforum.data.StatDAO"%>
<%@ page import="com.hongshee.ejforum.data.GroupDAO.GroupVO"%>
<%
String ctxPath = request.getContextPath();
String serverName = request.getServerName();
if (!ctxPath.equals("/"))
serverName = serverName + ctxPath;
AppContext appCtx = AppContext.getInstance();
CacheManager cache = CacheManager.getInstance();
ArrayList sections = cache.getSections();
String sectionID = PageUtils.getParam(request,"sid");
StringBuilder sbuf = new StringBuilder();
SectionVO currentSection = null;
String sectionLink = null;
ForumSetting setting = ForumSetting.getInstance();
if (sectionID != null && sectionID.length() > 0)
{
currentSection = cache.getSection(sectionID);
if (currentSection != null)
{
String showSectionLink = setting.getString(ForumSetting.DISPLAY, "showSectionLink");
if (showSectionLink.equalsIgnoreCase("yes"))
{
sbuf.append(" » ").append(currentSection.sectionName);
sectionLink = sbuf.toString();
}
}
}
String forumName = setting.getForumName();
String title = PageUtils.getTitle(forumName);
UserInfo userinfo = PageUtils.getSessionUser(request);
String[] menus = PageUtils.getHeaderMenu(request, userinfo);
String homeUrl = ctxPath + "/index.jsp";
String forumStyle = PageUtils.getForumStyle(request, response, null);
boolean isModerator = false;
GroupVO userGroup = PageUtils.getGroupVO(userinfo, cache.getModerators());
if (userGroup.groupID == 'A' || userGroup.groupID == 'M' || userGroup.groupID == 'S')
isModerator = true;
HashMap statInfo = StatDAO.getInstance().getBaseStatInfo();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE><%= title %></TITLE>
<%= PageUtils.getMetas(title, null) %>
<%= PageUtils.getRSSLink(request, forumName, currentSection, null) %>
<LINK href="styles/<%= forumStyle %>/ejforum.css" type=text/css rel=stylesheet>
</HEAD>
<BODY onkeydown="if(event.keyCode==27) return false;">
<SCRIPT src="js/common.js" type=text/javascript></SCRIPT>
<DIV class=wrap>
<DIV id=header>
<%= PageUtils.getHeader(request, title) %>
<%= PageUtils.getHeadAdBanner(request, null) %>
</DIV>
<%= menus[0] %>
<DIV id=foruminfo>
<DIV id=nav><A href="<%= homeUrl %>"><%= forumName %></A><%= sectionLink==null?"":sectionLink %>
<% if (userinfo != null) { %><p>歡迎 <%= userinfo.userID %>,
您上次訪問(wèn)是在 <%= AppUtils.formatSQLTimeStr(userinfo.lastVisited) %><br/>
<a href="spec_topics.jsp?spec=recent&uid=<%= userinfo.userID %>" style="font-weight:normal">查看新主題</a></p><% } %></DIV>
<DIV id=headsearch>
<P style="margin-bottom:5px; margin-right:2px">
全部主題: <em><%= (String)statInfo.get("topics") %></em>
<A href="spec_topics.jsp?spec=reward">懸賞主題</A><em>: <%= (String)statInfo.get("rewards") %></em>
<A href="spec_topics.jsp?spec=digest">精華區(qū)</A><em>: <%= (String)statInfo.get("digests") %></em>
<A title="RSS 頻道列表" href="./feeds.jsp"><IMG alt="RSS 頻道列表"
src="images/rss_sub.gif" align="absmiddle">訂閱</A> </P>
<SCRIPT type=text/javascript>
function doSearch() {
if(trim($('frmsearch').q.value)=='')
{
alert('請(qǐng)輸入搜索關(guān)鍵字');
return false;
}
frmsearch.submit();
}
</SCRIPT>
<FORM id="frmsearch" name="frmsearch"
action="http://www.google.cn/search" onsubmit="doSearch(); return false;" method=get target="google_window">
<INPUT type=hidden value="GB2312" name=ie>
<INPUT type=hidden value="GB2312" name=oe>
<INPUT type=hidden value=zh-CN name=hl>
<INPUT type=hidden value="<%= serverName %>" name=sitesearch>
<div style="padding-left:20px"><div onclick="javascript:window.open('http://www.google.cn/')"
style="cursor:pointer;float:left;width:70px;height:23px;background: url(images/google.png)! important;background: none; filter:
progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/google.png',sizingMethod='scale')"></div></div>
<INPUT id=q maxLength=255 size=12 name=q class="search">
<a href="#" onclick="doSearch(); return false;">
<img src="styles/<%= forumStyle %>/images/search.gif" border="0" alt="站內(nèi)搜索" align="absmiddle"/></a></FORM></DIV></DIV>
<DIV id=ad_text></DIV>
<%
String showHotlinks = setting.getString(ForumSetting.DISPLAY, "showHotlinks");
String[] hotLinks = showHotlinks.split(",");
if (hotLinks.length >= 3) {
String colWidth = String.valueOf(100 / hotLinks.length) + "%";
%>
<DIV class="mainbox forumlist" style="padding-top:0px">
<TABLE cellSpacing=0 cellPadding=0>
<THEAD class=category>
<TR>
<% if (showHotlinks.indexOf("image") >= 0){ %><TD style="padding-bottom: 1px"
align=center>≡ 最新圖片 ≡</TD><% } %>
<% if (showHotlinks.indexOf("recent") >= 0){ %><TD style="padding-bottom: 1px"
align=center>≡ 最新發(fā)表 ≡</TD><% } %>
<% if (showHotlinks.indexOf("hot") >= 0){ %><TD style="padding-bottom: 1px"
align=center>≡ 熱門主題 ≡</TD><% } %>
<% if (showHotlinks.indexOf("rank") >= 0){ %><TD style="padding-bottom: 1px"
align=center>≡ 人氣主題 ≡</TD><% } %>
<% if (showHotlinks.indexOf("digest") >= 0){ %><TD style="padding-bottom: 1px"
align=center>≡ 最新精華 ≡</TD><% } %>
</TR></THEAD>
<TBODY>
<TR>
<%
if (showHotlinks.indexOf("image") >= 0){
out.write("<TD align=center width='");out.write(colWidth);out.write("' style='MARGIN:1px'>\n");
String imageUrl = setting.getString(ForumSetting.DISPLAY, "imageFile");
StringBuilder tagBuf = new StringBuilder();
if (imageUrl.toLowerCase().indexOf(".swf") > 0)
{
String[] width_height = imageUrl.split(",");
int width = PageUtils.getIntValue(width_height, 1, 320);
int height = PageUtils.getIntValue(width_height, 2, 200);
tagBuf.append("<script type=text/javascript>showFlash('")
.append(width_height[0]).append("','").append(width).append("','")
.append(height).append("');</script>");
}
else
{
String imageLink = setting.getString(ForumSetting.DISPLAY, "imageLink");
String imageTitle = setting.getString(ForumSetting.DISPLAY, "imageTitle");
if (imageLink.length() > 0)
tagBuf.append("<a href=\"").append(imageLink).append("\" target=\"_blank\">");
tagBuf.append("<img src=\"").append(imageUrl).append("\" alt=\"").append(imageTitle)
.append("\" border=\"0\">");
if (imageLink.length() > 0)
tagBuf.append("</a>");
}
out.write(tagBuf.toString());
out.write("</TD>\n");
}
if (showHotlinks.indexOf("recent") >= 0){
out.write("<TD valign=top width='");out.write(colWidth);out.write("' style='MARGIN:1px'>\n");
out.write(cache.getRecentTopics());
out.write("</TD>\n");
}
if (showHotlinks.indexOf("hot") >= 0){
out.write("<TD valign=top width='");out.write(colWidth);out.write("' style='MARGIN:1px'>\n");
out.write(cache.getHotTopics());
out.write("</TD>\n");
}
if (showHotlinks.indexOf("rank") >= 0){
out.write("<TD valign=top width='");out.write(colWidth);out.write("' style='MARGIN:1px'>\n");
out.write(cache.getRankTopics());
out.write("</TD>\n");
}
if (showHotlinks.indexOf("digest") >= 0){
out.write("<TD valign=top width='");out.write(colWidth);out.write("' style='MARGIN:1px'>\n");
out.write(cache.getDigestTopics());
out.write("</TD>\n");
}
%>
</TR></TBODY></TABLE></DIV>
<%
}
if (sections != null)
{
SectionVO aSection = null;
BoardVO aBoard = null;
String forumUrl = null;
String topicUrl = null;
String lastPostInfo = null;
String lastNickname = null;
String moderators = null;
String moderatorLink = null;
String displayName = null;
if (sectionID != null)
sectionID = sectionID.trim();
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -