%
'#################################################################################
'## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
'#################################################################################
strNewVersion = "Snitz Forums 2000 Version 3.3.03"
'#################################################################################
Dim NewConfig
ResponseCode = Request.QueryString("RC")
if ResponseCode <> "" then 'No parameter
blnSetup = "Y"
else
strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
Application(strCookieURL & "ConfigLoaded")= ""
end if
if blnSetup <> "Y" then NewConfig = 1
%>
<%
Response.Buffer = True
%>
Forum-Setup Page
<%
if ResponseCode = "" then 'No parameter
' Check to see if all the fields are in the database
on error resume next
set my_Conn = Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString
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
end if
next
my_Conn.Errors.Clear
strSql = "SELECT CAT_ID, FORUM_ID, F_STATUS, F_MAIL, F_SUBJECT, F_URL, F_DESCRIPTION, F_TOPICS, F_COUNT, "
strSql = strSql & "F_LAST_POST, F_PASSWORD_NEW, F_PRIVATEFORUMS, F_TYPE, F_IP, F_LAST_POST_AUTHOR, "
strSQL = strSQL & "F_SUBSCRIPTION, F_MODERATION, F_ARCHIVE_SCHED, F_DELETE_SCHED"
strSql = strSql & " FROM " & strTablePrefix & "FORUM"
my_Conn.Execute strSql
Call CheckSqlError()
my_Conn.Errors.Clear
strSql = "SELECT CAT_ID, FORUM_ID, TOPIC_ID, T_STATUS, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_REPLIES, "
strSql = strSql & "T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_ARCHIVE_FLAG "
strSql = strSql & " FROM " & strTablePrefix & "TOPICS"
my_Conn.Execute strSql
Call CheckSqlError()
my_Conn.Errors.Clear
strSql = "SELECT MEMBER_ID, M_STATUS, M_NAME, M_USERNAME, M_PASSWORD, M_EMAIL, M_COUNTRY, M_HOMEPAGE, "
strSql = strSql & "M_SIG, M_DEFAULT_VIEW, M_LEVEL, M_AIM, M_YAHOO, M_ICQ, M_POSTS, M_DATE, "
strSql = strSql & "M_LASTHEREDATE, M_LASTPOSTDATE, M_TITLE, M_SUBSCRIPTION, M_HIDE_EMAIL, "
strSql = strSql & "M_RECEIVE_EMAIL, M_LAST_IP, M_IP, M_FIRSTNAME, M_LASTNAME, M_OCCUPATION, "
strSql = strSql & "M_SEX, M_AGE, M_HOBBIES, M_LNEWS, M_QUOTE, M_BIO, M_MARSTATUS, "
strSql = strSql & "M_LINK1, M_LINK2, M_CITY, M_STATE, M_PHOTO_URL FROM " & strMemberTablePrefix & "MEMBERS"
my_Conn.Execute strSql
Call CheckSqlError()
my_Conn.Errors.Clear
on error goto 0
if strVersion <> strNewVersion then
Response.Redirect "setup.asp?RC=3&MAIL=" & Server.UrlEncode(strSender) & "&VER=" & Server.URLEncode(strVersion) & "&EC=" & Server.UrlEncode("Different or New Version-ID detected")
end if
'## This part of the code is only reached if all is ok !!
%>
Forum setup has been completed.
Congratulations!!
The forum setup has been completed succesfully.
You can now start using Snitz Forums 2000.
Remember to change the default Admin password !!
If you have questions or remarks you can visit us at: http://forum.snitz.com
You can also post the address of your forum there
so others can come and visit you.
|
Click here to go to the forum.
|
Upgrade the database. (shouldn't be needed for this database!)
|
<% if strDBType <> "access" then %>
Create the databasetables. (shouldn't be needed for this database!)
|
<% end if %>
<%
elseif ResponseCode = 1 then '## cannot open database
ErrorCode = Request.QueryString("EC")
CustomCode = Request.QueryString("CC")
%>
There has been an error !!
<%
if CustomCode = 1 then
%>
The database could not be opened !!
Check your config.asp file and set the strConnString so it points to the database.
Also check if strDBType is set to the right databasetype.
<%
elseif CustomCode = 2 then
%>
Couldn't read from one or more tables in the database. Make sure none of the tables are exclusively locked by another user.
<%
elseif CustomCode = 3 then
%>
Couldn't open the database. Make sure you supplied a correct username and password.
<%
else
%>
The database could not be opened !!
<%
end if
if ErrorCode <> "" and ErrorCode < 0 then
Response.Write("Code : " & Hex(ErrorCode) & " ")
elseif ErrorCode <> "" then
Response.Write("Code : " & ErrorCode & " ")
end if
%>
|
<%
if Request.QueryString("RET") <> "" then
%>
" target="_top">Click here to return to the previous screen.
<%
else
%>
Click here to retry.
<%
end if
%>
|
<%
elseif ResponseCode = 2 then '## cannot find all the fields in the database
strSender = Request.QueryString("MAIL")
strVersion = Request.QueryString("VER")
ErrorCode = Request.QueryString("EC")
CustomCode = Request.QueryString("CC")
if ErrorCode = "-2147467259" then
Response.Redirect "setup.asp?RC=5&EC=" & ErrorCode
Response.End
elseif ErrorCode = "-2147217865" then
if strDBType = "access" then
Response.Redirect "setup.asp?RC=1&EC=" & server.URLEncode("The Access database has missing tables !!")
Response.End
else
Session(strCookieURL & "Approval") = "15916941253"
%>
The database needs to be installed !!
<%
end if
else
%>
The database needs to be upgraded !!
The database you are using needs to be upgraded !!
<%
if MAIL <> ""then
%>
If you are not a Administrator at this forum please report this error here: <% =strSender %>.
<%
end if
if ErrorCode <> "" and ErrorCode < 0 then
Response.Write("Code : " & Hex(ErrorCode) & " " )
elseif ErrorCode <> "" then
Response.Write("Code : " & ErrorCode & " " )
end if
%>
|
Click here to upgrade the database.
Click here to retry.
|
<%
end if
elseif ResponseCode = 3 then '## upgrade database
if strVersion = "" then
strVersion = Request.QueryString("VER")
end if
if Session(strCookieURL & "Approval") = "15916941253" Then
'## logon was ok proceed with upgrade
%>
<% if strDBType = "sqlserver" then %>
Select the SQL-Server upgrade options.
<% elseif strDBType = "mysql" then %>
MySql database upgrade.
<% else %>
Access 97 database upgrade
<% end if %>
<%
else
strSender = Request.QueryString("MAIL")
%>