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

📄 install.jsp

📁 BBS系统
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%
/*##################################################################**
**#  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"%>
<%
String action="",tempSTR="",submit="",query="";
int floodcontrollimit=0,timedifference=0,resultnumber=0;
String uploaddir="",uploadurl="",homeurl="",boardurl="",emailsupport="",smtp="",sendemail="",getemail="",boardname="",boarddescription="",copyright="",homename="",floodcontrol="",togb="",announcement="";
String supername="",superpassword="";
boolean createok=true,createok_style=true,insertok=true,updateok=true;
tempSTR=request.getParameter("action");
if(tempSTR!=null)
  action=tempSTR;
tempSTR=request.getParameter("submit");
if(tempSTR!=null)
  submit=tempSTR;
ResultSet rs;
String previousversion="",previousversionnumber="";
resultnumber=connect.getRowNum("config");
if(resultnumber==1) {
  rs=connect.executeQuery("select version,versionnumber from config where id=1");
  if(rs.next()) {
    previousversion=rs.getString(1);
    previousversionnumber=rs.getString(2);
  }
}
if(action.equals("step_three")) {
  tempSTR=request.getParameter("floodcontrollimit");
  if(tempSTR!=null)
    floodcontrollimit=Integer.parseInt(tempSTR);
  tempSTR=request.getParameter("timedifference");
  if(tempSTR!=null)
    timedifference=Integer.parseInt(tempSTR);
  tempSTR=request.getParameter("togb");
  if(tempSTR!=null)
    togb=tempSTR;
  tempSTR=request.getParameter("uploaddir");
  if(tempSTR!=null)
    uploaddir=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("uploadurl");
  if(tempSTR!=null)
    uploadurl=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("homeurl");
  if(tempSTR!=null)
    homeurl=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("boardurl");
  if(tempSTR!=null)
    boardurl=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("emailsupport");
  if(tempSTR!=null)
    emailsupport=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("smtp");
  if(tempSTR!=null)
    smtp=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("sendemail");
  if(tempSTR!=null)
    sendemail=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("getemail");
  if(tempSTR!=null)
    getemail=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("boardname");
  if(tempSTR!=null)
    boardname=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("boarddescription");
  if(tempSTR!=null)
    boarddescription=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("copyright");
  if(tempSTR!=null)
    copyright=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("homename");
  if(tempSTR!=null)
    homename=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("floodcontrol");
  if(tempSTR!=null)
    floodcontrol=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("announcement");
  if(tempSTR!=null)
    announcement=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  updateok=connect.executeUpdate("update config set floodcontrollimit="+floodcontrollimit+",timedifference="+timedifference+",uploaddir='"+uploaddir+"',uploadurl='"+uploadurl+"',homeurl='"+homeurl+"',boardurl='"+boardurl+"',emailsupport='"+emailsupport+"',smtp='"+smtp+"',sendemail='"+sendemail+"',getemail='"+getemail+"',boardname='"+boardname+"',boarddescription='"+boarddescription+"',copyright='&copy; "+copyright+"',homename='"+homename+"',floodcontrol='"+floodcontrol+"',togb='"+togb+"',announcement='"+announcement+"' where id=1");
}
else if(action.equals("final_step")) {
   rs=connect.executeQuery("select togb,boardurl from config where id=1");
   if(rs.next()) {
      togb=rs.getString(1);
      boardurl=rs.getString(2);
   }
  tempSTR=request.getParameter("supername");
  if(tempSTR!=null)
    supername=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  tempSTR=request.getParameter("superpassword");
  if(tempSTR!=null)
    superpassword=togb.equals("1")?connect.toGB(tempSTR):tempSTR;
  updateok=connect.executeUpdate("update config set supername='"+supername+"',superpassword='"+superpassword+"' where id=1");
  resultnumber=connect.getRowNum("author where usermode=4");
  if(resultnumber==0)
    insertok=connect.executeUpdate("insert into author (username,password,onlineview,registertime,status,usermode,lastactivetime) values ('"+supername+"','"+superpassword+"','1',now(),'0','4',now())");
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>LyBBS (凌云论坛) ver 1.2.b2 安装向导</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<script language="JavaScript">
function check() {
   if(document.superuser.supername.value=="") {
      alert("没有输入管理员名称!");
      document.superuser.supername.focus();
   }
   else if(document.superuser.superpassword.value=="") {
      alert("没有输入管理员密码!");
      document.superuser.superpassword.focus();
   }
   else if(document.superuser.superpassword.value!=document.superuser.superpasswordconfirm.value) {
      alert("两次输入的密码不一致!");
      document.superuser.superpasswordconfirm.focus();
   }
   else document.superuser.submit();
}
</script>
</HEAD>
<BODY bgcolor="#FFFFFF">
<FORM action=install.jsp method=post name=superuser>
  <FONT color=#000000 face=宋体 size=5> 
  <H1><b>LyBBS『凌云论坛』ver 1.2.beta-2 安装向导</b></H1>
  </FONT> 
  <p><font color='#000000' face='宋体'>论坛程序:</font> <a href='mailto:horseye@sina.com'>星语凌 
    『teddy』</a> <br>
    <font color='#000000' face='宋体'>论坛界面:</font> <a href='mailto:horseye@sina.com'>星语凌 
    『teddy』</a> <a href='http://www.leoboard.com/' target='_blank'>雷傲论坛『LeoBoard』</a><br>
    论坛支持: <a href='http://www.unix-now.com/lybbs' target='_blank'>凌云论坛</a><br>
    论坛版权: 凌云工作室<br>
    特别感谢: <a href='http://www.lance-tech.net' target='_blank'>南京蓝石科技发展有限公司</a></p>
  <HR color=#000000 noShade>
  <p><BR>
    <FONT color=#000000 face=宋体><B>欢迎使用 LyBBS ver 1.2.beta-2 安装向导!</B> <BR>
    <%
if(action.equals("")) {
%>
    <INPUT name=action type=hidden value=step_two>
    <BR>
    <B>第一步:</B> 将进行数据库初始化!注意:数据库初始化将建立 lyBBS 所需要的各个数据表,在初始化之前,请确保数据库已经开始工作,并请一定要先浏览阅读[%lybbs_home%]\readme\LyBBS的Mysql数据库创建及维护管理.txt,并请设置[%lybbs_home%]\include\config.jsp和[%lybbs_home%]\include\connect.jsp 
    如果初始化过程中出现错误,请参阅错误信息和[%lybbs_home%]\readme\readme.txt及[%lybbs_home%]\readme\LyBBS的Mysql数据库创建及维护管理.txt,并确保两个设置文件已经设置正确。</FONT></p>
  <p><font color='#000000' face='宋体'><b><font color='#0000FF'>提示:</font></b>初始化工作是在库中创建所有的全新的数据表,如果你已经创建了所有的数据表,可以跳过这一步!</font><BR>
  </p>
  <HR color=#000000 noShade>
<%
  if(previousversionnumber.equals("")) {
%>
  <p> 要初始化数据库吗?
<input type=submit name='submit' value=OK>
    立即开始   
    <input type=submit name='submit' value=NO>
    跳过初始化<BR>
<%
  }
  else if(previousversionnumber.equals("20020425")) {
%>
  <p> 程序检测出您已经安装过<%=previousversion%>版本,现在是否升级数据库?
<input type=submit name='submit' value=OK>
    立即升级
<%
  }
  else if(previousversionnumber.equals("20020612")){
%>
  <p>您已经升级成了最新版<%=previousversion%>!!无需升级或安装!!
<%
  }
  else {
%>
  <p>您已经修改了论坛内部信息,程序无法检测您的论坛版本。
  <br>程序已经删除掉数据库的所有数据,准备重新创建数据库!
<%
  }
}
else if(action.equals("step_two") && submit.equals("OK")) {
%>
    <%@ include file="initdatabase.jsp"%>
<%
  if(previousversionnumber.equals("")) {
    out.println("<INPUT name=action type=hidden value=step_two><br>");
    out.println("<HR color=#000000 noShade>");
    if(createok_style) {
       out.println("<p>数据表已经创建完成,但还有一些数据需要创建,点击continue继续 <input type=button name='submit' value=CONTINUE onClick=\"location.href='initstyle2.jsp'\">");
    }
    else {
       out.println("<p>检测到有数据表没有创建成功,请参阅<font color=#ff0000>[%lybbs_home%]\\readme\\LyBBS的Mysql数据库创建及维护管理.txt</font><br>");
       out.println("点击back后退 <input type=button name='back' value='BACK,后退到第一步' onClick=\"history.back()\">");
    }
  }
  else if(previousversionnumber.equals("20020425")) {
    out.println("<INPUT name=action type=hidden value=step_four><br>");
    out.println("<HR color=#000000 noShade>");
    if(createok_style) {
      out.println("<p>数据表已经升级完成,点击continue继续 <input type=submit name='submit' value=CONTINUE>");
    }
  }
}
else if(action.equals("step_two")) {
//取当前系统时间
int now_year=0,now_month=0,now_day=0,now_hour=0,now_minute=0;
String now_time="";
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_time=now_year+"年0"+now_month+"月";
}
else {
  now_time=now_year+"年"+now_month+"月";
}
if(now_day<10) {
  now_time+="0"+now_day+"日";
}
else {
  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;
}
    int lastfoldindex=0;
    String installdir="";
    installdir=connect.ReplaceChar(request.getRealPath("/"),'\\','/');
    lastfoldindex=installdir.lastIndexOf("/");
    uploaddir=installdir.substring(0,lastfoldindex)+"/upload/";
    homeurl="http://"+request.getServerName();
    if(request.getServerPort()==80)
       homeurl+="/";
    else homeurl+=":"+request.getServerPort()+"/";
    boardurl=homeurl+"lybbs/";
    uploadurl=boardurl+"upload/";
%>
    <INPUT name=action type=hidden value=step_three>
    <BR>
    <B>第二步:</B> 在递交表单前,请仔细查看整个下面的内容指示,并检查自动提供的数据是否正确!<BR>
    当你递交表单后,本安装向导会检测所有你输入的数据,如果数据输入错误,将会有详细的提示!<BR>
    <BR>
    <B>在执行本程序下一步之前,请确定你已经把本程序完整上传到jsp可以支持的文件夹里,并已经将所有文件的属性设置正确了!</B><BR>
    <BR>
    下面的所有设置数据都可以在 LyBBS 的管理中心中重新设置。为了安全起见,本程序在成功完成设置任务后,将会自毁。 如果你希望重新利用本程序来设置的话,请重新上传运行本程序。<BR>
  <HR color=#000000 noShade>
  <p><BR>
    <B>文件路径设置</B><BR>
    <BR>
    下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<FONT 
color=#ff0000><BR>
    请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</FONT><BR>
    <BR>
    <FONT 
color=#ff0000>如果你使用的是 Windows 系列操作系统,请双写反斜杠(比如: d:\\path\\to\\lyBBS\\)),或者使用斜杠来代替反斜杠(比如:d:/path/to/lybbs/)!<br>
    <br>
    <font 
color=#ff0000>如果你使用的是 Unix 系列操作系统,请直接单写斜杠(比如: /path/to/lyBBS/)!</font> </font><BR>
    <BR>
    <B>设置时请务必在路径的最后加上除号‘\\’或‘/’。</B> </p>
  <p><font color=#0000ff face=宋体><b>这里,假设你的LyBBS在服务器上的安装路径是D:\web\lybbs(下面将记为[%lybbs_home%]),URL直接访问路径是http://host/lybbs(下面将记为[%lyBBS_url%]),文件夹中将包括index.jsp等文件、images、include、upload等文件夹。</b></font><BR>
    <BR>
    <FONT color=#0000ff face=宋体><B>设置 上传文件 的路径。</B></FONT>(主要是为用户上传图片等文件的文件夹)<BR>
    <BR>
    在这里设置的是安装“路径”,不是 URL,所以它肯定<B>不是</B> 'http://' 开头的。<BR>
    这个位置包含了所有 LyBBS 中用户所有上传文件的文件夹。 <BR>
    <BR>
    <INPUT name=uploaddir size=60 value="<%=uploaddir%>">
    (*默认为[%lybbs_home%]/upload/)<BR>
    <BR>
  </p>
  <HR color=#000000 noShade>
<BR>
  <B>设置你网站的 URL 路径</B><BR>
  <BR>下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<FONT 
color=#ff0000><BR>请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</FONT><BR><BR>
  <B>请注意:在每个 URL 地址结尾需加反斜杠 '/' !</B> <BR>
  <BR>
  <FONT color=#0000ff face=宋体><B>设置上传文件 URL 路径。</B></FONT><BR>
  这里是 URL 路径。<B>必须</B>以 'http://' 开始。<BR>
  这个URL路径包含了所有的 LyBBS 上传文件。 <BR>
  <BR>
  <INPUT name=uploadurl size=60 value='<%=uploadurl%>'>
  (*默认为[%lyBBS_url%]/upload/)<BR>
  <BR><BR><FONT color=#0000ff face=宋体><B>设置您主页的 
URL 地址。</B></FONT><BR>
  这里是 URL 路径。<B>必须</B>以 'http://' 开始。<BR>
  简单的说,就是你在浏览器上输入的访问你主页的地址。 <BR><BR><INPUT name=homeurl size=70 value='<%=homeurl%>'> <BR><BR><BR>
  <FONT color=#0000ff face=宋体><B>LyBBS 的 URL 路径。</B></FONT><BR>
  这里是 URL 路径。<B>必须</B>以 'http://' 开始。<BR><BR>
  <INPUT name=boardurl size=70 value='<%=boardurl%>'>
  (*默认为[%lyBBS_url%])<BR>
  <BR>
<HR color=#000000 noShade>
<BR>
  <B>邮件功能</B><BR>
  <BR>下面的默认设置仅仅适用于大部分安装本程序的客户,不是所有的客户都适用。如果有错误,请自行修改成正确的值。<BR><FONT 
color=#ff0000>请仔细检查所有的设置,如果你对这些设置有任何的疑问,请询问你的主机提供商!</FONT> <BR><BR>
  <FONT color=#0000ff face=宋体><B>您是否希望在论坛上使用邮件功能?(目前仅支持smtp协议)</B></FONT><BR>
  如果您选择使用邮件功能,请务必保证您的smtp服务器可用!如果您不是很清楚,请关闭邮件功能!<BR>
  <BR>
  <SELECT name=emailsupport>
    <OPTION value='0'>关闭邮件功能<OPTION 
  selected value='1'>使用邮件功能</OPTION></SELECT>
  <BR>
  <BR><BR><FONT color=#0000ff face=宋体><B>SMTP 服务器</B></FONT><BR><BR>
  <INPUT name=smtp size=60 value=localhost>
  <BR>

⌨️ 快捷键说明

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