📄 forumintro.asp
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<%
Private Function userCode(ByVal strUsername)
Randomize Timer
strUserCode = strUsername & hexValue(15)
strUserCode = formatSQLInput(strUserCode)
strUserCode = Replace(strUserCode, "''", "'", 1, -1, 1)
userCode = strUserCode
End Function
Dim strMode
Dim strForumName
Dim strForumDescription
Dim strForumPassword
Dim intForumID
Dim strForumCode
Dim strCatName
Dim intBoardID
Dim intSelCatID
Dim intRead
Dim intPost
Dim intReply
Dim intEdit
Dim intDelete
Dim intPriority
Dim intPollCreate
Dim intVote
Dim intAttachments
Dim intImageUpload
Dim blnLocked
Dim blnHide
Dim intShowTopicsFrom
intBoardID = 0
intShowTopicsFrom = 31
intRead = 1
intPost = 2
intReply = 2
intEdit = 2
intDelete = 2
intPriority = 4
intPollCreate = 0
intVote = 0
intAttachments = 0
intImageUpload = 0
blnLocked = False
blnHide = False
intForumID = CInt(Request.QueryString("fid"))
strForumPassword = Request.Form("password")
strMode = Request("mode")
strSQL = "SELECT timesbbs.* From timesbbs WHERE timesbbs.bbsid=" & intForumID & ";"
rsConn.LockType = 3
rsConn.Open strSQL, adoCon
If (strMode = "edit" OR strMode = "new") AND Request.Form("postBack") Then
With rsConn
If strMode = "new" Then .AddNew
.Fields("boardid") = CInt(Request.Form("cat"))
.Fields("bbsname") = Request.Form("forumName")
.Fields("bbsdescrip") = Request.Form("description")
.Fields("Read") = CInt(Request.Form("read"))
.Fields("Post") = CInt(Request.Form("post"))
.Fields("replypost") = CInt(Request.Form("reply"))
.Fields("editpost") = CInt(Request.Form("edit"))
.Fields("delpost") = CInt(Request.Form("delete"))
.Fields("toppost") = CInt(Request.Form("priority"))
.Fields("addpoll") = CInt(Request.Form("polls"))
.Fields("Vote") = CInt(Request.Form("vote"))
.Fields("Attachments") = CInt(Request.Form("files"))
.Fields("imgup") = CInt(Request.Form("images"))
.Fields("Locked") = CBool(Request.Form("locked"))
.Fields("Hide") = CBool(Request.Form("hide"))
.Fields("distopic") = CInt(Request.Form("showTopics"))
If strPassword = "" OR Request.Form("remove") Then
.Fields("Password") = null
.Fields("codes") = null
Else
strForumPassword = HashEncode(strForumPassword)
strForumCode = userCode(strForumName)
.Fields("Password") = strForumPassword
.Fields("codes") = strForumCode
End If
.Update
End With
If strMode = "new" Then
rsConn.Close
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing
Response.Redirect("disforum.asp")
End If
rsConn.Requery
End If
If NOT rsConn.EOF Then
intBoardID = CInt(rsConn("boardid"))
strForumName = rsConn("bbsname")
strForumDescription = rsConn("bbsdescrip")
intForumID = CInt(rsConn("bbsid"))
strForumPassword = rsConn("Password")
intRead = CInt(rsConn("Read"))
intPost = CInt(rsConn("Post"))
intReply = CInt(rsConn("replypost"))
intEdit = CInt(rsConn("editpost"))
intDelete = CInt(rsConn("delpost"))
intPriority = CInt(rsConn("toppost"))
intPollCreate = CInt(rsConn("addpoll"))
intVote = CInt(rsConn("Vote"))
intAttachments = CInt(rsConn("Attachments"))
intImageUpload = CInt(rsConn("imgup"))
blnLocked = CBool(rsConn("Locked"))
blnHide = CBool(rsConn("Hide"))
intShowTopicsFrom = CInt(rsConn("distopic"))
End If
rsConn.Close
strSQL = "SELECT timesboard.boardname, timesboard.boardid FROM timesboard ORDER BY timesboard.boardnum ASC;"
rsConn.Open strSQL, adoCon
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>论坛信息</title>
<!-- Check the from is filled in correctly before submitting -->
<script language="JavaScript">
function CheckForm () {
if (document.frmNewForum.cat.value==""){
alert("请选择论坛分类");
return false;
}
if (document.frmNewForum.forumName.value==""){
alert("请输入论坛名称");
document.frmNewForum.forumName.focus();
return false;
}
if (document.frmNewForum.description.value==""){
alert("请输入论坛描述");
document.frmNewForum.description.focus();
return false;
}
return true
}
</script>
<link href="includes/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"><span class="heading">论坛信息</span><br>
<br />
<a href="menu.asp" target="_self">返回到管理主菜单</a><br>
<br />
<a href="disforum.asp" target="_self">返回到论坛设置首页</a><br />
<br /><%
If rsConn.EOF Then
%>
<table width="96%" border="0" cellspacing="0" cellpadding="1" height="135">
<tr>
<td align="center"><span class="lgText"><b>你必须先创建一个论坛分类.</b></span><b><br />
<br />
</b><a href="category.asp?mode=new" target="_self">创建论坛分类</a></td>
</tr>
</table>
<%
Else
%>
</div>
<form method="post" name="frmNewForum" action="forumintro.asp?fid=<% = intForumID %>" onSubmit="return CheckForm();">
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#000000">
<tr>
<td width="450"> <table width="100%" border="0" align="center" class="normal" cellpadding="4" cellspacing="1">
<tr bgcolor="#CCCCCC">
<td colspan="2" class="tHeading">选择论坛分类</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2" class="text">你想在那个论坛分类下创建分论坛<br>
<select name="cat">
<option value=""<% If intBoardID = 0 Then Response.Write(" selected") %>>选择论坛分类</option><%
Do while NOT rsConn.EOF
strCatName = rsConn("boardname")
intSelCatID = CInt(rsConn("boardid"))
Response.Write (vbCrLf & " <option value=""" & intSelCatID & """")
If intBoardID = intSelCatID Then Response.Write(" selected")
Response.Write(">" & strCatName & "</option>")
rsConn.MoveNext
Loop
%>
</select> </td>
</tr>
</table></td>
</tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -