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

📄 admin_board.asp

📁 生活者姿态整站程序 生活者姿态整站程序 生活者姿态整站程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
end sub

sub boardinfo()
	    set rs_1 = server.CreateObject ("adodb.recordset")
            set rs_2 = server.CreateObject ("adodb.recordset")
            sql_2 = "select * from class order by id"
            rs_2.Open sql_2,conn,1,1
	    do while not rs_2.Eof
%>
            <table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr bgcolor="<%=aTableTitleColor%>">

                <td height="21"><font color="<%=TableContentColor%>"><B><%=rs_2("id")%>,分类名:<%=rs_2("class")%></b>    <a href="admin_board.asp?action=add"><font color="<%=TableContentColor%>">新增论坛</font></a> | <a href=admin_board.asp?action=orders&id=<%=rs_2("id")%>><font color="<%=TableContentColor%>">分类排序修改</font></a> | <a href=admin_board.asp?action=del1&id=<%=rs_2("id")%> onclick="{if(confirm('删除将包括该分类下所有论坛的所有帖子,确定删除吗?')){return true;}return false;}"><font color="<%=TableContentColor%>">删除分类</font></a></font></td>
              </tr>
            </table>
<%
            sql_1 = "select boardid,boardtype,readme from board where class="&rs_2("id")&" order by boardid"
            rs_1.Open sql_1,conn,1,1
            do while not rs_1.EOF 
            %>
            <table width="100%" border="0" cellspacing="3" cellpadding="0">
              <tr> 
                <td height="18"><font color="<%=TableContentColor%>"><%=rs_1("boardid")%>,<%=rs_1("boardtype")%></font></td>
              </tr>
              <tr>
                <td height="15"><a href="admin_board.asp?action=edit&editid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>基本信息一</U></font></a> | <a href="admin_var.asp?boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>基本信息二</U></font></a> | <a href="admin_use.asp?boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>使用设置</U></font></a> | <a href="admin_color.asp?boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>界面设置</U></font></a> | <a href="admin_pic.asp?boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>图片设置</U></font></a> | <a href="admin_ads.asp?boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>广告设置</U></font></a> | <a href="admin_board.asp?action=mode&boardid=<%=rs_1("boardid")%>"><font color="<%=Boardlinkcolor%>"><U>论坛模式</U></font></a> | <a href="admin_board.asp?action=del&boardid=<%=rs_1("boardid")%>" onclick="{if(confirm('删除将包括该论坛所有帖子,确定删除吗?')){return true;}return false;}"><font color="<%=Boardlinkcolor%>"><U>删除</U></a></td>
              </tr>
            </table>
<hr color=black height=1 width="70%" align=left>
<%
		  rs_1.MoveNext
		  loop
                  rs_1.Close 
        rs_2.MoveNext 
        Loop
        rs_2.Close
%>
          </td>
            </tr>
        </table>      
        </td>
       </tr>
</table>
<%
set rs_1=nothing
set rs_2=nothing
end sub

