<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<%call head()
Call saycardd("推荐贴子")
dim tid,sellname
tid=ubb(request("tid"))
if tid="" or Isnumeric(tid)=False  then
Call Error("ID无效！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select * from sell where id="&tid,conn,1,1
if rs.eof then
  Call Error("帖子不存在！")
  end if
  sellname=rs("name")
  rs.close
  set rs=nothing
  
  Response.write "<a href='topic.asp?tid="&tid&"&amp;sid="&sid&"'>返回之前页</a>" & chr(13)
  Response.write "<br/>"&ubb(sellname)&""
    Response.write "<br/>-----------"
    Response.write "<br/>请选择好友（可多选）<br/>"
function uname(uid)
dim ru
Set ru = Server.CreateObject("ADODB.Recordset")
ru.Source ="SELECT name from Users where ID="&uid
ru.open ru.Source,Conn,1,1
if not ru.eof then
  if ru("name")<>"" then
  uname=ru("name")
  else
  uname="[ID"&uid&"]"
  end if
else
uname="不存在的会员"
end if
ru.close
set ru=nothing
end function

dim mesall
mesall = Trim(Request.QueryString("mesall"))
if mesall<>"" then
mesall=";"&mesall
end If
If saytk>1 then
%>
<form name="form" method="post" action="irecommendok.asp?tid=<%=tid%>&amp;sid=<%=sid%>&amp;saytk=<%=saytk%>">
<%End if

dim myp,total,u,url,ptp,MaxPages,nextpage
set rs=server.CreateObject("ADODB.RecordSet")
rs.Open "select Did from myfriend where cid="&myid&" order by id desc",conn,1,1

myp = Trim(Request.QueryString("page"))
if myp="" then
myp=1
end if

if rs.EOF then
Response.write "还没有好友<br/><br/>"
else
rs.PageSize=50
MaxPages=rs.PageCount
rs.absolutepage=myp
total=rs.RecordCount
u=0
Response.write "<select name='mesall' multiple='true'>"
do until rs.eof or u=rs.PageSize
Response.Write "<option value='"&rs("Did")&"'>"
Response.Write uname(rs("Did"))
Response.Write "</option>"
rs.MoveNext
u=u+1
loop
Response.write "</select><br/>"

end if
rs.close
set rs=Nothing

conn.close
set conn=Nothing
If saytk>1 Then
%><input type="hidden" name="TP" value="1">
<input type="submit" name="Submit" value="马上推荐"></form><br/><%
else
Response.write "<br/><anchor>马上推荐<go href=""irecommendok.asp?saytk="&saytk&"&amp;tid="&tid&"&amp;sid="&sid&""" method=""post"">" & chr(13)
Response.write "<postfield name=""mesall"" value=""$(mesall)"&mesall&"""/>" & chr(13)
Response.write "</go></anchor>" & chr(13)
Response.write "<br/><anchor>推荐所有好友<go href=""irecommendok.asp?saytk="&saytk&"&amp;tid="&tid&"&amp;sid="&sid&""" method=""post"">" & chr(13)
Response.write "<postfield name=""TP"" value=""1""/>" & chr(13)
Response.write "</go></anchor>" & chr(13)
End if
Response.write "<br/><a href='topic.asp?saytk="&saytk&"&amp;tid="&tid&"&amp;sid="&sid&"'>返回主贴</a>" & chr(13)

%>
<!--#include file="fanhui.asp"-->

<%
call headsay()
%>
