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

📄 boardprepare.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/        凌云论坛支持信箱    #**
**#                                                                #**
**##################################################################*/
%>
<%
ResultSet rs;
//取论坛资料
rs=connect.executeQuery("select boardname,title,version,copyright,support,programmer,programemail,homename,homeurl,togb,status,maintainreason,announcement,boardurl from config where id=1");
if(rs.next()) {
  boardname=rs.getString(1);
  title=rs.getString(2);
  version=rs.getString(3);
  boardtitle=boardname;
  copyright=rs.getString(4);
  support=rs.getString(5);
  programmer=rs.getString(6);
  programemail=rs.getString(7);
  homename=rs.getString(8);
  homeurl=rs.getString(9);
  togb=rs.getString(10);
  status=rs.getString(11);
  maintainreason=rs.getString(12);
  announcement=rs.getString(13);
  boardurl=rs.getString(14);
}
if(status.equals("0")) {
  response.sendRedirect("forummaintain.jsp");
}
int newmsgnumber=0;
tempSTR=request.getParameter("db");
if(tempSTR!=null)
  db=Integer.parseInt(tempSTR);
Object o=session.getAttribute("cookieid");
if(o!=null)
  cookieid=o.toString();
o=session.getAttribute("cookiename");
if(o!=null)
  cookiename=o.toString();
o=session.getAttribute("cookiemode");
if(o!=null)
  cookiemode=o.toString();
if(cookieid.equals("")) {
  rs=connect.executeQuery("select id from author where usermode='1' and online='0'");
  if(rs.next()) {
    cookieid=String.valueOf(rs.getInt(1));
    connect.executeUpdate("update author set online='1',logintime=now(),lastactivetime=now() where id="+cookieid);
    //清除访客留下的样式信息
    connect.executeUpdate("update author set styleid=0 where id="+cookieid+" and styleid!=0");
  }
  else {
    connect.executeUpdate("insert into author (username,logintime,lastactivetime, online,onlineview,registertime,usermode) values ('客人',now(),now(),'1','1',now(),'1')");
    rs=connect.executeQuery("select max(id) from author");
    if(rs.next())
      cookieid=String.valueOf(rs.getInt(1));
  }
  cookiename="客人";
  cookiemode="1";
  //修改论坛访问信息
  connect.executeUpdate("update boardstatus set visittimes=visittimes+1 where id=1");
%>
<%@ include file="setcookie.jsp"%>
<%
}
else {
  connect.executeUpdate("update author set lastactivetime=now() where id="+cookieid);
  newmsgnumber=connect.getRowNum("webqq where toname='"+cookiename+"' and viewed='0' and operation='get'");
}
if(cookieid.equals("") || cookieid.equals("0"))
  response.sendRedirect("../errorPage.jsp");
rs=connect.executeQuery("select styleid,onlineview from author where id="+cookieid);
if(rs.next()) {
  styleid=rs.getInt(1);
  onlineview=rs.getString(2);
}
//取styleid
if(db!=0 && styleid==0) {
  rs=connect.executeQuery("select id from style where db="+db);
  if(rs.next()) {
    styleid=rs.getInt(1);
  }    
}
if(styleid==0) {
  rs=connect.executeQuery("select id from style where adminselected='1'");
  if(rs.next())
    styleid=rs.getInt(1);
  else styleid=1;
}
//取用户最大不活动时间
rs=connect.executeQuery("select membergone,dispview from style where id="+styleid);
if(rs.next()) {
  membergone=rs.getInt(1);
  dispview=rs.getString(2);
}
//把超过时间没有动作的用户改成offline
connect.executeUpdate("update author set online='0',activetime=now() where (UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(lastactivetime))>("+membergone+"*60) and online='1'");
//更新论坛访问资料
connect.executeUpdate("update boardstatus set clicktimes=clicktimes+1 where id=1");
rs=connect.executeQuery("select regaccess from style where adminselected='1'");
if(rs.next()) {
  String nowpath=String.valueOf(request.getRequestURL());
  int nowpathlength=nowpath.length();
  String nowfilename=nowpath.substring(nowpath.lastIndexOf("/")+1,nowpathlength);
  if(rs.getString(1).equals("1") && cookiemode.equals("1") && !nowfilename.equals("loginout.jsp")) {
    response.sendRedirect("loginout.jsp");
  }
}
//取当前系统时间
Calendar now = Calendar.getInstance();
now_year=now.get(Calendar.YEAR);
now_month=now.get(Calendar.MONTH)+1;
now_day=now.get(Calendar.DATE);
now_hour=now.get(Calendar.HOUR_OF_DAY);
now_minute=now.get(Calendar.MINUTE);
if(now_month<10) {
  now_date=now_year+"年0"+now_month+"月";
  now_time=now_year+"年0"+now_month+"月";
}
else {
  now_date=now_year+"年"+now_month+"月";
  now_time=now_year+"年"+now_month+"月";
}
if(now_day<10) {
  now_date+="0"+now_day+"日";
  now_time+="0"+now_day+"日";
}
else {
  now_date+=now_day+"日";
  now_time+=now_day+"日";
}
if(now_hour<10) {
  now_time+=" 0"+now_hour;
}
else {
  now_time+=" "+now_hour;
}
if(now_minute<10) {
  now_time+=":0"+now_minute;
}
else {
  now_time+=":"+now_minute;
}
%>

⌨️ 快捷键说明

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