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

📄 yd_guestbook_index.asp

📁 是个不错的留言版
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="YD_guestbook_CONN.asp"-->
<!--#include file="YD_guestbook_Const.asp"-->
<%
'------------------------------------------------------------------------
'By 玄天尊, 更新于2005-05-19 晚.
'和论坛结合的留言本,分会员与游客两种模式
'可定义是否使用验证码,防止恶意留言
'ACCESS与MSSQL通用版本
'www.YdSpace.org And www.YdSpace.net  异度空间技术部
'------------------------------------------------------------------------
Dvbbs.Stats=guestbook_setting(0)
Dvbbs.Nav()
Dvbbs.Head_var 2,0,"",""
call GuestState()
call main()
Dvbbs.ActiveOnline
Dvbbs.footer()

sub main()
Dim page
Response.Buffer=True
Dim replynum,Pnum,p,shijian
page=request("page")
%>
<script language="JavaScript">
<!--
function CheckAll(form)	{
  for (var i=0;i<form.elements.length;i++)	{
    var e = form.elements[i];
    if (e.name != 'chkall')	{
	e.checked = form.chkall.checked;
	}
	}
	}
//-->
</script>
<table class=tableborder1 cellspacing=1 cellpadding=1 align=center>
<a href="YD_guestbook_Ann.asp"><img src="YD_plus/guest/1.gif" alt="写一个新留言" border=0></a>
  <tr align=middle>
    <th width="32" height="25">表情</th>
    <th width="*">留言主题<%If dvbbs.master then%>&nbsp;&nbsp;&nbsp;<a title=进入管理项 href=?page=<%=page%>&action=admin id=tabletitlelink>管理</a><%End if%></th>
    <th width="80">作者</th>
    <th width="64">回复</th>
    <th width="195">最后更新</th>
  </tr>
  <form action="YD_guestbook_admin_del.asp?action=DelAnn" method="post" name="form1">
<%
sql="select Express,SaveTheme,SaveTime,UserName,ThemeEmail,ThemeFace,ThemeOicq,LastName,AnswerNumber,LastCon,id,Padlock from [YD_Guest_topic] order by id desc"
set rs=guestbook_conn.execute(sql)
if rs.eof and rs.bof then
%>
  <tr>
    <td class=tablebody2 colspan=5 height=25><font color=gray><a href=YD_guestbook_Ann.asp>当前没有留言</a></font></td>
  </tr>
</table>
<%
	Rs.close
	Set Rs=nothing
else
	currentPage=request("page")
	If currentpage="" or not isnumeric(currentpage) then
		currentpage=1
	End if
	Rs.close
	Set Rs=nothing
	Set Rs= Server.CreateObject("ADODB.Recordset")
	Rs.open SQL,guestbook_conn,1,1
	Rs.PageSize=25
	Rs.AbsolutePage=currentpage
	page_count=0
	totalrec=Rs.recordcount
	do while (not Rs.eof) and (not page_count = Rs.PageSize)
%>
  <tr>
    <td class=tablebody2 align=center height=27 width=32>
<%
		if request("action")="admin" then
%>
	<input type="checkbox" name="id" value=<%=rs("id")%>>
<%
		elseif rs(11)=1 then
%>
	<img src="YD_plus/guest/padlock.gif" title="锁定的留言">
<%
		else
%>
	<img src="Skins/Default/topicface/<%=rs(0)%>" title="留言时心情">
<%
		end if
		response.Write "</td><td class=tablebody1 align=left width=""*"">&nbsp;<a  title=""《"&Server.htmlencode(rs(1))&"》&#13;&#10;作者:"&htmlencode(rs(3))&"&#13;&#10;发表于:"&rs(2)&"&#13;&#10;最后回复:"&htmlencode(rs(9))&""" href=""YD_guestbook_Theme.asp?ThId="&rs(10)&""">"&htmlencode(rs(1))&"</a>"
		replynum=rs("AnswerNumber")+1
		if replynum>10 then
			response.write "&nbsp;&nbsp;[<img src=""Skins/Default/pagelist.gif""><b>"
  			if replynum mod 10=0 then
     				Pnum= replynum \ 10
  			else
     				Pnum= replynum \ 10+1
  			end if
			for p=1 to Pnum
				response.write " <a href='YD_guestbook_Theme.asp?ThId="& rs(10) &"&page="&P&"'><font color=""red"">"&p&"</font></a> "
				if p+1>7 then
					response.write "... <a href='YD_guestbook_Theme.asp?ThId="& rs(10) &"&page="&P&"'><font color=""red"">"&Pnum&"</font></a>"
					exit for
				end if
			next
			response.write "</b>]"
		else
			pnum=1
		end if
		response.Write "</td><td class=tablebody2 align=center width=""80"">"&htmlencode(rs(3))&"</td><td class=tablebody1 align=center width=""64"">"&rs(8)&"</td>"
		if request("action")="admin" then
			response.write "<td class=tablebody2 align=""center"" width=""195""><a title=""锁定本留言"" href=""YD_guestbook_admin_Edit.asp?action=Savepadlock&id="&rs(10)&"&dist=1"">锁定</a>&nbsp;<font color=red>|</font>&nbsp;<a title=""解除锁定"" href=""YD_guestbook_admin_Edit.asp?action=Savepadlock&id="&rs(10)&"&dist=0"">解锁</a></td>"
		else
			response.Write "<td class=tablebody2 align=""left"" width=""195"">&nbsp;&nbsp;"&FormatDateTime(rs(2),2)&"&nbsp;"&FormatDateTime(rs(2),4)&"&nbsp;<font color=red>|</font>&nbsp;"&htmlencode(rs(7))&"</td>"
		end if
		response.Write "</tr>"
		page_count = page_count + 1
		Rs.movenext
	loop
	Pcount=Rs.PageCount
	if request("action")="admin" then
%>
  <tr>
    <td class=tablebody2 colspan=5>
	&nbsp;<input type=checkbox name=chkall value=on onclick="CheckAll(this.form)">&nbsp;全选/取消&nbsp;批量删除&nbsp;<input type=submit name=Submit value=执行  onclick="{if(confirm('您确定执行删除操作吗?')){this.document.form1.submit();return true;}return false;}">
    </td>
  </tr>
  </form>
<%
	end if
%>
</table>
<table width=<%=Dvbbs.mainsetting(0)%> cellspacing=0 cellpadding=3 align=center>
  <tr>
    <td Align=Left>&nbsp;共 <Font Color=blue><%=totalrec%></Font> 主题,每页 <Font Color=blue><%=Rs.PageSize%></Font> 个,第 <Font Color=red><%=currentpage%></Font> 页 / 共 <Font Color=blue><%=Pcount%></Font> 页</td>
    <td Align=Right>分页:<%call disppagenum(currentpage,Pcount,"""?page=","""")%></td>
  </tr>
</table>
<%
	Rs.close
	Set Rs=nothing
End if
end sub
%>

⌨️ 快捷键说明

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