sub savenew()
	set rs = server.CreateObject ("adodb.recordset")
	if request("boardtype")="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入论坛名称。"
		Founderr=true
	end if
	if request("class")="" then
		Errmsg=Errmsg+"<br>"+"<li>请选择论坛分类。"
		Founderr=true
	end if
	if request("boardmaster")="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入版主姓名。"
		Founderr=true
	end if
	if request("readme")="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入论坛说明。"
		Founderr=true
	end if
	if request("lockboard")="" then
		Errmsg=Errmsg+"<br>"+"<li>请选择论坛开放状态。"
		Founderr=true
	end if
	if founderr=true then
	response.write ""&Errmsg&""
	else
		dim boardid
		sql="select boardid from board where boardid="+cstr(request("newboardid"))
		rs.open sql,conn,1,1
		if not rs.eof and not rs.bof then
			response.write "您不能指定和别的论坛一样的序号。"
			exit sub
		else
			boardid=request("newboardid")
		end if
		rs.close
	sql="select * from config where active=1"
	rs.open sql,conn,1,1
	Forum_Info=rs("Forum_Info")
	Forum_Setting=rs("Forum_Setting")
	Forum_ads=rs("Forum_ads")
	Forum_Body=rs("Forum_Body")
	Forum_user=rs("Forum_user")
	Forum_copyright=rs("Forum_copyright")
	Badwords=rs("Badwords")
	Splitwords=rs("Splitwords")
	StopReadme=rs("StopReadme")
	Forum_pic=rs("Forum_pic")
	Forum_boardpic=rs("Forum_boardpic")
	Forum_TopicPic=rs("Forum_TopicPic")
	Forum_statePic=rs("Forum_statePic")
	Forum_upload=rs("Forum_upload")
	Forum_ubb=rs("Forum_ubb")
	rs.close
	sql = "select * from board"
	rs.Open sql,conn,1,3
	rs.AddNew
	rs("boardid") = Request("newboardid")
	rs("boardtype") = Request.Form ("boardtype")
	rs("class") = Request.Form  ("class")
	rs("boardmaster") = Request("boardmaster")
	rs("readme") = Request("readme")
	rs("lockboard") = Trim(Request("lockboard"))
	rs("indexIMG")=request.form("indexIMG")
	rs("lastpostuser") ="未知"
	rs("lastposttime") = now()
	rs("lasttopicnum") = 0 
	rs("lastbbsnum") = 0 
	rs("lasttopicnum") = 0 
	rs("boardskin")=1

	rs("Forum_Info")=Forum_Info
	rs("Forum_Setting")=Forum_Setting
	rs("Forum_ads")=Forum_ads
	rs("Forum_Body")=Forum_Body
	rs("Forum_user")=Forum_user
	rs("Forum_copyright")=Forum_copyright
	rs("Badwords")=Badwords
	rs("Splitwords")=Splitwords
	rs("StopReadme")=StopReadme
	rs("Forum_pic")=Forum_pic
	rs("Forum_boardpic")=Forum_boardpic
	rs("Forum_TopicPic")=Forum_TopicPic
	rs("Forum_statePic")=Forum_statePic
	rs("Forum_upload")=Forum_upload
	rs("Forum_ubb")=Forum_ubb

	rs.Update 
	rs.Close 
	call addmaster(Request("boardmaster"))
	response.write "<p>论坛添加成功!<br><br>"&str
	end if
	set rs=nothing
end sub

sub savedit()
	dim newboardid
	set rs = server.CreateObject ("adodb.recordset")
	if request("newboardid")=request("editid") then
		newboardid=request("newboardid")
	else
		sql="select boardid from board where boardid="+cstr(request("newboardid"))
		rs.open sql,conn,1,1
		if not rs.eof and not rs.bof then
			response.write "您不能指定和别的论坛一样的序号。"
			exit sub
		else
			newboardid=request("newboardid")
		end if
		rs.close
	end if
	sql = "select * from board where boardid="+Cstr(request("editid"))
	rs.Open sql,conn,1,3
	rs("boardid") = Request.Form ("newboardid")
	rs("boardtype") = Request.Form ("boardtype")
	rs("class") = Request.Form  ("class")
	rs("boardmaster") = Request("boardmaster")
	rs("readme") = Request("readme")
	rs("lockboard") = Trim(Request("lockboard"))
	rs("indexIMG")=request.form("indexIMG")
	rs.Update 
	rs.Close
	set rs=nothing
	if request("newboardid")<>request("editid") then
	conn.execute("update bbs1 set boardid="&Request.Form ("newboardid")&" where boardid="+Cstr(request("editid")))
	end if
	call addmaster(Request("boardmaster"))
	response.write "<p>论坛修改成功!<br><br>"&str
end sub

sub del()
	set rs = server.CreateObject ("adodb.recordset")
	sql = "delete from board where boardid="+Cstr(Request("boardid"))
	conn.execute(sql)
	sql = "delete from bbs1 where boardid="+cstr(Request("boardid"))
	conn.execute(sql)
	set rs=nothing
	response.write "<p>论坛修改成功!"
end sub

sub del1()
	set rs = server.CreateObject ("adodb.recordset")
	sql = "delete from class where id="+Cstr(Request("id"))
	conn.execute(sql)
	sql="select boardid from board where class="+Cstr(Request("id"))
	rs.open sql,conn,1,1
	do while not rs.eof
	sql_1 = "delete from bbs1 where boardid="+cstr(rs("boardid"))
	conn.execute(sql_1)
	rs.movenext
	loop
	rs.close
	set rs=nothing
	sql = "delete from board where class="+Cstr(Request("id"))
	conn.execute(sql)
	response.write "<p>分类删除成功!"
end sub

sub orders()
%><br>
            <table width="95%" border="0" cellspacing="3" cellpadding="0" align=center>
              <tr> 
                <td height="22"><font color="<%=TableContentColor%>"><b>论坛分类重新排序修改</b><br>
注意:请在相应论坛分类的排序表单内输入相应的排列序号,注意不能和别的论坛分类有相同的排列序号。</font>
		</td>
              </tr>
	      <tr>
		<td><font color="<%=TableContentColor%>">
