?? install.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"%>
<%
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='© "+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 + -