<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="bbstop.asp"-->
<table cellpadding=0 cellspacing=0 border=0 width=762 bgcolor="#efefef" align=center class=pian>
<tr><td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<%
	dim founderr
	dim errmsg
	dim rs,sql
	set rs=server.createobject("adodb.recordset")
	founderr=false
	if membername="" then
		Errmsg=Errmsg+"<br>"+"<li>您还没有<a href=login.asp>登陆论坛</a>，不能查看收藏。如果您还没有<a href=reg.asp>注册</a>，请先<a href=reg.asp>注册</a>！"
		Founderr=true
	end if
	if Founderr=true then
		call error()
	else
		if request("action")="delete" then
			call delete()
		else
			call favlist()
		end if
		if Founderr=true then call error()
	end if
%>
</table></td></tr>
</table>
<%
	sub favlist()
	sql="select * from bbs_bookmark where username='"&membername&"' order by id desc"
	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		Errmsg=Errmsg+"<br>"+"·您的收藏夹还没有收藏，您可以收藏论坛指定贴子，当收藏中有数据后，本信息将自动删除！"
		Founderr=true
	else
%>
<tr>
<td bgcolor="#ffffff" align=center valign=top colspan="3"><b><font color=#ff3300>>> 您的收藏夹 <<</font></b></td></tr>
  <tr bgcolor="#efefef">
    <td width="60%" align=center>标题</td>
    <td width="25%" align=center>时间</td>
    <td width="15%" align=center>操作</td>
  </tr>
<%
	do while not rs.eof
%>
  <tr bgcolor="#ffffff">
    <td width="60%"><a href="<%=rs("url")%>"><%=htmlencode(rs("topic"))%></a></td>
    <td width="25%"><%=rs("addtime")%></td>
    <td width="15%"><a href="favlist.asp?action=delete&id=<%=rs("id")%>"><img src="images/a_delete.gif" border=0></a></td>
  </tr>
<%
	rs.movenext
	loop
	end if
	rs.close
	end sub

	sub error()
%>
<tr>
<td bgcolor="#efefef" align=center valign=top><b><font color=#ff3300>&gt;&gt; 错误信息 <<</font></b></td></tr>
<tr>
<td bgcolor="#ffffff" valign=top style="LEFT: 0px; WIDTH: 100%; WORD-WRAP: break-word"><br><p><blockquote><%=errmsg%>
</blockquote></p></td>
</tr>
<%
end sub

sub delete()
	sql="delete from bbs_bookmark where username='"&membername&"' and id="&cstr(request("id"))
	conn.execute sql
	response.redirect "favlist.asp"
%>

<%end sub%>
<!--#include file="bbsend.asp"-->