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

📄 jinghua.jsp

📁 这是一个用JSP开发的论坛源 码。。。 按照上在的README可轻松的捅有下JSP论坛
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%
/*##################################################################**
**#  程序名称:LyBBS『凌云论坛』                                   #**
**#                                                                #**
**#  程序开发: teddy 『星语凌』                                    #**
**#                                                                #**
**#  版权所有: 凌云创作室 (原流星电脑工作室)                       #**
**#                                                                #**
**#  主页地址: http://www.lybbs.net                                #**
**#  电邮地件: horseye@sina.com                                    #**
**#                                                                #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=GBK" %>
<%
ParameterUtils.setCharacterEncoding(request);

int isAdmin=0,
    forumID=0;
String checkPass="0",
       errorInfo="",
       action="";
forumID=ParameterUtils.getInt(request,"forumID");
action=ParameterUtils.getString(request,"action");
if(forumID==0)
  response.sendRedirect("errorPage.jsp");

String checkAction=ParameterUtils.getString(request,"checkAction");
%>
<%@ include file="include/boardprepare.jsp"%>
<%
//取forumstyle
forumStyle.getForumStyle();
int autoFreshTime=forumStyle.getAutoFreshTime(),
    maxThreads=forumStyle.getMaxThreads(),
    hotTopicMark=forumStyle.getHotTopicMark(),
    hotPollMark=forumStyle.getHotPollMark(),
    newMarkTime=forumStyle.getNewMarkTime(),
    maxTopTopic=forumStyle.getMaxTopTopic();
String refreshForum=forumStyle.getRefreshForum(),
       arrowUserDel=forumStyle.getArrowUserDel();

ForumListFactory forumListFactory=new ForumListFactory();
forumListFactory.setForumID(forumID);

//分页变量定义
int e=20;                  //'每页显示的记录数
int totalpage=0;           //'页面总数
int pages=1;               //'显示的当前页面
int count=0;               //'库中数据的总记录数
int from=0,to=0;           //'从from篇到to篇
int p=0;                   //'数据库查询从p开始
if(maxThreads!=0)
  e=maxThreads;
//取页数
pages=ParameterUtils.getInt(request,"pages");
//分页预备
count=forumListFactory.getForumJingHuaListNumber();
totalpage=((count%e==0)?(count/e):(count/e+1));
if(totalpage==0) totalpage=1;
if(pages>totalpage) pages=totalpage;
else if(pages<1) pages=1;
if(count!=0)
   from=(pages-1)*e+1;
if(totalpage==pages)
   to=count;
else if(count!=0)
   to=from+e-1;
p= (pages-1)*e;
//论坛是否自动刷新
if(refreshForum.equals("1") && !cookieMode.equals("0")) {
  int authorFreshTime=user.getFreshTime();
  if(authorFreshTime!=0)
    autoFreshTime=authorFreshTime;
  out.println("<meta http-equiv='refresh' content='"+autoFreshTime+"; url="+HttpUtils.getRequestURL(request)+"?"+request.getQueryString()+"'>");
}
//更新用户目前的位置
User.setUserPosition(Integer.parseInt(cookieID),forumID);

//调查用户浏览器
Browser eins=new Browser(request,session);
String userIP=request.getRemoteAddr(),
       userOS=eins.getOs(),
       userBrowser=eins.getName()+" "+eins.getVersion();
%>

<!--//html from here-->
<%@ include file="include/head.jsp"%>
<script language="JavaScript">
function menu(){
  var URL = document.jump.jumpto.options[document.jump.jumpto.selectedIndex].value;
  location.href = URL; target = '_self';
}
function changePages(){
  var URL = document.changepages.pages.options[document.changepages.pages.selectedIndex].value;
  location.href = URL; target = '_self';
}
function O8(name) {window.open("profile.jsp?action=show&member="+name);}
</script>
<body <%=lbbody%>>
<%@ include file="include/userheader.jsp"%>
<style>
TABLE {BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 1px; }
.ha {color: #990000; font: bold;}
.hb {color: #000000; font: bold;}
.dp {padding: 4px 0px;}
</style>
<br>
<%
forumListFactory.getForumPrivate();
String forumName=forumListFactory.getForumName(),
       privateForum=forumListFactory.getPrivateForum(),
       forumListType=forumListFactory.getForumListType();
%>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> align=center>
 <tr>
  <td width=30% rowspan=2 valign=top>
   <img src="images/<%=boardlogo%>" border=0>
  </td>
  <td valign=top align=left>
     <font face="宋体" color=<%=fontcolormisc%>>
     <img src="images/closedfold.gif" border=0> <a href="index.jsp"><%=boardname%></a><br>
     <img src="images/bar.gif" border=0><img src="images/openfold.gif" border=0> 本版精华帖子
     </font>
  </td>
 </tr>
</table>
<br>
<%
if(cookieMode.compareTo("5")>0)
  isAdmin=1;
else if(!cookieMode.equals("0"))
  isAdmin=(new Admin()).getIsAdmin(forumID,Integer.parseInt(cookieID));

if(checkAction.equals("yes")) {
  forumListFactory.setCookieID(cookieID);
  forumListFactory.setCookieMode(cookieMode);
  forumListFactory.setIsAdmin(isAdmin);
  forumListFactory.checkPass(request,response,loginout);
  errorInfo=forumListFactory.getErrorInfo();
  if(errorInfo.equals(""))
    checkPass="1";
}

if(privateForum.equals("1") && isAdmin==0 && checkPass.equals("0"))
  checkPass=user.getAllowPrivate(forumID);

if(privateForum.equals("1") && isAdmin==0 && checkPass.equals("0") && checkAction.equals("")) {
  //保密论坛,需要密码。
%>
  <form action="jinghua.jsp" method=post>
  <input type=hidden name="forumID" value="<%=forumID%>">
  <input type=hidden name="checkAction" value="yes">
  <table cellpadding=0 cellspacing=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
   <tr>
    <td>
     <table cellpadding=3 cellspacing=1 width=100%>
      <tr>
       <td bgcolor=<%=miscbacktwo%> colspan=2 align=center><font color=<%=fontcolormisc%>><b>请输入论坛密码登录保密论坛</b></font></td>
      </tr>
      <tr>
       <td bgcolor=<%=miscbackone%> colspan=2>
        <font color=<%=fontcolormisc%>><br>只有经过管理员许可的用户才可以访问保密论坛,如果你不能登录,请联系管理员!<br></font>
       </td>
      </tr>
<%
      if(cookieMode.equals("0")) {
%>
      <tr>
       <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的用户名</font></td>
       <td bgcolor=<%=miscbackone%>>
        <input type=text name="username" size=20>
       <font color=<%=fontcolormisc%>><a href="register.jsp" style="cursor:hand">您没有注册?</a></font>
       </td>
      </tr>
      <tr>
       <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入您的密码</font></td>
       <td bgcolor=<%=miscbackone%>>
        <input type=password name="password" size=22>
       <font color=<%=fontcolormisc%>><a href="profile.jsp?action=lostpassword" style="cursor:help">忘记密码 ?</a></font>
       </td>
      </tr>
<%
      }
%>
      <tr>
       <td bgcolor=<%=miscbackone%>><font color=<%=fontcolormisc%>>请输入论坛访问密码</font></td>
       <td bgcolor=<%=miscbackone%>>
        <input type=password name="forumPassword" size=22>
       </td>
      </tr>
      <tr>
       <td bgcolor=<%=miscbacktwo%> colspan=2 align=center><input type=submit name="submit" value="登  陆"></td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
  </form>
<%
}
else if(checkAction.equals("yes") && !errorInfo.equals("")) {
//如果登录失败,这里显示错误信息,否则,直接显示论坛
%>
      <table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
       <tr>
        <td>
         <table cellpadding=6 cellspacing=1 border=0 width=100%>
          <tr>
           <td bgcolor=#EEEEEE align=center><font color=<%=fontcolormisc%>><b>错误: 进入论坛</b></font></td>
          </tr>
          <tr>
           <td bgcolor=<%=miscbackone%>>
            <font color=<%=fontcolormisc%>>
             <b>关于进入论坛错误的详细原因:</b>
             <ul>
              <li><b><%=errorInfo%></b></li>
             </ul>
             <b>产生进入论坛错误的可能原因:</b>
             <ul>
              <li>密码错误
              <li>用户名错误
              <li>您不是<a href="register.jsp" >注册</a>用户
             </ul>
             <br><br><center> << <a href="javascript:history.go(-1)">返回上一页</a></center>
            </font>
           </td>
          </tr>
         </td>
        </table>
       </td>
      </tr>
     </table>
<%
}
else {
  //取当前系统时间
  ForumDate forumDate=new ForumDate();
  forumDate.getNowDate();
  String now_date=forumDate.getNow_Date();
  String now_time=forumDate.getNow_Time();
%>
  <%@ include file="include/announcement.jsp"%>
<%
  if(onlineView.equals("1")) {
%>
    <%@ include file="include/boardstatus.jsp"%>
<%
  }
%>

<br>
<script language="JavaScript">
 function queryAdmin() {
  if(document.modjump.queryadmin.value!="#")
     O8(document.modjump.queryadmin.value);      
 }
</script>
<table cellpadding=0 cellspacing=0 width=<%=tablewidth%> align=center>
 <tr>
  <td align=center width=2></td>
  <td>
    <a href=post.jsp?action=new&forumID=<%=forumID%>><img src=images/<%=newThreadLogo%> border=0 alt=发表一个新主题 width=99 height=25></a>
   <a href=poll.jsp?action=new&forumID=<%=forumID%>><img src=images/<%=newPollLogo%> border=0 alt=开启一个新投票 width=99 height=25></a>
   <a href=xzb.jsp?action=new&forumID=<%=forumID%>><img src=images/<%=newXzbLogo%> border=0 alt=张贴一个小字报 width=99 height=25></a>
 </td>
  <form action="profile.jsp" method="post" name="modjump">
  <td align=right colspan=2>
    <img src=images/team2.gif width=19 height=19 align=absmiddle>
    <input type=hidden name="action" value="show">
    <select name="queryadmin" onchange="queryAdmin()">
     <option value="#">本论坛版主:</option>
     <option value="#">------------</option>
<%
  String adminNameAll=(new Admin()).getForumAdmin(forumID);
  if(!adminNameAll.equals("")) {
    String[] adminNameArray=adminNameAll.split(",");
    for(int i=0;i<adminNameArray.length;i++)
       out.println("<option value='"+adminNameArray[i]+"'>"+adminNameArray[i]+"</option>");
  }
%>
    </select>
  </td>
  </form>
 </tr>
</table>

⌨️ 快捷键说明

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