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

📄 site-setup.asp

📁 简介:一个程序小巧而功能强大
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			strPassword = sql_encode(request.form("Password"))
			strEmail = request.form("Email")
			strTime = db_time()
			strSite = clean_text(request.form("Site"), 0)
			strURL = request.form("URL")
			strForum = request.form("Forum")
			
			'remove final / if present
			if right(strForum, 1) = "/" then
				strForum = left(strForum, (InStrRev(strForum, "/") - 1))
			end if
			if right(strURL, 1) = "/" then
				strURL = left(strURL, (InStrRev(strURL, "/") -1))
			end if
			
			if request.form("Database") = "SQL" then
				'SQL Code to generate admin table
				sqlAdmin = "CREATE TABLE Forum_Admin (Admin_ID int IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL, Admin_User_ID int NOT NULL);"	
				adoConn.execute sqlAdmin
				
				'SQL Code to generate badIP Table
				sqlBadIP = "CREATE TABLE Forum_BadIP (Bad_IP varchar (50) NOT NULL);"
				adoConn.execute sqlBadIP
				
				'SQL Code to create categories table
				sqlCategory = "CREATE TABLE Forum_Categories (Category_ID int IDENTITY (1, 1) NOT NULL, Category_Title varchar (100) NOT NULL, Category_Order int NOT NULL);"
				adoConn.execute sqlCategory
				
				'SQL Code to create config Table
				sqlConfig = "CREATE TABLE Forum_Config (Site_Enabled smallint NOT NULL, Site_Name varchar (255) NOT NULL, Site_Description varchar (255) NOT NULL, Site_Home_URL varchar (100) NOT NULL, Site_Forum_URL varchar (100) NOT NULL, Site_Time_Format varchar(2) NOT NULL, Site_Account_Create smallint NOT NULL, Site_Allow_HTML smallint NOT NULL, Site_Allow_BB smallint NOT NULL, Site_Allow_Avatar smallint NOT NULL, Site_Allow_Title smallint NOT NULL, Site_Allow_Signature smallint NOT NULL, Site_Allow_PostCount smallint NOT NULL, Site_View_Topic smallint NOT NULL, Site_View_Posts smallint NOT NULL, Site_Email varchar (255) NOT NULL, Site_Email_Address varchar (255) NOT NULL, Site_Email_Signature varchar (255) NOT NULL, Site_Online_View smallint NOT NULL, Site_Topic_Review smallint NOT NULL, Site_Account_Verification smallint NOT NULL);"
				adoConn.execute sqlConfig
				
				'SQL code to create the forums table
				sqlForums = "CREATE TABLE Forum_Forums (Forum_ID int IDENTITY (1, 1) NOT NULL, Forum_Category_ID int NOT NULL, Forum_Group_ID int NULL, Forum_Name varchar (60) NOT NULL, Forum_Description varchar (255)  NULL, Forum_Posts int NOT NULL, Forum_Topics int NOT NULL, Forum_Topic_ID int NULL, Forum_Post_Date varchar (14) NULL, Forum_User_ID int NULL, Forum_User_Name varchar (60) NULL, Forum_Order int NOT NULL, Forum_Allow_Images smallint NOT NULL);"
				adoConn.execute sqlForums

				'SQL code to create the moderators table
				sqlModerator = "CREATE TABLE Forum_Moderator (Mod_ID int IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL, Mod_Forum_ID int NOT NULL, Mod_User_ID int NOT NULL);"
				adoConn.execute sqlModerator
				
				'SQL code to create the posts table
				sqlPosts = "CREATE TABLE Forum_Posts (Post_ID int IDENTITY (1, 1) NOT NULL, Post_Topic_ID int NOT NULL, Post_Forum_ID int NOT NULL,	Post_Category_ID int NOT NULL, Post_User_ID int NOT NULL, Post_Time varchar (14) NOT NULL, Post_IP varchar (15) NULL, Post_Signature smallint NOT NULL, Post_Title varchar (60) NULL, Post_Text text NOT NULL, Post_Index smallint NOT NULL);"
				adoConn.execute sqlPosts
				
				'SQL code to create smilies table
				sqlSmilies = "CREATE TABLE Forum_Smilies (Smiliey_ID int IDENTITY (1, 1) NOT FOR REPLICATION  NOT NULL, Smiley_Code varchar (50) NOT NULL, Smiley_Image varchar (50) NOT NULL);"
				adoConn.execute sqlSmilies
				
				'SQL code to create the stats table
				sqlStats = "CREATE TABLE Forum_Stats (Stats_Users int NOT NULL, Stats_Posts int NOT NULL, Stats_Topics int NOT NULL, Stats_User_ID int NOT NULL, Stats_User_Name varchar (60) NOT NULL, Stats_Online_Max int NOT NULL);"
				adoConn.execute sqlStats
				
				'SQL code to create topics table
				sqlTopics = "CREATE TABLE Forum_Topics (Topic_ID int IDENTITY (1, 1) NOT NULL, Topic_Forum_ID int NOT NULL, Topic_Category_ID int NOT NULL, Topic_User_ID int NOT NULL,	Topic_Last_User_ID int NOT NULL, Topic_Title varchar (60) NOT NULL, Topic_Time varchar (14) NOT NULL, Topic_Views int NOT NULL, Topic_Replies int NOT NULL,	Topic_Type int NOT NULL, Topic_Status smallint NOT NULL);"
				adoConn.execute sqlTopics
				
				'SQL code to create the users table
				sqlUsers = "CREATE TABLE Forum_Users (User_ID int IDENTITY (1, 1) NOT NULL, User_Name varchar (60) NOT NULL, User_Email varchar (255) NOT NULL, User_Password varchar (60) NOT NULL, User_Join_Date varchar (14) NOT NULL, User_Laston_Date varchar (14) NOT NULL, User_LastURL varchar (255) NULL, User_Signature text NULL, User_Title varchar (60) NULL, User_Avatar varchar (150) NULL, User_Posts int NOT NULL, User_Location varchar (255) NULL, User_ICQ varchar (20) NULL, User_MSN varchar (255) NULL, User_AIM varchar (255) NULL, User_Website varchar (255) NULL, User_Biography text  NULL, User_Email_View smallint NOT NULL, User_Online_View smallint NOT NULL, User_Status smallint NOT NULL, User_Activation int NOT NULL, User_Admin_Email int NOT NULL, User_DOB varchar (14) NULL, User_IP varchar (100) NOT NULL,	User_Last_Post varchar (14) NULL, User_Login_Failures int NOT NULL, User_Last_Reminder varchar (14) NULL);"
				adoConn.execute sqlUsers
				
				'SQL code to add table constraints
				sqlConstraints = "ALTER TABLE Forum_Admin ADD CONSTRAINT PK_Forum_Admin PRIMARY KEY CLUSTERED (Admin_ID); ALTER TABLE Forum_Categories ADD CONSTRAINT PK_Forum_Categories PRIMARY KEY CLUSTERED (Category_ID); ALTER TABLE Forum_Forums ADD CONSTRAINT PK_Forum_Forums PRIMARY KEY CLUSTERED (Forum_ID); ALTER TABLE Forum_Moderator ADD CONSTRAINT PK_Forum_Moderator PRIMARY KEY CLUSTERED (Mod_ID); ALTER TABLE Forum_Posts ADD CONSTRAINT PK_Forum_Posts PRIMARY KEY CLUSTERED (Post_ID); ALTER TABLE Forum_Topics ADD CONSTRAINT PK_Forum_Topics PRIMARY KEY CLUSTERED (Topic_ID);"
				sqlConstraints = sqlConstraints & "ALTER TABLE Forum_Forums ADD CONSTRAINT DF_Forum_Forums_Forum_Posts DEFAULT (0) FOR Forum_Posts, CONSTRAINT DF_Forum_Forums_Forum_Topics DEFAULT (0) FOR Forum_Topics, CONSTRAINT DF_Forum_Forums_Forum_Order DEFAULT (1) FOR Forum_Order, CONSTRAINT DF_Forum_Forums_Forum_Allow_Images DEFAULT (0) FOR Forum_Allow_Images;ALTER TABLE Forum_Users ADD CONSTRAINT DF_Forum_Users_User_Posts DEFAULT (0) FOR User_Posts, CONSTRAINT DF_Forum_Users_User_Email_View DEFAULT (0) FOR User_Email_View, CONSTRAINT DF_Forum_Users_User_Online_View DEFAULT (0) FOR User_Online_View, CONSTRAINT DF_Forum_Users_User_Status DEFAULT (0) FOR User_Status, CONSTRAINT DF_Forum_Users_User_Activation DEFAULT (0) FOR User_Activation, CONSTRAINT DF_Forum_Users_User_Admin_Email DEFAULT (0) FOR User_Admin_Email, CONSTRAINT DF_Forum_Users_User_IP DEFAULT ('0.0.0.0') FOR User_IP"
				sqlConstraints = sqlConstraints & ", CONSTRAINT DF_Forum_Users_User_Login_Failures DEFAULT (0) FOR User_Login_Failures, CONSTRAINT PK_Forum_Users PRIMARY KEY CLUSTERED (User_ID);"
				adoConn.execute sqlConstraints
				
				'SQL code to create table Indexes
				sqlIndex = "CREATE INDEX IX_Forum_Forums_Category ON Forum_Forums(Forum_Category_ID); CREATE INDEX IX_Forum_Forums_Name ON Forum_Forums(Forum_Name); CREATE INDEX IX_Forum_Posts_Topic ON Forum_Posts(Post_Topic_ID); CREATE INDEX IX_Forum_Posts_Forum ON Forum_Posts(Post_Forum_ID); CREATE INDEX IX_Forum_Topics ON Forum_Topics(Topic_Forum_ID); CREATE INDEX IX_Forum_Topics_Category ON Forum_Topics(Topic_Category_ID); CREATE INDEX IX_Forum_Users ON Forum_Users(User_ID); CREATE INDEX IX_Forum_Users_Name ON Forum_Users(User_Name);"
				adoConn.execute sqlIndex
				
				'Insert default values
				sqlDefaults = "INSERT INTO Forum_Users (User_Name, User_Email, User_Password, User_Join_Date, User_Laston_Date, User_Title, User_Status, User_Activation) VALUES ('"& strName &"', '"& strEmail &"', '"& strPassword &"', '"& strTime &"', '"& strTime &"', 'Administrator', '1', '123456'); INSERT INTO Forum_Admin (Admin_User_ID) VALUES ('1'); INSERT INTO Forum_Config VALUES ('0', '"& strSite &"', 'none', '"& strURL &"', '"& strForum &"', 'UK', '0', '0', '1', '0', '0', '1', '1', '50', '15', 'CDONTS', 'none', 'none', '1', '1', '1'); INSERT INTO Forum_Stats VALUES ('1', '0', '0', '1', '"& strName &"', '1');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':alien:', 'alien.gif'); INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':baa:', 'baa.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':blink:', 'blink.gif')INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':blush:', 'blush.gif' );"
				sqlDefaults = sqlDefaults & "INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':D', 'bigsmile.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':crazy:', 'crazy.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':(', 'sad.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':cry:', 'crying.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':devil:', 'devil.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':erm:', 'erm.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':kiss:', 'kiss.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':love:', 'love.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':mad:', 'mad.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':pinch:', 'pinch.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':|', 'plain.gif');"
				sqldefaults = sqlDefaults & "INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':o', 'shocked.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':sick:', 'sick.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':sleep:', 'sleep.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':)', 'smile.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':sneaky:', 'sneaky.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':stupid:', 'stupid.gif');"
				sqldefaults = sqlDefaults & "INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':thumbs:', 'thumbs.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':P', 'tongue.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':woot:', 'woot.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':whistle:', 'whistle.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (';)', 'wink.gif');INSERT INTO Forum_Smilies(Smiley_Code, Smiley_Image) VALUES (':xmas:', 'xmas.gif')"
				adoConn.execute sqlDefaults			
			end if
			
			if request.form("Database") = "Access" then
				'Setup User Table
				sqlUser = "INSERT INTO Forum_Users (User_Name, User_Email, User_Password, User_Join_Date, User_Laston_Date, User_Title, User_Status, User_Activation) VALUES ('"& strName &"', '"& strEmail &"', '"& strPassword &"', '"& strTime &"', '"& strTime &"', 'Administrator', '1', '123456');"
				adoConn.execute sqlUser
				
				'Setup Stats Table
				sqlStats = "INSERT INTO Forum_Stats VALUES ('1', '0', '0', '1', '"& strName &"', '1');"
				adoConn.execute sqlStats
				
				'Setup Config Table
				sqlConfig = "INSERT INTO Forum_Config VALUES ('0', '"& strSite &"', 'none', '"& strURL &"', '"& strForum &"', 'UK', '0', '0', '1', '0', '0', '1', '1', '50', '15', 'CDONTS', 'none', 'none', '1', '1', '1');"
				adoConn.execute sqlConfig
			end if
			%>
			<table width="775" border="0" cellspacing="0" cellpadding="0" align="center" class="main">
				<tr valign="top">
				<td align="left">
				<img src="Images/Common/Setup-Background.gif" width="125" height="156" hspace="5" vspace="5" align="left" style="margin-right: 10px;">
				<br>
				<font color="#FF0000"><b>For security reasons you should now delete this page from your site.</b></font>				
                <p>安装完成后,请删除site-setup.asp</p>
                <p>切记!</td>
				</tr>
				<form action="site-setup.asp" method="post">
				<tr valign="top">
				<td align="right">
				<input name="Step" type="hidden" value="Four">
				<input name="submit" type="submit" value="Complete">
				</td>
				</tr>
				</form>
			</table>
		<%
		end if
	end if
	
	if Step = "Four" then
		response.redirect(strForum & "default.asp")
	end if
else
%>
	<table width="775" border="0" cellspacing="0" cellpadding="0" align="center" class="main">
		<tr>
		<td>
		  <img src="Images/Common/Setup-Background.gif" width="125" height="156" hspace="5" vspace="5" align="left" style="margin-right: 10px;">		<h3>Oops, there has been an error.</h3>
		You have not edited the <i>site-dataconn.asp</i> file in the Includes folder with your database connection details. Please edit this file before continuing.		</tr>
	</table>
<%
end if
%>

</body>
</html>
<%
adoConn.close
set adoConn = nothing
%>

⌨️ 快捷键说明

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