📄 setup.asp
字号:
<option value="3">Snitz Forums 2000 V3.1 Beta 5</option>
<option value="3">Snitz Forums 2000 V3.1 Beta 4</option>
<option value="2">Snitz Forums 2000 V3.1 Beta 3</option>
<option value="1">Snitz Forums 2000 V3.1 Beta 2</option>
<option value="0">Snitz Forums 2000 V3.0 Service Release 2</option>
<option value="0">Snitz Forums 2000 V3.0 Service Release 1</option>
<option value="0">Snitz Forums 2000 Version 3.0 Final</option>
<option value="0">Snitz Forums 2000 V3 RC5</option>
<option value="0">Snitz Forums 2000 V3 RC4</option>
<option value="0">Snitz Forums 2000 V3 RC3</option>
<option value="0">Snitz Forums 2000 V3 RC2</option>
<option value="0">Snitz Forums 2000 V3 RC1</option>
</select></p>
<p>
<font face="宋体, Arial, Helvetica" size="2">
Current database versionstring =<br><b> <% =strVersion %></b>
</p>
<% if strDBType = "sqlserver" then %>
<p>Select the SQL-server version you are using:</p>
<p><input type="radio" class="radio" name="SQL_Server" value="SQL6">SQL-Server 6.5<br>
<input type="radio" class="radio" checked name="SQL_Server" value="SQL7">SQL-Server 7</p>
<% end if %>
<% if strDBType <> "access" then %>
<p>To upgrade the database you need to provide a username
and password of a user that has table creation/modification rights at the database you use.<br>
This might not be the same user as you use in your connectionstring !<br>
<br>
Name: <input type="text" name="DBUserName" size="20"><br>
Password: <input type="password" name="DBPassword" size="20"></p>
<% end if %>
</font>
</td>
</tr>
<tr>
<td align="center"><input type="submit" value="Continue" id="Submit1" name="Submit1"></td>
</tr>
</form>
</table>
<%
else
strSender = Request.QueryString("MAIL")
%>
<div align=center><center>
<p><font face="宋体, Arial, Helvetica" size="4">You need to logon first.</font></p>
</center></div>
<form action="setup_login.asp" method="post" id=Form1 name=Form1>
<input type="hidden" name="setup" value="Y">
<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
<tr>
<td bgColor=navyblue align="left">
<p>
<font face="宋体, Arial, Helvetica" size="2">
To upgrade the database you need to be logged on as a forum administrator.<br>
<%
if strSender <> "" then
%>
If you are not the Administrator of this forum<br> please report this error here: <a href="mailto:<% =strSender %>"><% =strSender %></a>.<br><br>
<%
end if
%>
</font></p></td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="5" border="0" cellspacing="2" cellpadding="0" align="center">
<tr>
<td align="center" colspan="2" bgColor=navyblue><b><font face="宋体, Arial, Helvetica" size="2">管理者登入</font></b></td>
</tr>
<tr>
<td align="right" nowrap><b><font face="宋体, Arial, Helvetica" size="2">使用者名称:</font></b></td>
<td><input type="text" name="Name" size="20"></td>
</tr>
<tr>
<td align="right" nowrap nowrap><b><b><font face="宋体, Arial, Helvetica" size="2">密码:</font></b></td>
<td><input type="Password" name="Password" size="20"></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="登入" id="Submit1" name="Submit1"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</font>
<%
end if
elseif ResponseCode = 4 then '## start upgrading database
if Session(strCookieURL & "Approval") = "15916941253" Then
'## logon was ok proceed with upgrade
%>
<div align=center><center>
<p><font face="宋体, Arial, Helvetica" size="4">Please Wait until the upgrade has been completed !</font></p>
<%
on error resume next
strUpgradeString = strConnString
strSQL_Server = Request.Form("Sql_Server")
if strDBType <> "access" then
strUpgradeString = CreateConnectionString(strConnString, Request.Form("DBUserName"), Request.Form("DBPassword"))
end if
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strUpgradeString
for counter = 0 to my_conn.Errors.Count -1
ConnErrorNumber = my_conn.Errors(counter).Number
if ConnErrorNumber <> 0 then
my_conn.Errors.Clear
Response.Redirect "setup.asp?RC=1&EC=" & ConnErrorNumber & "&RET=" & Server.URLEncode("setup.asp?RC=3")
end if
next
on error goto 0
dim intCriticalErrors, intWarnings, Prefix, FieldName, TableName, DataType
intCriticalErrors = 0
intWarnings = 0
Prefix = 1
FieldName = 2
TableName = 3
DataType_Access = 4
DataType_SQL6 = 5
DataType_SQL7 = 6
DataType_MySQL = 7
ConstraintAccess = 8
ConstraintSQL6 = 9
ConstraintSQL7 = 10
ConstraintMySQL = 11
Access = 1
SQL6 = 2
SQL7 = 3
MySql = 4
if not(IsNull(Request.Form("OldVersion"))) then
OldVersion = Request.Form("OldVersion")
else
OldVersion = Request.QueryString("OldVersion")
end if
if OldVersion = 0 then
Dim NewColumns(8,11)
NewColumns(0, Prefix) = strTablePrefix
NewColumns(0, FieldName) = "C_STRSHOWSTATISTICS"
NewColumns(0, TableName) = "CONFIG"
NewColumns(0, DataType_Access) = "SMALLINT"
NewColumns(0, DataType_SQL6) = "SMALLINT"
NewColumns(0, DataType_SQL7) = "SMALLINT"
NewColumns(0, DataType_MySQL) = "SMALLINT"
NewColumns(0, ConstraintAccess) = "NULL"
NewColumns(0, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0362 DEFAULT 1"
NewColumns(0, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0362 DEFAULT 1"
NewColumns(0, ConstraintMySQL) = "DEFAULT 1 NULL"
NewColumns(1, Prefix) = strTablePrefix
NewColumns(1, FieldName) = "C_STRSHOWIMAGEPOWEREDBY"
NewColumns(1, TableName) = "CONFIG"
NewColumns(1, DataType_Access) = "SMALLINT"
NewColumns(1, DataType_SQL6) = "SMALLINT"
NewColumns(1, DataType_SQL7) = "SMALLINT"
NewColumns(1, DataType_MySQL) = "SMALLINT"
NewColumns(1, ConstraintAccess) = "NULL"
NewColumns(1, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0363 DEFAULT 1"
NewColumns(1, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0363 DEFAULT 1"
NewColumns(1, ConstraintMySQL) = "DEFAULT 1 NULL"
NewColumns(2, Prefix) = strTablePrefix
NewColumns(2, FieldName) = "C_STRLOGONFORMAIL"
NewColumns(2, TableName) = "CONFIG"
NewColumns(2, DataType_Access) = "SMALLINT"
NewColumns(2, DataType_SQL6) = "SMALLINT"
NewColumns(2, DataType_SQL7) = "SMALLINT"
NewColumns(2, DataType_MySQL) = "SMALLINT"
NewColumns(2, ConstraintAccess) = "NULL"
NewColumns(2, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0364 DEFAULT 1"
NewColumns(2, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0364 DEFAULT 1"
NewColumns(2, ConstraintMySQL) = "DEFAULT 1 NULL"
NewColumns(3, Prefix) = strTablePrefix
NewColumns(3, FieldName) = "C_STRSHOWPAGING"
NewColumns(3, TableName) = "CONFIG"
NewColumns(3, DataType_Access) = "SMALLINT"
NewColumns(3, DataType_SQL6) = "SMALLINT"
NewColumns(3, DataType_SQL7) = "SMALLINT"
NewColumns(3, DataType_MySQL) = "SMALLINT"
NewColumns(3, ConstraintAccess) = "NULL"
NewColumns(3, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0365 DEFAULT 0"
NewColumns(3, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0365 DEFAULT 0"
NewColumns(3, ConstraintMySQL) = "DEFAULT 0 NULL"
NewColumns(4, Prefix) = strTablePrefix
NewColumns(4, FieldName) = "C_STRSHOWTOPICNAV"
NewColumns(4, TableName) = "CONFIG"
NewColumns(4, DataType_Access) = "SMALLINT"
NewColumns(4, DataType_SQL6) = "SMALLINT"
NewColumns(4, DataType_SQL7) = "SMALLINT"
NewColumns(4, DataType_MySQL) = "SMALLINT"
NewColumns(4, ConstraintAccess) = "NULL"
NewColumns(4, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0366 DEFAULT 0"
NewColumns(4, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0366 DEFAULT 0"
NewColumns(4, ConstraintMySQL) = "DEFAULT 0 NULL"
NewColumns(5, Prefix) = strTablePrefix
NewColumns(5, FieldName) = "C_STRPAGESIZE"
NewColumns(5, TableName) = "CONFIG"
NewColumns(5, DataType_Access) = "SMALLINT"
NewColumns(5, DataType_SQL6) = "SMALLINT"
NewColumns(5, DataType_SQL7) = "SMALLINT"
NewColumns(5, DataType_MySQL) = "SMALLINT"
NewColumns(5, ConstraintAccess) = "NULL"
NewColumns(5, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0367 DEFAULT 15"
NewColumns(5, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0367 DEFAULT 15"
NewColumns(5, ConstraintMySQL) = "DEFAULT 15 NULL"
NewColumns(6, Prefix) = strTablePrefix
NewColumns(6, FieldName) = "C_STRPAGENUMBERSIZE"
NewColumns(6, TableName) = "CONFIG"
NewColumns(6, DataType_Access) = "SMALLINT"
NewColumns(6, DataType_SQL6) = "SMALLINT"
NewColumns(6, DataType_SQL7) = "SMALLINT"
NewColumns(6, DataType_MySQL) = "SMALLINT"
NewColumns(6, ConstraintAccess) = "NULL"
NewColumns(6, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0368 DEFAULT 10"
NewColumns(6, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC0368 DEFAULT 10"
NewColumns(6, ConstraintMySQL) = "DEFAULT 10 NULL"
NewColumns(7, Prefix) = strTablePrefix
NewColumns(7, FieldName) = "F_LAST_POST_AUTHOR"
NewColumns(7, TableName) = "FORUM"
NewColumns(7, DataType_Access) = "INT"
NewColumns(7, DataType_SQL6) = "INT"
NewColumns(7, DataType_SQL7) = "INT"
NewColumns(7, DataType_MySQL) = "INT"
NewColumns(7, ConstraintAccess) = "NULL"
NewColumns(7, ConstraintSQL6) = "NULL"
NewColumns(7, ConstraintSQL7) = "NULL"
NewColumns(7, ConstraintMySQL) = "NULL"
NewColumns(8, Prefix) = strTablePrefix
NewColumns(8, FieldName) = "T_LAST_POST_AUTHOR"
NewColumns(8, TableName) = "TOPICS"
NewColumns(8, DataType) = "INT"
NewColumns(8, DataType_Access) = "INT"
NewColumns(8, DataType_SQL6) = "INT"
NewColumns(8, DataType_SQL7) = "INT"
NewColumns(8, DataType_MySQL) = "INT"
NewColumns(8, ConstraintAccess) = "NULL"
NewColumns(8, ConstraintSQL6) = "NULL"
NewColumns(8, ConstraintSQL7) = "NULL"
NewColumns(8, ConstraintMySQL) = "NULL"
call AddColumns(NewColumns, intCriticalErrors, intWarnings)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET C_STRSHOWSTATISTICS = " & 1
strSql = strSql & " , C_STRSHOWIMAGEPOWEREDBY = " & 1
strSql = strSql & " , C_STRLOGONFORMAIL = " & 1
strSql = strSql & " , C_STRSHOWPAGING = " & 0
strSql = strSql & " , C_STRSHOWTOPICNAV = " & 0
strSql = strSql & " , C_STRPAGESIZE = " & 15
strSql = strSql & " , C_STRPAGENUMBERSIZE = " & 10
strSql = strSql & " , C_STRVERSION = '" & strNewVersion & "'"
strSql = strSql & " WHERE CONFIG_ID = " & 1
on error resume next
my_Conn.Errors.Clear
my_Conn.Execute (strSql)
Response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" align=""center"">")
UpdateErrorCode = UpdateErrorCheck()
on error goto 0
if UpdateErrorCode = 0 then
Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td></tr>")
elseif UpdateErrorCode = 2 then
Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Can't add default values for new fields in CONFIG table!<b></font></td></tr>")
intCriticalErrors = intCriticalErrors + 1
else
Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: code: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">" & UpdateErrorCode & " while trying to add default values to the CONFIG table</font></td></tr>")
intCriticalErrors = intCriticalErrors + 1
end if
Response.Write("</table>")
Response.Flush
end if
if (OldVersion <= 2) then
Dim NewColumns2(29,11)
NewColumns2(0, Prefix) = strMemberTablePrefix
NewColumns2(0, FieldName) = "M_FIRSTNAME"
NewColumns2(0, TableName) = "MEMBERS"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -