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

📄 admin_bbs.asp

📁 非常好的源码 非常好的源码 非常好的源码
💻 ASP
📖 第 1 页 / 共 2 页
字号:
		End IF
	Else
		Rs.AbsolutePage = 1
	End IF
	Page = Rs.AbsolutePage

	For i=1 to Rs.PageSize
		If Rs.Eof Then
			exit For
		End If

%>
    <tr bgcolor="#E8F1FF" class=TBBG9> 
      <td width="5%"><%=rs("id")%></td>
      <td width="45%">	  
		<a href="admin_bbs.asp?Action=title&id=<%=rs("id")%>&lid=<%=rs("lid")%>&bid=<%=rs("bid")%>"><%=rs("name")%></a></td>
    </tr>
<%
		Rs.MoveNext
	Next
%>
    <tr bgcolor="#E8F1FF">
        <td  colspan="3" > <div align="center">
    <%
    if page<=1 then
        Response.Write ("[首页][上一页]")
    else        
        Response.Write("[<a href=admin_bbs.asp?Action=view&id="&id&"&cid="&cid&"&lid="&lid&"&Page=1>首页</a>]")
        Response.Write("[<a href=admin_bbs.asp?Action=view&id="&id&"&cid="&cid&"&lid="&lid&"&Page=" & (Page-1) &">上一页</a>]")
    end if

    if page>=Rs.PageCount then
        Response.Write ("[下一页][尾页]")        
    else
        Response.Write("[<a href=admin_bbs.asp?Action=view&id="&rs("id")&"&cid="&cid&"&lid="&lid&"&Page=" & (Page+1) &">下一页</a>]")
        Response.Write("[<a href=admin_bbs.asp?Action=view&id="&rs("id")&"&cid="&cid&"&lid="&lid&"&Page=" & Rs.PageCount & ">尾页</a>]")            
    end if
    Response.Write("[页次:<font color=red>" & page & "</font>/" & Rs.PageCount)    
    Response.Write("][共" & Rs.RecordCount & "条 <font color=red>"& Rs.PageSize & "</font>条/页]")
%>
  </div></td>
  </tr>
</table>
</form>
<%
	else
%>
    <tr bgcolor="#E8F1FF" class=TBBG9> 
      <td  colspan="4" > <div align="center">
      	暂无文章,请添加!<br/>
       </div></td>
    </tr>
<%
	end if
		Rs.close
		set rs=nothing
else
	Response.Write("<card id='index' title='出错啦'><p>")
	Response.Write("请不要非法传递参数!")
end if
%>
</table>
</form>
<%End Function


Function title
dim lid,id
lid=Request("lid")
bid=Request("bid")
id=Request("id")
	if not isnumeric(id) then id=""
	if not isnumeric(lid) then lid=""
	if not isnumeric(id) then id=""
	if lid<>"" and  bid<>"" then 


			set rs5=server.CreateObject("adodb.recordset")
			sql5="select * from btitle where id="&id
			rs5.open sql5,conn,1,1
			if not (rs5.bof and rs5.eof)  then
				tit=rs5("name")
			end if
		Rs5.close
		set rs5=nothing
%>
<form name="pollform3sdx" method="post" action="admin_bbs.asp?Action=list&lid=<%=lid%>">
  <p style="margin-left:15px;">
  <b>评论管理-分类列表-<%=tit%></b><br/><a href='admin_bbs.asp'>返回分类列表</a>
</p>
<input type="hidden" name="SubmitFlag" value=yes>
<table width="100%" border=0 align="center" cellpadding=5 cellspacing=1  style="border-collapse: collapse" bordercolor="#6B8FC8"  class=TBone>

    <tr  class=backs> 
      <td class="blu" width="5%" >ID</td>
      <td class="blu" width="70%" >评论内容</td>
      <td class="blu" width="13%" >评论者</td>
      <td class="blu" width="12%" >操作</td>
    </tr>
<%
dim sql,h,i
	Set Rs = Server.CreateObject("Adodb.Recordset")
	Sql = "select * from wap_bbs where lid="&lid&" and bid="&bid&" and pid="&id&" order by id desc"
	Rs.Open Sql,conn,1,1
	Page = Request("Page")
	Rs.PageSize = PageSize
	if not (rs.bof and rs.eof)  then 
	IF Not IsEmpty(Page) Then
		IF Not IsNumeric(Page) Then		'判断Page是否为数字
			Page=1
		Else
			Page=Cint(Page)		'转换成短整形Integer
		End IF
		IF Page > Rs.PageCount Then
			Rs.AbsolutePage = Rs.PageCount	'设置当前显示页等于最后一页
		ElseIF Page <= 0 Then
			Rs.AbsolutePage = 1		'设置当前页等于第一页
		Else
			Rs.AbsolutePage = Page	'如果大于零,显示当前页等于接收的页数
		End IF
	Else
		Rs.AbsolutePage = 1
	End IF
	Page = Rs.AbsolutePage

	For i=1 to Rs.PageSize
		If Rs.Eof Then
			exit For
		End If
				set rs1=server.CreateObject("adodb.recordset")
				sql1="select * from wap_user where id="&rs("nid")
				rs1.open sql1,conn,1,3
%>
    <tr bgcolor="#E8F1FF" class=TBBG9> 
      <td><%=rs("id")%></td>
      <td>
	<%=rs("title")%></td>
<%
				if not (rs1.bof and rs1.eof)  then
%>
      <td>
	<%=rs1("name")%></td>
<%
				end if
			Rs1.close
			set rs1=nothing
%>
      	<td>
		<a href="admin_bbs.asp?Action=edit&id=<%=rs("id")%>&bid=<%=bid%>&lid=<%=lid%>">编辑</a>
		<a href="admin_bbs.asp?Action=del&id=<%=rs("id")%>&bid=<%=bid%>&lid=<%=lid%>">删除</a>
	</td>    </tr>
<%
		Rs.MoveNext
	Next
%>
    <tr bgcolor="#E8F1FF">
        <td  colspan="4" > <div align="center">
    <%
    if page<=1 then
        Response.Write ("[首页][上一页]")
    else        
        Response.Write("[<a href=admin_bbs.asp?Action=title&id="&id&"&cid="&cid&"&lid="&lid&"&Page=1>首页</a>]")
        Response.Write("[<a href=admin_bbs.asp?Action=title&id="&id&"&cid="&cid&"&lid="&lid&"&Page=" & (Page-1) & ">上一页</a>]")
    end if

    if page>=Rs.PageCount then
        Response.Write ("[下一页][尾页]")        
    else
        Response.Write("[<a href=admin_bbs.asp?Action=title&id="&id&"&cid="&cid&"&lid="&lid&"&Page=" & (Page+1) &">下一页</a>]")
        Response.Write("[<a href=admin_bbs.asp?Action=title&id="&id&"&cid="&cid&"&lid="&lid&"&Page=" & Rs.PageCount &">尾页</a>]")            
    end if
    Response.Write("[页次:<font color=red>" & page & "</font>/" & Rs.PageCount)    
    Response.Write("][共" & Rs.RecordCount & "条 <font color=red>"& Rs.PageSize & "</font>条/页]")
%>
  </div></td>
  </tr>
</table>
</form>
<%
	else
%>
    <tr bgcolor="#E8F1FF" class=TBBG9> 
      <td  colspan="4" > <div align="center">
      	暂无评论!<br/>
       </div></td>
    </tr>
<%
	end if
		Rs.close
		set rs=nothing
else
	Response.Write("<card id='index' title='出错啦'><p>")
	Response.Write("请不要非法传递参数!")
end if
%>
</table>
</form>
<%End Function



Function del
dim lid,id,bid
lid=Request("lid")
bid=Request("bid")
id=Request("id")
	if not isnumeric(lid) then lid=""
	if not isnumeric(id) then id=""
	if not isnumeric(bid) then bid=""
	if lid<>"" and  id<>"" and  bid<>"" then 
%>
  <p style="margin-left:15px;">
  <b>删除评论</b><br/><a href='admin_bbs.asp?Action=view&bid=<%=bid%>&lid=<%=lid%>'>返回评论管理</a></p>
	<%
	If Request("SubmitFlag") <> "" Then
		dim sql,rs
		Set Rs = Server.CreateObject("Adodb.Recordset")
		Sql = "select * from wap_bbs WHERE id="&id
		Rs.Open Sql,conn,1,3
		if not (rs.bof and rs.eof)  then 
		rs.Delete
		end if
		rs.Close
		Set rs = Nothing
%>
		<table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
		  <tr bgcolor=#E8F1FF class=TBBG9> 
		    <td colspan="2">删除评论成功!
		     <br/><a href='admin_bbs.asp?Action=view&bid=<%=bid%>&lid=<%=lid%>'>返回评论管理</a></td>
 		 </tr>
		</table>

