gusucode.com > 仿MOP对开式论坛程序 1.0源码程序 > forumtype.asp

    <%@Language="VBScript"%>
<!--#include file="title.asp"-->
<%
contents=contents &"<title>版面设置-"& caption &"</title>"&_
"</head>"&_
"<body>"&_
""&_
"<table border=""0"" cellpadding=""0"" cellspacing=""0"" width=""100%"" class=""tdc"">"&_
"<tr class=""toptr""><td class=""tdc"" height=""20"" background="""& theme &"02.gif"" colspan=""3"">版面设置</td></tr>"
if bbsadmin=5 then
Dim rsa,i,n,typedel,forumdel,sql,forumtype,fso,fsobj,sforum,forums
typedel=Request.QueryString("typedel")
if IsNumeric(typedel) then
typedel=Clng(typedel)
else
typedel="0"
end if
forumdel=Request.QueryString("forumdel")
if IsNumeric(forumdel) then
forumdel=Clng(forumdel)
else
forumdel="0"
end if
if typedel>0 then
rs.Open "forumtype Where id="& typedel,conn,1,3
if Not rs.Eof then rs.Delete
rs.Close
rs.Open "Delete From forum Where forumtype="& typedel,conn,1,3
rs.Open "forumtype Order by typeorder",conn,1,3
For i=1 to rs.RecordCount
rs("typeorder")=i
rs.Update
rs.MoveNext
Next
rs.Close
call connclose
Response.Redirect "forumtype.asp"
end if
if forumdel>0 then
rs.Open "forum Where id="& forumdel,conn,1,3
if Not rs.Eof then
forumtype=rs("forumtype")
rs.Delete
end if
rs.Close
rs.Open "forum Where forumtype="& forumtype &" Order by forumorder",conn,1,3
For i=1 to rs.RecordCount
rs("forumorder")=i
rs.Update
rs.MoveNext
Next
rs.Close
call connclose
Response.Redirect "forumtype.asp"
end if
Set rsa=Server.CreateObject("ADODB.Recordset")
contents=contents &"<tr align=""center"" class=""toptr"" height=""32""><td width=""10%"" class=""tdc"">排序</td><td width=""30%"" class=""tdc"">分类</td><td width=""60%"" class=""tdc"">版面</td></tr>"
rs.Open "forumtype Order by typeorder",conn,1,1
For i=1 to rs.RecordCount
contents=contents &"<tr><td class=""tdc"" align=""center"">"& rs("typeorder") &"</td><td class=""tdc"">&nbsp;<a href=""forumtypeadd.asp?edit="& rs("id") &""">"& rs("forumtype") &"</a> <a href=""javascript:if(confirm('确实要删除该分类吗?\n删除后该分类所有版面也自动删除。\n但分类下版面的帖子并不会被删除。\n要想删除该分类下版面帖子请通过批量管理删除。\n确定要继续?'))location='forumtype.asp?typedel="& rs("id") &"'""><font class=""del"">删除</font></a></td><td class=""ftd"">"
rsa.Open "forum Where forumtype="& rs("id") &" Order by forumorder",conn,1,1
For n=1 to rsa.RecordCount
contents=contents &"&nbsp;"& rsa("forumorder") &"、<a href=""forumadd.asp?edit="& rsa("id") &""">"& rsa("forumname") &"</a> <a href=""javascript:if(confirm('确实要删除该版面吗?\n删除后该版面所有帖子并不会删除。\n要想删除该版面帖子请通过批量管理删除或移动该版面的帖子。\n确定要继续?'))location='forumtype.asp?forumdel="& rsa("id") &"'""><font class=""del"">删除</font></a><br>"
rsa.MoveNext
Next
rsa.Close
contents=contents &"<br>&nbsp;<a href=""forumadd.asp?forumtype="& rs("id") &""">添加新版面</a></td></tr>"
rs.MoveNext
Next
rs.Close
contents=contents &"<tr class=""tds""><td class=""tdc""></td><td class=""tdc""><a href=""forumtypeadd.asp"">添加新分类</a></td><td class=""tdc""></td></tr>"
sforum=Chr(60) & Chr(37) & vbcrlf &"if IsNull(bbsadmin) or bbsadmin="& Chr(34) & Chr(34) &" then"& vbcrlf
forums=Chr(60) & Chr(37) & vbcrlf &"if IsNull(bbsadmin) or bbsadmin="& Chr(34) & Chr(34) &" then"& vbcrlf
rs.Open "forumtype Where typeshow=1 Order by typeorder",conn,1,1
For i=1 to rs.RecordCount
sforum=sforum &"tfselect="& Chr(34) & Chr(34) & vbcrlf &"if types="& rs("id") &" then tfselect="& Chr(34) &" selected"& Chr(34) & vbcrlf
sforum=sforum &"contents=contents &"& Chr(34) &"<option value="& Chr(34) & Chr(34) & Chr(34) & Chr(34) & Chr(34) &"& tfselect &"& Chr(34) &">╋"& rs("forumtype") &"</option>"& Chr(34) & vbcrlf
forums=forums &"contents=contents &"& Chr(34) &"<tr class="& Chr(34) & Chr(34) &"toptr"& Chr(34) & Chr(34) &"><td class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &" height="& Chr(34) & Chr(34) &"20"& Chr(34) & Chr(34) &" background="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"02.gif"& Chr(34) & Chr(34) &" colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &"> <img border="& Chr(34) & Chr(34) &"0"& Chr(34) & Chr(34) &" src="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"08.gif"& Chr(34) & Chr(34) &" align="& Chr(34) & Chr(34) &"absbottom"& Chr(34) & Chr(34) &"> <a href="& Chr(34) & Chr(34) &"forum.asp?types="& rs("id") &""& Chr(34) & Chr(34) &" target="& Chr(34) & Chr(34) &"_self"& Chr(34) & Chr(34) &">"& rs("forumtype") &"</a></td></tr>"& Chr(34) & vbcrlf
rsa.Open "forum Where forumtype="& rs("id") &" and forumshow=1 Order by forumorder",conn,1,1
if rsa.Eof then
forums=forums &"contents=contents &"& Chr(34) &"<tr><td colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"ftd"& Chr(34) & Chr(34) &"><font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">本分类没有任何版面</font></td></tr>"& Chr(34) & vbcrlf
else
For n=1 to rsa.RecordCount
sforum=sforum &"tfselect="& Chr(34) & Chr(34) & vbcrlf &"if forum="& rsa("id") &" then tfselect="& Chr(34) &" selected"& Chr(34) & vbcrlf
sforum=sforum &"contents=contents &"& Chr(34) &"<option value="& Chr(34) & Chr(34) & rsa("id") & Chr(34) & Chr(34) & Chr(34) &"& tfselect &"& Chr(34) &"> ┗"& rsa("forumname") &"</option>"& Chr(34) & vbcrlf
forums=forums &"rs.Open ""Select count(posttime) From topic Where posttime>#"& Chr(34) &"& Date() &"& Chr(34) &"# and forumid="& rsa("id") &" and deler is Null"",conn,1,1"& vbcrlf
forums=forums &"ttopic=rs(0)"& vbcrlf
forums=forums &"rs.Close"& vbcrlf
forums=forums &"rs.Open ""Select count(posttime) From topic Where forumid="& rsa("id") &" and deler is Null"",conn,1,1"& vbcrlf
forums=forums &"atopic=rs(0)"& vbcrlf
forums=forums &"rs.Close"& vbcrlf
forums=forums &"contents=contents &"& Chr(34) &"<tr><td width="& Chr(34) & Chr(34) &"7%"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &" align="& Chr(34) & Chr(34) &"center"& Chr(34) & Chr(34) &"><img border="& Chr(34) & Chr(34) &"0"& Chr(34) & Chr(34) &" src="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"09.gif"& Chr(34) & Chr(34) &"></td><td class="& Chr(34) & Chr(34) &"ftd"& Chr(34) & Chr(34) &">&nbsp;┇ <a href="& Chr(34) & Chr(34) &"forum.asp?forum="& rsa("id") & Chr(34) & Chr(34) &" target="& Chr(34) & Chr(34) &"_self"& Chr(34) & Chr(34) &">"& rsa("forumname") &"</a> ┇<br>&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">"& rsa("foruminfo") &"</font></td><td width="& Chr(34) & Chr(34) &"105"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &">&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">今日帖子:</font>"& Chr(34) &"& ttopic &"& Chr(34) &"<br>&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">所有帖子:</font>"& Chr(34) &"& atopic &"& Chr(34) &"</td></tr>"& Chr(34) & vbcrlf
rsa.MoveNext
Next
end if
rsa.Close
if Not i=rs.RecordCount then forums=forums &"contents=contents &"& Chr(34) &"<tr><td colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &"> </td></tr>"& Chr(34) & vbcrlf
rs.MoveNext
Next
rs.Close
sforum=sforum &"else"& vbcrlf
forums=forums &"else"& vbcrlf
rs.Open "forumtype Order by typeorder",conn,1,1
For i=1 to rs.RecordCount
sforum=sforum &"tfselect="& Chr(34) & Chr(34) & vbcrlf &"if types="& rs("id") &" then tfselect="& Chr(34) &" selected"& Chr(34) & vbcrlf
sforum=sforum &"contents=contents &"& Chr(34) &"<option value="& Chr(34) & Chr(34) & Chr(34) & Chr(34) & Chr(34) &"& tfselect &"& Chr(34) &">╋"& rs("forumtype") &"</option>"& Chr(34) & vbcrlf
forums=forums &"contents=contents &"& Chr(34) &"<tr class="& Chr(34) & Chr(34) &"toptr"& Chr(34) & Chr(34) &"><td class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &" height="& Chr(34) & Chr(34) &"20"& Chr(34) & Chr(34) &" background="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"02.gif"& Chr(34) & Chr(34) &" colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &"> <img border="& Chr(34) & Chr(34) &"0"& Chr(34) & Chr(34) &" src="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"08.gif"& Chr(34) & Chr(34) &" align="& Chr(34) & Chr(34) &"absbottom"& Chr(34) & Chr(34) &"> <a href="& Chr(34) & Chr(34) &"forum.asp?types="& rs("id") &""& Chr(34) & Chr(34) &" target="& Chr(34) & Chr(34) &"_self"& Chr(34) & Chr(34) &">"& rs("forumtype") &"</a></td></tr>"& Chr(34) & vbcrlf
rsa.Open "forum Where forumtype="& rs("id") &" Order by forumorder",conn,1,1
if rsa.Eof then
forums=forums &"contents=contents &"& Chr(34) &"<tr><td colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"ftd"& Chr(34) & Chr(34) &"><font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">本分类没有任何版面</font></td></tr>"& Chr(34) & vbcrlf
else
For n=1 to rsa.RecordCount
sforum=sforum &"tfselect="& Chr(34) & Chr(34) & vbcrlf &"if forum="& rsa("id") &" then tfselect="& Chr(34) &" selected"& Chr(34) & vbcrlf
sforum=sforum &"contents=contents &"& Chr(34) &"<option value="& Chr(34) & Chr(34) & rsa("id") & Chr(34) & Chr(34) & Chr(34) &"& tfselect &"& Chr(34) &"> ┗"& rsa("forumname") &"</option>"& Chr(34) & vbcrlf
forums=forums &"rs.Open ""Select count(posttime) From topic Where posttime>#"& Chr(34) &"& Date() &"& Chr(34) &"# and forumid="& rsa("id") &" and deler is Null"",conn,1,1"& vbcrlf
forums=forums &"ttopic=rs(0)"& vbcrlf
forums=forums &"rs.Close"& vbcrlf
forums=forums &"rs.Open ""Select count(posttime) From topic Where forumid="& rsa("id") &" and deler is Null"",conn,1,1"& vbcrlf
forums=forums &"atopic=rs(0)"& vbcrlf
forums=forums &"rs.Close"& vbcrlf
forums=forums &"contents=contents &"& Chr(34) &"<tr><td width="& Chr(34) & Chr(34) &"7%"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &" align="& Chr(34) & Chr(34) &"center"& Chr(34) & Chr(34) &"><img border="& Chr(34) & Chr(34) &"0"& Chr(34) & Chr(34) &" src="& Chr(34) & Chr(34) & Chr(34) &"& theme &"& Chr(34) &"09.gif"& Chr(34) & Chr(34) &"></td><td class="& Chr(34) & Chr(34) &"ftd"& Chr(34) & Chr(34) &">&nbsp;┇ <a href="& Chr(34) & Chr(34) &"forum.asp?forum="& rsa("id") & Chr(34) & Chr(34) &" target="& Chr(34) & Chr(34) &"_self"& Chr(34) & Chr(34) &">"& rsa("forumname") &"</a> ┇<br>&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">"& rsa("foruminfo") &"</font></td><td width="& Chr(34) & Chr(34) &"105"& Chr(34) & Chr(34) &" class="& Chr(34) & Chr(34) &"tdc"& Chr(34) & Chr(34) &">&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">今日帖子:</font>"& Chr(34) &"& ttopic &"& Chr(34) &"<br>&nbsp;<font class="& Chr(34) & Chr(34) &"del"& Chr(34) & Chr(34) &">所有帖子:</font>"& Chr(34) &"& atopic &"& Chr(34) &"</td></tr>"& Chr(34) & vbcrlf
rsa.MoveNext
Next
end if
rsa.Close
if Not i=rs.RecordCount then forums=forums &"contents=contents &"& Chr(34) &"<tr><td colspan="& Chr(34) & Chr(34) &"3"& Chr(34) & Chr(34) &"> </td></tr>"& Chr(34) & vbcrlf
rs.MoveNext
Next
rs.Close
sforum=sforum &"end if"& vbcrlf & Chr(37) & Chr(62)
forums=forums &"end if"& vbcrlf & Chr(37) & Chr(62)
Set fso=CreateObject("Scripting.FileSystemObject")
Set fsobj=fso.CreateTextFile(Server.MapPath("sforum.asp"),true)
fsobj.Write sforum
Set fsobj=fso.CreateTextFile(Server.MapPath("forums.asp"),true)
fsobj.Write forums
fsobj.Close
Set fsobj=Nothing
Set fso=Nothing
Set rsa=Nothing
else
call connclose
Response.Redirect "login.asp"
end if
contents=contents &"</table>"&_
""
%>
<!--#include file="bottom.asp"-->