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

📄 index.jsp

📁 论坛系统EasyJForum 是一个基于 Java 技术的免费社区论坛软件系统
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ 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(" &raquo;&nbsp; ").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>欢迎&nbsp;<%= userinfo.userID %>, 
您上次访问是在&nbsp;<%= 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>&nbsp; 
<A href="spec_topics.jsp?spec=reward">悬赏主题</A><em>: <%= (String)statInfo.get("rewards") %></em>&nbsp; 
<A href="spec_topics.jsp?spec=digest">精华区</A><em>: <%= (String)statInfo.get("digests") %></em>
&nbsp;&nbsp;<A title="RSS 频道列表" href="./feeds.jsp"><IMG alt="RSS 频道列表" 
   src="images/rss_sub.gif" align="absmiddle">订阅</A>&nbsp;</P>
<SCRIPT type=text/javascript>
function doSearch() {
	if(trim($('frmsearch').q.value)=='')
	{
		alert('请输入搜索关键字');
		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>&nbsp;
<INPUT id=q maxLength=255 size=12 name=q class="search">&nbsp; 
<a href="#" onclick="doSearch(); return false;">
<img src="styles/<%= forumStyle %>/images/search.gif" border="0" alt="站内搜索" 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>≡&nbsp;最新图片&nbsp;≡</TD><% } %>
	  <% if (showHotlinks.indexOf("recent") >= 0){ %><TD style="padding-bottom: 1px" 
			align=center>≡&nbsp;最新发表&nbsp;≡</TD><% } %>
	  <% if (showHotlinks.indexOf("hot") >= 0){ %><TD style="padding-bottom: 1px" 
			align=center>≡&nbsp;热门主题&nbsp;≡</TD><% } %>
	  <% if (showHotlinks.indexOf("rank") >= 0){ %><TD style="padding-bottom: 1px" 
			align=center>≡&nbsp;人气主题&nbsp;≡</TD><% } %>
	  <% if (showHotlinks.indexOf("digest") >= 0){ %><TD style="padding-bottom: 1px" 
			align=center>≡&nbsp;最新精华&nbsp;≡</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();
		

⌨️ 快捷键说明

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