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

📄 inc_create_forum_mssql.asp

📁 代码名称: Snitz Forums 2000 代码语言: 英文 代码类型: 国外代码 运行环境: ASP 授权方式: 免费代码 代码大小: 530kb 代码等级: 3 整
💻 ASP
📖 第 1 页 / 共 3 页
字号:

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "REPLY_R_AUTHOR ON " & strTablePrefix & "REPLY(R_AUTHOR)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "REPLY_CATFORTOP_ID ON " & strTablePrefix & "REPLY(CAT_ID, FORUM_ID, TOPIC_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "FORUM_ID ON " & strTablePrefix & "REPLY(FORUM_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "REPLY_ID ON " & strTablePrefix & "REPLY(REPLY_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "REPLY_TOPIC_ID ON " & strTablePrefix & "REPLY(TOPIC_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "TOPICS_CAT_ID_FORUM_ID ON " & strTablePrefix & "TOPICS(CAT_ID, FORUM_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "TOPICS_T_AUTHOR ON " & strTablePrefix & "TOPICS(T_AUTHOR)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "TOPICS_CAT_ID ON " & strTablePrefix & "TOPICS(CAT_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "FORUM_ID ON " & strTablePrefix & "TOPICS(FORUM_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "TOPICS_TOPIC_ID ON " & strTablePrefix & "TOPICS(TOPIC_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	strSql = "CREATE INDEX " & strTablePrefix & "TOPICS_CAT_FOR_TOP ON " & strTablePrefix & "TOPICS(CAT_ID, FORUM_ID, TOPIC_ID)"

	my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	ChkDBInstall()

	'#####################################################
	'## Insert Default Configuration Data Into Database ##
	'#####################################################
%>
	<!--#INCLUDE FILE="inc_create_forum_configvalues.asp"-->
<%
	'#######################################
	'## Insert Default Data Into Database ##
	'#######################################

	strSql = "SELECT CAT_ID FROM " & strTablePrefix & "CATEGORY"

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then
		strSql = "INSERT " & strTablePrefix & "CATEGORY(CAT_STATUS, CAT_NAME) VALUES(1, 'Snitz Forums 2000')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()
	end if

	rs.close
	set rs = nothing

	strSql = "SELECT MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE M_LEVEL = 3"

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then
		strSql = "INSERT " & strMemberTablePrefix & "MEMBERS (M_STATUS, M_NAME, M_USERNAME, M_PASSWORD, M_EMAIL, M_COUNTRY, "
		strSql = strSql & "M_HOMEPAGE, M_LINK1, M_LINK2, M_PHOTO_URL, M_SIG, M_VIEW_SIG, M_DEFAULT_VIEW, M_LEVEL, M_AIM, M_ICQ, M_MSN, M_YAHOO, "
		strSql = strSql & "M_POSTS, M_DATE, M_LASTHEREDATE, M_LASTPOSTDATE, M_TITLE, M_SUBSCRIPTION, "
		strSql = strSql & "M_HIDE_EMAIL, M_RECEIVE_EMAIL, M_LAST_IP, M_IP) "
		strSql = strSql & " VALUES(1, '" & strAdminName & "', '" & strAdminName & "', '" & strAdminPassword & "', 'yourmail@server.com', ' ', ' ', ' ', ' ', ' ', ' ', 1, 1, 3, ' ', ' ', ' ', ' ', "
		strSql = strSql & " 1, '" & strCurrentDateTime & "', '" & strlhDateTime & "', '" & strCurrentDateTime & "', 'Forum Admin', 0, 0, 1, '000.000.000.000', '000.000.000.000')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()
	end if

	rs.close
	set rs = nothing

	strSql = "SELECT FORUM_ID FROM " & strTablePrefix & "FORUM "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then
		strSql = "INSERT " & strTablePrefix & "FORUM(CAT_ID, F_STATUS, F_MAIL, F_SUBJECT, F_URL, F_DESCRIPTION, F_TOPICS, F_COUNT, F_LAST_POST, "
		strSql = strSql & "F_PASSWORD_NEW, F_PRIVATEFORUMS, F_TYPE, F_IP, F_LAST_POST_AUTHOR, F_LAST_POST_TOPIC_ID, F_LAST_POST_REPLY_ID) "
		strSql = strSql & "VALUES(1, 1, 0, 'Testing Forums', '', 'This forum gives you a chance to become more familiar with how this product responds to different features and keeps testing in one place instead of posting tests all over. Happy Posting! [:)]', "
		strSql = strSql & "1, 1, '" & strCurrentDateTime & "', '', 0, 0, '000.000.000.000', 1, 1, 0) "

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if

	rs.close
	set rs = nothing

	strSql = "SELECT TOPIC_ID FROM " & strTablePrefix & "TOPICS "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then

		strSql = "INSERT " & strTablePrefix & "TOPICS (CAT_ID, FORUM_ID, T_STATUS, T_MAIL, T_SUBJECT, T_MESSAGE, T_AUTHOR, "
		strSql = strSql & "T_REPLIES, T_UREPLIES, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_IP, T_LAST_POST_AUTHOR, T_LAST_POST_REPLY_ID, T_ARCHIVE_FLAG) "
		strSql = strSql & "VALUES(1, 1, 1, 0, 'Welcome to Snitz Forums 2000', 'Thank you for downloading the Snitz Forums 2000. We hope you enjoy this great tool to support your organization!" & CHR(13) & CHR(10) & CHR(13) & CHR(10) &"Many thanks go out to John Penfold &lt;asp@asp-dev.com&gt; and Tim Teal &lt;tteal@tealnet.com&gt; for the original source code and to all the people of Snitz Forums 2000 at http://forum.snitz.com for continued support of this product.', "
		strSql = strSql & "1, 0, 0, 0, '" & strCurrentDateTime & "', '" & strCurrentDateTime & "', 0, '000.000.000.000', 1, 0, 1)"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if

	rs.close
	set rs = nothing

	strSql = "SELECT COUNT_ID FROM " & strTablePrefix & "TOTALS "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then

		strSql = "INSERT " & strTablePrefix & "TOTALS (COUNT_ID, P_COUNT, T_COUNT, U_COUNT) "
		strSql = strSql & "VALUES(1,1,1,1)"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if
	rs.close
	set rs = nothing

	strSql = "SELECT B_ID FROM " & strFilterTablePrefix & "BADWORDS "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then

		strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS (B_BADWORD, B_REPLACE) VALUES ('fuck','****')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

		strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS (B_BADWORD, B_REPLACE) VALUES ('wank','****')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

		strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS (B_BADWORD, B_REPLACE) VALUES ('shit','****')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

		strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS (B_BADWORD, B_REPLACE) VALUES ('pussy','*****')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

		strSql = "INSERT INTO " & strFilterTablePrefix & "BADWORDS (B_BADWORD, B_REPLACE) VALUES ('cunt','****')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if
	rs.close
	set rs = nothing

	strSql = "SELECT GROUP_ID FROM " & strTablePrefix & "GROUP_NAMES "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then

		strSql = "INSERT INTO " & strTablePrefix & "GROUP_NAMES (GROUP_NAME,GROUP_DESCRIPTION) VALUES ('All Categories you have access to','All Categories you have access to')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

		strSql = "INSERT INTO " & strTablePrefix & "GROUP_NAMES (GROUP_NAME,GROUP_DESCRIPTION) VALUES ('Default Categories','Default Categories')"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if
	rs.close
	set rs = nothing

	strSql = "SELECT GROUP_ID FROM " & strTablePrefix & "GROUPS "

	set rs = my_Conn.Execute(strSql)

	if rs.EOF then

		strSql = "INSERT INTO " & strTablePrefix & "GROUPS (GROUP_ID, GROUP_CATID) VALUES (2,1)"

		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		ChkDBInstall()

	end if
	rs.close
	set rs = nothing
        on error goto 0
end if

sub ChkDBInstall()
	for counter = 0 to my_conn.Errors.Count -1
		ConnErrorNumber = my_conn.Errors(counter).Number
		ConnErrorDescription = my_conn.Errors(counter).Description

		if ConnErrorNumber <> 0 then 
			Err_Msg = "<tr><td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Error: " & ConnErrorNumber & "</b></font></td>"
			Err_Msg = Err_Msg & "<td bgColor=""lightsteelblue"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & ConnErrorDescription & "</font></td></tr>"
			Err_Msg = Err_Msg & "<tr><td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>strSql: </b></font></td>"
			Err_Msg = Err_Msg & "<td bgColor=""lightsteelblue"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & strSql & "</font></td></tr>"	

			Response.Write(Err_Msg)
			intCriticalErrors = intCriticalErrors + 1
		end if
	next
	my_conn.Errors.Clear 
end sub
%>

⌨️ 快捷键说明

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