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

📄 newforum.asp

📁 很好的一个论坛原代码
💻 ASP
字号:
<%
if not session("sfadmin") then response.redirect("welcome.asp")
%>
<!--#INCLUDE FILE="../inc/db_inc.asp"-->
<!--#INCLUDE FILE="../inc/md5_inc.asp"-->
<!--#INCLUDE FILE="../inc/char_inc.asp"-->

<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" href="image/style.css" type="text/css">
</HEAD>

<BODY bgcolor="#FFFFFF" text="#000000" leftmargin="10" topmargin="10">

<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<!--#INCLUDE FILE="checkadmin.asp"-->
<%
if request("step") = "2" then

	errstr = ""
	
	title = ChkSql(request("title"))

	if IsNumeric(request("cateid")) then
		cateid = clng(request("cateid"))
	else
		errstr = errstr & "<LI>cateid参数不能为空<BR>"
	end if

	if IsNumeric(request("displayorder")) then
		displayorder = clng(request("displayorder"))
	else
		errstr = errstr & "<LI>显示序号参数不能为空且必须为整数<BR>"
	end if

	if IsNumeric(request("daysprune")) then
		daysprune = clng(request("daysprune"))
	else
		errstr = errstr & "<LI>显示日期范围参数不能为空且必须为整数<BR>"
	end if

	allowposting = 0
	if request("allowposting") = "1" then allowposting = 1
	
	onlyuser = 0
	if request("onlyuser") = "1" then onlyuser = 1

	onlymember = 0
	if request("onlymember") = "1" then onlymember = 1

	allowbbcode = 0
	if request("allowbbcode") = "1" then allowbbcode = 1

	allowimages = 0
	if request("allowimages") = "1" then allowimages = 1

	allowuploadfile = 0
	if request("allowuploadfile") = "1" then allowuploadfile = 1

	canmove = 0
	if request("canmove") = "1" then canmove = 1

	canpostpoll = 0
	if request("canpostpoll") = "1" then canpostpoll = 1
	
	canopenclose = 0
	if request("canopenclose") = "1" then canopenclose = 1

	candeletepost = 0
	if request("candeletepost") = "1" then candeletepost = 1

	canreply = 0
	if request("canreply") = "1" then canreply = 1

	caneditpost = 0
	if request("caneditpost") = "1" then caneditpost = 1

	if errstr = "" then
		strsql = "insert into sf_forum(cateid, title, description, displayorder, postcount, lastposttitle, lastpostid, lastposter, lastposterid, threadcount, allowuploadfile, allowposting, daysprune, allowbbcode, allowimages, canmove, canopenclose, canreply, caneditpost, candeletepost, canpostpoll, onlyuser, onlymember, memberlist) values("
		strsql = strsql & cateid & ",'" & title & "','" & ChkSql(request("description")) & "',"
		strsql = strsql & displayorder & ",0,'',0,'',0,0,"
		strsql = strsql & allowuploadfile & "," & allowposting & "," & daysprune & ","
		strsql = strsql & allowbbcode & "," & allowimages & "," & canmove & "," & canopenclose & "," & canreply & "," & caneditpost & "," & candeletepost & "," & canpostpoll & "," & onlyuser & "," & onlymember & ", '"
		strsql = strsql & ChkSql(request("memberlist")) & "')"
		'response.write strsql
		Conn.Execute(StrSql)
%>
<TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF" align="center">建立版块 <%= title %> 完毕 (<A href="newforum.asp?id=<%= cateid %>">继续在当前分类下新建版块</A>)</TD>
  </TR>
</TABLE>
<%
	else
%>
<TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
  <TR> 
    <TD bgcolor="#D1E3BF" align="center">错误:<BR><%= errstr %>/TD>
  </TR>
</TABLE>
<%
	end if

else
	if IsNumeric(request("id")) then
		cateid = clng(request("id"))
