<%
'判断用户等级是否为高级会员
points = clng(ctr_user.points)
if not isnumeric(points) then points=0
issenioruser=false
if userjfstr<>"" then
spuserjfstr=split(userjfstr,",")
nfhypoints=clng(spuserjfstr(1))
if points>=nfhypoints then issenioruser=true
gonext=true
end if
if not issenioruser then'当用户不是高级会员时提示年费及终身会员或单独付费购买
tuserid810803=ctr_user.id
if instr(","&trbuyuserusernamegroup810803&",",","&tuserid810803&",")>0 then'判断该用户是否购买过此文章
else
if minuspoints>0 and gonext=true then
tuserpoints = clng(ctr_user.points)
if tuserpoints< minuspoints then'用户的积分少于文章要扣除的积分
gonext = false
%>
tmpstr=tmpstr+("<div style=\"padding:10px; text-align:center; line-height:24px; margin:5px auto;background:#FFEDED;width:90%;\">您的等级为：<span class=\"trpthystr\">普通会员</span> 升级到 <a href=\"<%=funpath%>user/urecharge.asp\" target=\"_blank\" class=\"trbnhybtn\"><i class=\"iconfont icon-account\"></i>包年会员(<%=split(userjfstr,",")(1)%>积分)</a> 或 <a href=\"<%=funpath%>user/urecharge.asp\" target=\"_blank\" class=\"trzshybtn\"><i class=\"iconfont icon-creditlevel\"></i>终身会员(<%=split(userjfstr,",")(2)%>积分)</a> 可免费浏览全站内容。 <br><br>若您单独付费查看本文，则需要扣除积分为：【<%=minuspoints%>】，您的积分为：【<%=tuserpoints%>】，还差<span style=\"color:#F00;\"> 【<%=minuspoints-tuserpoints%>】 </span>分就可以查看此文啦，一次性扣分永久免费看此文章</div>");

<%
else '当用户的积分大于文章要扣除的积分
'if gonext=true then
if istoread810803=1 then'用户点击了继续查看按钮
sql="select points from tr_user where id="&tuserid810803&" "'扣除用户积分
rs.open sql,conn,1,3
if not rs.eof then
tnowpoints810803=rs("points")
if clng(tnowpoints810803)>=clng(minuspoints) then
rs("points")=clng(tnowpoints810803)-clng(minuspoints)
isuserbuyed810803 = true
isjustbuyed810803=true
end if
rs.update
end if
rs.close
if isjustbuyed810803=true then'刚刚购买完文章，下一步将用户的id记录到文章的用户购买集合中，并且记录购买的订单，方便用户与管理员查看
uip=getip()
call trubuyarticleadd(id,tuserid810803)
call trubuylist(title,id,uname,tuserid810803,minuspoints,uip)
end if
else
gonext=false
%>
tmpstr=tmpstr+("<div style=\"padding:10px; text-align:center; line-height:24px; margin:5px auto;background:#FFEDED;width:90%;\">您的等级为：<span class=\"trpthystr\">普通会员</span> 升级到 <a href=\"<%=funpath%>user/urecharge.asp\" target=\"_blank\" class=\"trbnhybtn\"><i class=\"iconfont icon-account\"></i>包年会员(<%=split(userjfstr,",")(1)%>积分)</a> 或 <a href=\"<%=funpath%>user/urecharge.asp\" target=\"_blank\" class=\"trzshybtn\"><i class=\"iconfont icon-creditlevel\"></i>终身会员(<%=split(userjfstr,",")(2)%>积分)</a> 可免费浏览全站内容。 <br><br>若您单独付费查看本文， <a href=\"javascript:void(0);\" target=\"_self\" style=\"background:#F00;color:#fff;padding:5px;text-decoration:none;display:inline-block; line-height:20px;border-radius:5px;\" id=\"trreadminus810803\" > 点此继续查看 </a> 将会从您的总积分【<%=tuserpoints%>】中一次性扣除【<%=minuspoints%>】分，您将永久免费查看此文章</div>");
<%
isuserbuyed810803 = false
isshowbottomjs810803=false
end if
end if
end if
end if
end if
%>