<%
	set rs = server.CreateObject ("Adodb.recordset")
	sql="select * from class where id="&cstr(request("id"))
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "没有找到相应的论坛分类。"
	else
		response.write "<form action=admin_board.asp?action=updateorders method=post>"
		response.write "<input type=text name=classname size=25 value="&rs("class")&">"
		response.write "  <input type=text name=newid size=2 value="&rs("id")&">"
		response.write "<input type=hidden name=id value="&request("id")&">"
		response.write "<input type=submit name=Submit value=修改></form>"
	end if
	rs.close
	set rs=nothing
%>
		</td>
	      </tr>
            </table>
<%
end sub

sub updateorders()
	dim newid
	set rs = server.CreateObject ("Adodb.recordset")
	if request("newid")=request("id") then
		sql="update class set class='"&request("classname")&"' where id="&cstr(request("id"))
		conn.execute(sql)
		response.write "<p align=center>更新成功!</p>"
	else
	sql="select * from class where id="&cstr(request("newid"))
	rs.open sql,conn,1,1
	if not rs.eof and not rs.bof then
		response.write "您输入的序号和其他分类序号相同,请重新输入。"
	else
		sql="update class set id="&request("newid")&",class='"&request("classname")&"' where id="&cstr(request("id"))
		conn.execute(sql)
		sql="update board set class="&request("newid")&" where class="&cstr(request("id"))
		conn.execute(sql)
		response.write "<p align=center>更新成功!</p>"
	end if
	end if
	set rs=nothing
end sub

sub addclass()
	set rs = server.CreateObject ("Adodb.recordset")
	sql="select id from class"
	rs.open sql,conn,1,1
	classnum=rs.recordcount
	rs.close
%>
            <table width="95%" border="0" cellspacing="3" cellpadding="0" align=center>
              <tr> 
                <td height="22" bgcolor=<%=aTableTitleColor%>><font color="<%=TableContentColor%>"><b>添加新的论坛分类</b><br>
注意:请完整填写以下表单信息,注意不能和别的论坛分类有相同的排列序号。</font>
		</td>
              </tr>
<form action=admin_board.asp?action=saveclass method=post>
	      <tr>
		<td><font color="<%=TableContentColor%>">分类名:<input name=classname type=text size=25>  序号:
<input name=id type=text size=2 value=<%=classnum+1%>>   
<input type=submit name=Submit value=添加>
		</td>
	      </tr>
</form>
	    </table>
<%
set rs=nothing
end sub

sub saveclass()
	set rs = server.CreateObject ("Adodb.recordset")
	if request("id")="" or request("classname")="" then
		response.write "您输入的序号和原来的相同,不必更新啦:)"
	else
	sql="select * from class where id="&cstr(request("id"))
	rs.open sql,conn,1,1
	if not rs.eof and not rs.bof then
		response.write "您输入的序号和其他分类序号相同,请重新输入。"
	else
		sql="insert into class(id,class) values("&request("id")&",'"&request("classname")&"')"
		conn.execute(sql)
		response.write "<p align=center>更新成功!</p>"
	end if
	end if
	set rs=nothing
end sub

sub delclass()

end sub

sub addmaster(s)
	dim arr,i,rs,sql,pw
	randomize
	pw=Cint(rnd*9000)+1000
	if instr(s,"|")<>0 and instr(s,"|")<len(s) then
		arr=split(s,"|")
		set rs=server.createobject("adodb.recordset")
		for i=0 to Ubound(arr)
			sql="select username,userpassword,userclass from [user] where username='"& arr(i) &"'"
			rs.open sql,conn,1,3
			if rs.eof and rs.bof then
				rs.addnew
				rs("username")=arr(i)
				rs("userpassword")=pw
				rs("userclass")=19
				rs.update
				str=str&"你添加了以下用户:<b>" &arr(i) &"</b> 密码:<b>"& pw &"</b><br><br>"
			end if
			rs.close
		next
		set rs=nothing
	else
		set rs=server.createobject("adodb.recordset")
		sql="select username,userpassword,userclass from [user] where username='"& s &"'"
		rs.open sql,conn,1,3
		if rs.eof and rs.bof then
			rs.addnew
			rs("username")=s
			rs("userpassword")=pw
			rs("userclass")=19
			rs.update
			rs.close
			str=str&"你添加了以下用户:<b>" &s &"</b> 密码:<b>"& pw &"</b><br><br>"
		end if
		set rs=nothing
	end if
end sub
%>

⌨️ 快捷键说明

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