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

📄 index.jsp

📁 jsp bbs源代码
💻 JSP
字号:
<%
/*##################################################################**
**#  LyBBS ver 1.2.b2 (1.2.beta-2版) / 凌云论坛 ver 1.2.b2         #**
**#                                                                #**
**#  版权所有: 凌云工作室 (原流星电脑工作室)                       #**
**#                                                                #**
**#  制作人  : 星语凌 『teddy (Yongshan Ye)』                      #**
**#                                                                #**
**#  主页地址: http://www.unix-now.com/lybbs   凌云论坛主页        #**
**#            http://www.ierp.info/lybbs      凌云论坛镜像站      #**
**#            http://horseye@sina.com/        凌云论坛支持信箱    #**
**#                                                                #**
**##################################################################*/
%>
<%@ include file="include/config.jsp"%>
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="include/connect.jsp"%>
<%
int forum=0;
String action="",tempSTR="";
//取传递变量
tempSTR=request.getParameter("action");
if(tempSTR!=null)
  action=tempSTR;
tempSTR=request.getParameter("forum");
if(tempSTR!=null && !tempSTR.equals(""))
  forum=Integer.parseInt(tempSTR);
//论坛的预备变量声明
int db=0,styleid=0,number=0,id=0,membergone=0,authornumber=0,postsnumber=0,replynumber=0,announcementid=0;
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0,now_second=0;
String now_date="",now_time="";
//定义boardprepare.jsp中的变量
String dispview="",boardtitle="",boardname="",title="",version="",copyright="",support="",programmer="",programemail="",homename="",homeurl="",togb="1",status="",maintainreason="",announcement="1",boardurl="",showfastlogin="",dispborn="",styleQuery="";
//公告变量声明
String announcementtitle="",announcementpostat="";
//快速登录的变量声明。
int quickstyleid=0,quickdb=0;
String quickstyletitle="",quickdbname="";
//用户cookie变量声明
String cookieid="",cookiename="",username="",usermode="",cookiemode="";
//论坛主题变量定义
int forumid=0,dbid=0,adminid=0,adminmode=0,dbhavenewnumber=0;
String forumexpand="1",forumname="",dbname="",dbdescription="",startnewthreads="",dbgraphic="",adminname="",dbicon="";
ResultSet rs2,rs3;
//论坛最后回复帖子变量定义
int postsauthorid=0,poststopic=0;
String poststitle="",poststitleclue="",postspostat="",postsauthorname="";
//联盟论坛变量定义
String allianceforumname="",allianceforumurl="",allianceforumweblogo="",allianceforumdescription="";
//用户信息变量定义
String userip="",useros="",userbrowser="";
//论坛状态变量定义
int maxonlinenumber=0,registernumber=0,visitnumber=0,visittimes=0,clicktimes=0,dbusernumber=0;
String recordat="",onlineview="0";
//在线用户变量定义
int onlineid=0,onlinedb=0,onlineusermode=0;
String onlineusername="",onlineuserlocation="",logintime="",lastactivetime="";
//管理员设置功能变量定义
String newmsgpop="",adminonlineview="",showskin="";
%>
<%@ include file="include/boardprepare.jsp"%>
<%@ include file="include/style.jsp"%>
<%@ include file="include/icon.jsp"%>
<%
//取管理员的设置变量
rs=connect.executeQuery("select newmsgpop,onlineview,showskin from style where adminselected='1'");
if(rs.next()) {
  newmsgpop=rs.getString(1);
  adminonlineview=rs.getString(2);
  showskin=rs.getString(3);
}
rs=connect.executeQuery("select showfastlogin,dispborn from config where id=1");
if(rs.next()) {
  showfastlogin=rs.getString(1);
  dispborn=rs.getString(2);
}
//查看论坛是否有新帖
String activetime="0000-00-00";
if(!cookiemode.equals("1")) {
  rs=connect.executeQuery("select activetime from author where id="+cookieid);
  if(rs.next())
    activetime=rs.getString(1);
}
//记录用户目前的位置
connect.executeUpdate("update author set db=0 where id="+cookieid+" and db!=0");
%>
<!--//html from here-->
<%@ include file="include/head.jsp"%>
<body <%=lbbody%>>
<%@ include file="include/userheader.jsp"%>
<%
//提示用户的短消息
if(newmsgnumber!=0 && newmsgpop.equals("1"))
  out.println("<script>openScript('messanger.jsp?action=show',420,320);</script>");
