<!-- #include file="opendb.asp"-->
<%
  	set rs=Server.CreateObject("ADODB.Recordset")
  	sqlstr="select * from Config"
  	rs.open sqlstr,conn,1,3
  	If Not (rs.Eof And rs.Bof) Then
		GBENum  = rs("Guest_Num")
	End If
%>
<%
  Dim sTitle, sName, sDate, sTime, sType, sSql, sRs, pn
 	 'GbUrl = "http://你的留言本网址"           	'请修改链接页面
  	GbUrl = Trim(Request("gurl"))
  	gNum  = Trim(Request("gnum"))
  	sName = Trim(Request("gname"))
  	sDate = Trim(Request("gdate"))
  	sType = Trim(Request("type"))
  	set sRs=Server.CreateObject("ADODB.Recordset")
	If sType="top" Then
		sSql="select top " & gNum & " * from [guest] order by TopG,id desc"
	Else
		sSql="select top " & gNum & " * from [guest] order by id desc"
	End If
  
  sRs.open sSql,conn,1,3
  If Not ( sRs.Eof And sRs.Bof ) Then
%>
<%
  	i=0
  	While i<gNum AND Not sRs.EOF
		oStr = "<table border=0 cellspacing=0 cellpadding=0><tr><td>&nbsp;"
		pn = Fix(i/GBENum)
		oStr = oStr + "<a href=" & GbUrl &  "?currentpage=" & pn & "#" & sRs("id") & " target=_blank>" & sRs("Title") & "</a>&nbsp;"
		If sName="view" Then
			oStr = oStr + "<font color=#CCCCCC>[" & sRs("name") & "]</font>&nbsp;"
		End If
		If sDate="view" Then
			oStr = oStr + "<font color=#CCCCCC>[" & sRs("Date") & "]</font>"
		End If
		oStr = oStr + "</td></tr></table>"
		otStr = otStr + oStr
		otStr = escape(otStr)
		otStr = unescape(otStr)
  	sRs.MoveNext
	i=i+1
  	Wend 
%>
<%
  	End If
%>
<%
  sRs.close
  set sRs=nothing
  conn.close
  set conn=nothing
%>
document.write("<% Response.Write otStr  %>");