%>
<FORM name="form1" method="post" action="newforum.asp">
  <TABLE width="100%" border="0" cellspacing="1" cellpadding="4" align="center">
    <TR> 
      <TD bgcolor="#D1E3BF" align="center" colspan="2"><B>添加论坛</B></TD>
    </TR>
    <TR> 
      <TD width="30%">&nbsp;</TD>
      <TD>&nbsp;</TD>
    </TR>
    <TR> 
      <TD bgcolor="#E4EEDB">名称</TD>
      <TD bgcolor="#E4EEDB"> 
        <INPUT type="text" name="title" size="30" maxlength="100" value="新版块">
      </TD>
    </TR>
    <TR> 
      <TD>说明</TD>
      <TD> 
        <INPUT type="text" name="description" size="50" maxlength="250" value="说明文字">
      </TD>
    </TR>
    <TR> 
      <TD>显示序号</TD>
      <TD> 
        <INPUT type="text" name="displayorder" size="5" maxlength="5" value="20">
        (如果序号为0则不显示)</TD>
    </TR>
    <TR  bgcolor="#F5F5F5"> 
      <TD>版主</TD>
      <TD> 
        <INPUT type="text" name="moder" size="30" maxlength="200" value="">
        <BR>
        (版主名字间用英文字符逗号隔开, 例如: &quot;张三,李四,王五&quot;)</TD>
    </TR>
    <TR> 
      <TD>默认显示主题的时间范围</TD>
      <TD> 
        <INPUT type="text" name="daysprune" size="5" maxlength="5" value="0">
        (如果为0则为默认)</TD>
    </TR>
    <TR> 
      <TD bgcolor="#F5F5F5">参数</TD>
      <TD bgcolor="#F5F5F5"> 
        <INPUT type="checkbox" name="allowposting" value="1" checked>
        允许发帖<BR>
        <INPUT type="checkbox" name="canpostpoll" value="1" checked>
        允许发布投票<BR>
        <INPUT type="checkbox" name="allowbbcode" value="1" checked>
        允许使用XB代码<BR>
        <INPUT type="checkbox" name="allowimages" value="1" checked>
        允许使用XB代码中的图片影像代码<BR>
        <INPUT type="checkbox" name="allowuploadfile" value="1" checked>
        允许上传附件文件<BR>
        <INPUT type="checkbox" name="canmove" value="1" checked>
        允许版主移动主题<BR>
        <INPUT type="checkbox" name="canopenclose" value="1" checked>
        允许版主打开关闭主题<BR>
        <INPUT type="checkbox" name="candeletepost" value="1" checked>
        允许作者或版主删除帖子<BR>
        <INPUT type="checkbox" name="canreply" value="1" checked>
        允许发表回复<BR>
        <INPUT type="checkbox" name="caneditpost" value="1" checked>
        允许作者或版主编辑帖子<BR>
        <INPUT type="checkbox" name="onlyuser" value="1">
        只限用户登录后访问<BR>
        <INPUT type="checkbox" name="onlymember" value="1">
        只限该版块会员内部访问</TD>
    </TR>
    <TR> 
      <TD>会员名单</TD>
      <TD> 
        <TEXTAREA name="memberlist" cols="50" rows="8"></TEXTAREA>
        <BR>
        会员名字间用英文字符逗号隔开, 例如: &quot;张三,李四,王五&quot;</TD>
    </TR>
    <TR> 
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
    </TR>
    <TR bgcolor="#CCCCCC"> 
      <TD colspan="2" height="2"></TD>
    </TR>
    <TR align="center"> 
      <TD colspan="2"> 
        <INPUT type="hidden" name="step" value="2">
        <INPUT type="hidden" name="cateid" value="<% =cateid %>">
        <INPUT type="submit" name="Submit" value="确 定">
      </TD>
    </TR>
    <TR> 
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
    </TR>
    <TR> 
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
    </TR>
  </TABLE>
<%
	else
		errstr = errstr & "<LI>cateid参数不能为空<BR>"
	end if
end if
%>
</FORM>
</BODY>
</HTML>


⌨️ 快捷键说明

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