%>
<p>
<script language="javascript">
function O3(id) {window.open("forums.jsp?forum="+id);}
function O9(id) {window.open("profile.jsp?action=show&memberid="+id);}
</script>
<%@ include file="include/adbanner.jsp"%>
<br>
<%@ include file="include/announcement.jsp"%>
<table cellspacing=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center><tr><td height=1></td></tr></table>
<%
if((cookiename.equals("") || cookiename.equals("客人")) && (showfastlogin.equals("top") || showfastlogin.equals("all"))) {
%>
<%@ include file="include/quicklogin.jsp"%>
<%
}
%>
<table cellpadding=6 cellspacing=0 width=<%=tablewidth%> height=28 align=center  bordercolor=<%=tablebordercolor%> border=1>
 <tr>
  <td bgcolor=<%=titlecolor%> width=26 align=center><font color=<%=titlefontcolor%>><b>状态</b></font></td>
  <td bgcolor=<%=titlecolor%> width=* align=center><font color=<%=titlefontcolor%>><b>论坛名称</b></font> <font color=<%=fontcolormisc%>>[<a href=index.jsp?action=expand>展开所有</a>] [<a href=index.jsp?action=depand>收缩所有</a>]</font></td>
  <td bgcolor=<%=titlecolor%> width=80 align=center><font color=<%=titlefontcolor%>><b>版主</b></font></td>
  <td bgcolor=<%=titlecolor%> width=38 align=center><font color=<%=titlefontcolor%>><b>主题</b></font></td>
  <td bgcolor=<%=titlecolor%> width=42 align=center><font color=<%=titlefontcolor%>><b>回复</b></font></td>
  <td bgcolor=<%=titlecolor%> width=168 align=center><font color=<%=titlefontcolor%>><b>最后更新</b></font></td>
  <td bgcolor=<%=titlecolor%> width=26 align=center><font color=<%=titlefontcolor%>><b><a title="将“凌云论坛”添加到收藏夹" href="javascript:window.external.addFavorite('<%=boardurl%>', '<%=boardname%>')">收藏</a></b></font></td>
 </tr>