<%	else%>
<form name="pollform3sdx" method="post" action="admin_bbs.asp?Action=del&id=<%=id%>&bid=<%=bid%>&lid=<%=lid%>">
<input type="hidden" name="SubmitFlag" value=yes>		
<table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
  <tr bgcolor=#E8F1FF class=TBBG9> 
    <td colspan="2"><font color=ff0000 class=RedFont> 
      <strong><font color="#FF0000">确认信息: 真的要删除编号为<%=id%>评论吗?</font></strong><br><br>
      <input  class=fmbtn type=button value="不能删啊" onclick="javascript:history.go(-1);">
		<input type=submit name=删除 value="当然删除" class=fmbtn></td>
  </tr>
</table>
</form>
<%
end if
	else

				Response.Write("请不要非法传递参数!")
	end if
End Function




Function edit
dim lid,id,bid
lid=Request("lid")
bid=Request("bid")
id=Request("id")
	if not isnumeric(lid) then lid=""
	if not isnumeric(id) then id=""
	if not isnumeric(bid) then bid=""
	if lid<>"" and  id<>"" and  bid<>"" then 
%>

		<form name="pollform3sdx" method="post" action="admin_bbs.asp?Action=edit&id=<%=id%>&bid=<%=bid%>&lid=<%=lid%>">
		<p style="margin-left:15px;">
		<b>修改评论</b><br/><a href='admin_bbs.asp?Action=edit&id=<%=bid%>&lid=<%=lid%>'>返回评论管理</a></p>
		<input type="hidden" name="SubmitFlag" value=yes>
		<table width="100%" border="0" align="center" cellpadding="8" cellspacing="0"  style="border-collapse: collapse" bordercolor="#6B8FC8"  class=TBone>

		 <tr>
		 <td align="center">
<%
		 If Request("SubmitFlag") <> "" Then
			dim flag,errmsg,title
			flag=1
			errmsg="<ul><font color=red>"
			title=TRim(Request.Form("title"))
			if title=""  then errmsg=errmsg&"<li>评论内容不能为空</li>":flag=0
				if flag<>0 then
				set rs=server.CreateObject("adodb.recordset")
				sql="select * from wap_bbs WHERE id="&id
				rs.open sql,conn,1,3
				if not (rs.bof and rs.eof)  then
					rs("title")=title
					
				rs.update()
				end if
				rs.Close
				Set rs = Nothing
				Response.Write("成功修改评论内容!")
				Response.Write("<br/><a href='admin_bbs.asp?Action=view&bid="&bid&"&lid="&lid&"'>返回评论管理</a>")
				errmsg=errmsg&"</font></ul>"
			else
				Response.Write("由于以下原因,设置没有成功,请<a href='javascript:history.back()'>返回</a>修改:<br>"&errmsg&"<br><button  onclick='javascript:history.back()'>返回修改</button>") 
		
			end if	
		Else
		set rs=server.CreateObject("adodb.recordset")
		sql="select * from wap_bbs where id="&id
		Rs.Open Sql,conn,1,1
		if not (rs.bof and rs.eof)  then 
%>
			<table width="100%" border=0 align="center" cellpadding=5 cellspacing=1    style="border-collapse: collapse" bordercolor="#6B8FC8"  class=TBone>

 		       <tr bgcolor=#E8F1FF class=TBBG9> 
  		        <td valign="top">评论内容:<br/>支持UBB</td>
  		        <td><textarea rows="15" name="title" cols="63" ><%=rs("title")%></textarea></td>
   			     </tr>
    			<tr bgcolor="#E8F1FF">
      			<td  colspan="4" > <div align="center">
			<input type=submit name=保存 value="保 存" class=fmbtn> 
			<input type=button  class=fmbtn name=取消 value=取 消  onclick="javascript:history.go(-1);">
			</td>
			</tr>
		  </table>

		</form>
<%	

	else%>
		<table width="100%" border=0 align="center" cellpadding=5 cellspacing=1 bgcolor=#cccccc class=TBone>
		  <tr bgcolor=#E8F1FF class=TBBG9> 
		    <td colspan="2">没有该评论!</td>
 		 </tr>
		</table>
	<%end if
		rs.Close
		Set rs = Nothing
	End If
	else

				Response.Write("请不要非法传递参数!")
	end if

End Function
%>

⌨️ 快捷键说明

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