<!--#include file="UserConn.asp" -->
<%
Chkhttp()
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache" 
response.Charset="gb2312"
id=QvodCms_CLng(Request.QueryString("id"))
Dim temp1
UserName=Request.Cookies("qvodcms")("UserName")
Uid=QvodCms_Clng(Request.Cookies("qvodcms")("Uid"))'会员ID
ujf=Request.Cookies("qvodcms")("Ujf")'会员积分
uvip=Request.Cookies("qvodcms")("Uvip")'vip状态
utime=Trim(Request.Cookies("qvodcms")("Utime"))'服务时间
ulc=Request.Cookies("qvodcms")("Ulc")'会员名称
upic=Request.Cookies("qvodcms")("UPic")'会员头像
if Len(UserName)<2 or UserName="" or Uid<=0  or utime="" or uvip="" Then
Response.Write "Err_100"
Elseif id>0 then 
'-------------------------------------------------------
 Set rs = Server.CreateObject("adodb.recordset")
 sql = "select ufav from qvodcms_user where uid="&uid&""
 rs.Open sql, Conn, 1, 3
  if len(rs("ufav"))>1 then
    ufavlist=rs("ufav")
  else
    ufavlist="|123456790"
  End if
    temp=split(ufavlist,"|")
	  for j = 1 to ubound(temp)
	    if id=QvodCms_CLng(temp(j)) then
	      Response.Write "Err_102"'''重复收藏
		  Response.End()
		  Exit for
	    elseif ubound(temp)>=500 then
		  Response.Write "Err_103"'''您的收藏夹已达到500部影片,请清理后再收藏!
		  Response.End()
		  Exit for
	    End if
	  next 	
      temp1="|" 
	  temp1=ufavlist&""&temp1&""&id
	  rs("ufav")=temp1
	  rs.update:rs.Close:Set rs=Nothing:conn.execute"Update [qvodcms_name] set data_fav=data_fav+1 where name_id="&id
	  Response.Write "Err_101"'''收藏成功
	  Call CloseConn
'-----------------------------------------------------  
End if 
%>