</table>
<%
if(action.equals("expand")) {
  connect.executeUpdate("update forumexpand set forumexpand='1' where authorid="+cookieid+" and forumexpand='0'");
}
else if(action.equals("depand")) {
  forumexpand="0";
  connect.executeUpdate("update forumexpand set forumexpand='0' where authorid="+cookieid+" and forumexpand='1'");
}
rs=connect.executeQuery("select id,forumname from forum order by id");
while(rs.next()) {
  forumid=rs.getInt(1);
  forumname=rs.getString(2);
  if(!action.equals("expand") && !action.equals("depand")) {
    rs2=connect.executeQuery2("select forumexpand from forumexpand where authorid="+cookieid+" and forumid="+forumid);
    if(rs2.next()) {
      forumexpand=rs2.getString(1);
      if(forum==forumid) {
        if(forumexpand.equals("1"))
          forumexpand="0";
        else forumexpand="1";
        connect.executeUpdate("update forumexpand set forumexpand='"+forumexpand+"' where authorid="+cookieid+" and forumid="+forumid);
      }
    }
    else {
      if(forum==forumid) {
        forumexpand="0";
        connect.executeUpdate("insert into forumexpand (forumexpand,authorid,forumid) values ('"+forumexpand+"',"+cookieid+","+forumid+")");
      }
    }
  }
%>
<table cellpadding=6 cellspacing=0 width=<%=tablewidth%> height=24 align=center bordercolor=<%=tablebordercolor%> border=1>
 <tr>
  <td bgcolor=<%=catback%> background=images/ colspan=7 height=24 align=left>
    <a href=index.jsp?forum=<%=forumid%>><img src=images/<%if(forumexpand.equals("0")) out.println("cat.gif"); else out.println("cat1.gif");%> border=0 width=9 height=9> <font color=<%=catfontcolor%>><b><%=forumname%></b></font></a>
  </td>
 </tr>
</table>
<%
if(forumexpand.equals("1")) {
rs2=connect.executeQuery2("select id,dbname,dbdescription,startnewthreads,dbgraphic from db where forum="+forumid+" order by id");
while(rs2.next()) {
  dbid=rs2.getInt(1);
  dbname=rs2.getString(2);
  dbdescription=rs2.getString(3);
  startnewthreads=rs2.getString(4);
  dbgraphic=rs2.getString(5);
  dbusernumber=connect.getRowNum("author where online='1' and db="+dbid);
  if(!cookiemode.equals("1"))
    dbhavenewnumber=connect.getRowNum("posts where db="+dbid+" and postat>'"+activetime+"'");
  if(dbhavenewnumber==0) {
    if(startnewthreads.equals("yes"))
      dbicon=zg_nonew;
    else if(startnewthreads.equals("all"))
      dbicon=kf_nonew;
    else if(startnewthreads.equals("follow"))
      dbicon=pl_nonew;
    else if(startnewthreads.equals("no"))
      dbicon=jh_pic;
  }
  else {
    if(startnewthreads.equals("yes"))
      dbicon=zg_havenew;
    else if(startnewthreads.equals("all"))
      dbicon=kf_havenew;
    else if(startnewthreads.equals("follow"))
      dbicon=pl_havenew;
    else if(startnewthreads.equals("no"))
      dbicon=jh_pic;
  }
%>
<table cellpadding=6 cellspacing=0 width=<%=tablewidth%> height=24 align=center bordercolor=<%=tablebordercolor%> border=1>
 <tr>
  <td bgcolor=<%=forumcolorone%> align=center width=26>
    <img src=images/<%=dbicon%> width=13 height=16 border=0>
  </td>
  <td bgcolor=<%=forumcolortwo%> valign=top>
    <table>
     <tr>
      <td></td>
      <td>
        <a href=db.jsp?db=<%=dbid%> TITLE="目前共有 <%=dbusernumber%> 人在此论坛上!"><font color=<%=posternamecolor%>><%=dbname%></font></a>&nbsp;&nbsp;<a href=jinghua.jsp?db=<%=dbid%>><font color=<%=posternamecolor%>>[精华区]</font></a>
        <br><font color=<%=forumfontcolor%>><%=dbdescription%></font>
      </td>
     </tr>
    </table>
  </td>
  <td bgcolor=<%=forumcolorone%> align=center width=80>
<%
rs3=connect.executeQuery3("select authorid,authorname,usermode from admin where db="+dbid+" order by usermode desc,id");
if(rs3.next()) {
  adminid=rs3.getInt(1);
  adminname=rs3.getString(2);
  adminmode=rs3.getInt(3);
  if(adminmode==1)
    out.println("<a href=\"javascript:O9('"+adminid+"')\" title='斑竹'><font color="+forumfontcolor+">"+adminname+"</font></a><br>");
  else
    out.println("<a href=\"javascript:O9('"+adminid+"')\" title='副斑竹'>"+adminname+"</a><br>");
}
else out.println("暂时空缺");
while(rs3.next()) {
  adminid=rs3.getInt(1);
  adminname=rs3.getString(2);
  adminmode=rs3.getInt(3);
  if(adminmode==1)
    out.println("<a href=\"javascript:O9('"+adminid+"')\" title='斑竹'><font color="+forumfontcolor+">"+adminname+"</font></a><br>");
  else
    out.println("<a href=\"javascript:O9('"+adminid+"')\" title='副斑竹'>"+adminname+"</a><br>");
}
postsnumber=connect.getRowNum("posts where db="+dbid+" and parentid=0");
replynumber=connect.getRowNum("posts where db="+dbid+" and parentid!=0");
%>
  </td>
  <td bgcolor=<%=forumcolortwo%> align=center width=38><font color=<%=forumfontcolor%>><%=postsnumber%></font></td>
  <td bgcolor=<%=forumcolortwo%> align=center width=42><font color=<%=forumfontcolor%>><%=replynumber%></font></td>
  <td bgcolor=<%=forumcolorone%> width=168>
<%
  if(postsnumber==0)
    out.println("<font color="+lastpostfontcolor+">&nbsp;没有贴子</font>");
  else {
    rs3=connect.executeQuery3("select authorid,author,date_format(postat,'%Y年%m月%d日 %H:%i') as postat,groupid from posts where db="+dbid+" order by postat desc limit 1");
    if(rs3.next()) {
      postsauthorid=rs3.getInt(1);
      postsauthorname=rs3.getString(2);
      postspostat=rs3.getString(3);
      poststopic=rs3.getInt(4);
    }
    rs3=connect.executeQuery3("select title from posts where db="+dbid+" and groupid="+poststopic+" and parentid=0");
    if(rs3.next()) {
      poststitle=rs3.getString(1);
      if(poststitle.length()>9)
        poststitleclue=poststitle.substring(0,9)+"…";
      else poststitleclue=poststitle;
    }
    out.println("<font color="+posternamecolor+">&nbsp;主题: </font><a href=topic.jsp?db="+dbid+"&topic="+poststopic+"&replynum=last title=\""+poststitle+"\">"+poststitleclue+"</a><BR>");
    out.println("<font color="+posternamecolor+">&nbsp;最后发表: </font><a href=\"javascript:O9('"+postsauthorid+"')\">"+postsauthorname+"</a> <img src='images/lastpost.gif' width=11 height=10><BR>");
    out.println("<font color="+posternamecolor+">&nbsp;"+postspostat+"</font><BR>");
  }
%>
  </td>
  <td bgcolor=<%=forumcolortwo%> align=center width=26>
   <span style="CURSOR: hand" onClick="window.external.AddFavorite('<%=boardurl%>db.jsp?db=<%=dbid%>', '<%=boardname%> - <%=dbname%>')">
   <IMG SRC="images/fav_add.gif" BORDER="0" width=15 height=15 ALT="将 <%=dbname%> 添加到收藏夹"></span>
  </td>
 </tr>
</table>
<%
  }
/*
<table cellpadding=6 cellspacing=0 width=97% height=24 align=center bordercolor= border=1>
<tr><td bgcolor=#D0F0FF align=center width=26><a href=javascript:O3(2)><img src=http://itshow/lb5000ii/non-cgi/images/jinghua.gif width=13 height=16 border=0></a></td>
<td bgcolor=#EDFBFF valign=top width=*>
<table><tr><td></td><td><a href=forums.cgi?forum=2 TITLE="目前共有 0 人在此论坛上!"><font color=#000000>精华区</font></a><font color=#000000><br>精华论坛</td></tr></table>
</td>
<td bgcolor=#D0F0FF align=center width=80><font color=#000000>暂时空缺</td>
<td bgcolor=#EDFBFF align=center width=38><font color=>0</td>
<td bgcolor=#EDFBFF align=center width=42><font color=>0</td>
<td bgcolor=#D0F0FF width=168><font color=#000000><font color=#000000>&nbsp;没有贴子</font></td>
<td bgcolor=#EDFBFF align=center width=26><span style="CURSOR: hand" onClick="window.external.AddFavorite('http://itshow/cgi/forums.cgi?forum=2', '凌云论坛 - 精华区')"><IMG SRC="http://itshow/lb5000ii/non-cgi/images/fav_add.gif" BORDER="0" width=15 height=15 ALT="将精华区添加到收藏夹"></span></td>
</tr></table>
*/
 }
}
%>
<%
number=connect.getRowNum("allianceforum");
if(number!=0) {
%>
<img src="" width=9 height=5><br>
<%@ include file="include/allianceforum.jsp"%>
<%
}
%>
<img src="" width=10 height=5><br>
<%@ include file="include/userstatus.jsp"%>
<%
if(adminonlineview.equals("1")) {
%>
<img src="" width=10 height=5><br>
<%@ include file="include/boardstatus.jsp"%>
<%
}
if(dispview.equals("1")) {
%>
<img src="" width=9 height=5><br>
<%@ include file="include/boardicon.jsp"%>
<%
}
if((cookiename.equals("") || cookiename.equals("客人")) && (showfastlogin.equals("bottom") || showfastlogin.equals("all"))) {
%>
<%@ include file="include/quicklogin.jsp"%>
<%
}
%>
<br>
<%@ include file="include/foot.jsp"%>
<%
rs.close();
connect.close();
%>
</body>
</html>

⌨️ 快捷键说明

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