<%
dim YD_userip,rsip,YD_Date,YD_users,YD_day
YD_users="燃点真情" '不能修改名字,否则出错
YD_userip = Request.ServerVariables("HTTP_X_UP_CALLING_LINE_ID")
If YD_userip = "" Then YD_userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if YD_userip = "" then YD_userip = Request.ServerVariables("REMOTE_ADDR")
  Set rsip = Server.CreateObject("ADODB.Recordset")
rsip.open"select YD_Date,YD_Tod,YD_Today from YD_Counter",conn,1,1
YD_Date=rsip("YD_Date")
if YD_Date<>date() then
  YD_day=date()-1
  application.lock
  if dateSQL=0 then  
  set rs=server.createobject("ADODB.Recordset")
sql="select YD_Counter,YD_Tod,YD_Today,YD_Yesterday,YD_Yays,YD_tod,YD_date,YD_browser,YD_browsers from YD_Counter"	
rs.Open sql,conn,1,1
if rs("yd_counter")="" then
rs.addnew
rs("YD_Counter")=0
rs("YD_Tod")=0
rs("YD_Today")=0
rs("YD_Yesterday")=0
rs("YD_Yays")=0
rs("YD_tod")=0
rs("YD_date")=now()
rs("YD_browser")=0
rs("YD_browsers")=0
rs.update
rs.close
set rs=nothing
end if
else
 conn.Execute"Update YD_Counter set YD_Today=0,YD_Browser=0,YD_Date='"&date()&"',YD_Yays=YD_Yays+1,YD_Yesterday="&rsip("YD_Today")&""
  end if
  application.unlock
  conn.Execute"delete from YD_Iprr"
else

  application.lock
  conn.Execute"Update YD_Counter set YD_Browser=YD_Browser+1"  
  if conn.execute("select YD_userip from YD_Iprr where YD_userip='"&YD_userip&"'").eof then
  conn.Execute"insert into YD_Iprr(YD_Userip,Users) values('"&YD_userip&"','"&YD_users&"')"
  conn.execute("Update YD_Counter set YD_Counter=YD_Counter+1")
        conn.Execute"Update YD_Counter set YD_Today=YD_Today+1"    
  end if
  application.unlock
end if
       conn.Execute"Update YD_Counter set YD_Tod="&rsip("YD_Today")&" where "&rsip("YD_Tod")&"<"&rsip("YD_Today")
  conn.Execute"Update YD_Counter set YD_Browsers=YD_Browsers+1"  
       rsip.close
       set rsip=nothing
'会员等级控制
function deCode_base64(baseStr) 
if len(baseStr) mod 4 <>0 then 
exit function 
end if 
bins="" 
for i=1 to Len(baseStr) 
nChar=mid(baseStr,i,1) 
if nChar="=" then 
exit for 
end if 
oldValue=inStr(Bstr_base64,nChar)-1 
binValue=right("000000" & dec2bin(oldValue),6) 
bins=bins & binValue 

if len(bins)>=8 then 
deChar=left(bins,8) 
bins=mid(bins,9) 
deCode_base64=deCode_base64 & chrB(bin2Dec(deChar)) 
end if 
next 
end function
'取得VIP
function getvip(newmyjb,newmyjy)
  if isNull(newmyjb) or newmyjb="" then
	   newmyjb=0
  end if
    if isNull(newmyjy) or newmyjy="" then
	   newmyjy=0
  end if
  newmyjb=CLng(newmyjb)
  newmyjy=CLng(newmyjy)
  
  	if newmyjb>=clng(vipjb5) and newmyjy>=clng(vipjy5) then
  	getvip="5"
  	elseif newmyjb>=clng(vipjbd1) and newmyjy>=clng(vipjyd1) then
  	getvip="4"
  	elseif newmyjb>=clng(vipjbc1) and newmyjy>=clng(vipjyc1) then
  	getvip="3"
    elseif newmyjb>=clng(vipjbb1) and newmyjy>=clng(vipjyb1) then
  	getvip="2"
    elseif newmyjb>=clng(vipjba1) and newmyjy>=clng(vipjya1) then
  	getvip="1"
  	else
  	  	getvip="0"
  end if
end function 

'取得等级
function getLvl(newmyjb)
  if isNull(newmyjb) or newmyjb="" then
	   newmyjb=0
  end if
  newmyjb=CLng(newmyjb)
  if newmyjb>=0 and newmyjb <= 50 then
  	 getLvl="<img src=""/img/star.gif"" alt=""1级""/>"
  elseif newmyjb>=51 and newmyjb <= 100 then
  	getLvl="<img src=""/img/star.gif"" alt=""2级""/><img src=""/img/star.gif"" alt=""2级""/>"
  elseif newmyjb>=101 and newmyjb <= 300 then
  	getLvl="<img src=""/img/star.gif"" alt=""3级""/><img src=""/img/star.gif"" alt=""3级""/><img src=""/img/star.gif"" alt=""3级""/>"
  elseif newmyjb>=301 and newmyjb <= 500 then
  	getLvl="<img src=""/img/moon.gif"" alt=""4级""/>"
  elseif newmyjb>=501 and newmyjb <= 1000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""5级""/><img src=""/img/star.gif"" alt=""5级""/>"
  elseif newmyjb>=1001 and newmyjb <= 2000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""6级""/><img src=""/img/star.gif"" alt=""6级""/><img src=""/img/star.gif"" alt=""6级""/>"
  elseif newmyjb>=2001 and newmyjb <= 3000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""7级""/><img src=""/img/star.gif"" alt=""7级""/><img src=""/img/star.gif"" alt=""7级""/><img src=""/img/star.gif"" alt=""7级""/>"
  elseif newmyjb>=3001 and newmyjb <= 4000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""8级""/><img src=""/img/moon.gif"" alt=""8级""/>"



  elseif newmyjb>=4001 and newmyjb <= 5000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""9级""/><img src=""/img/moon.gif"" alt=""9级""/><img src=""/img/star.gif"" alt=""9级""/>"
  elseif newmyjb>=5001 and newmyjb <= 6000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""10级""/><img src=""/img/star.gif"" alt=""10级""/><img src=""/img/star.gif"" alt=""10级""/><img src=""/img/moon.gif"" alt=""10级""/>"

  elseif newmyjb>=6001 and newmyjb <= 7000 then
  	getLvl="<img src=""/img/star.gif"" alt=""11级""/><img src=""/img/moon.gif"" alt=""11级""/><img src=""/img/moon.gif"" alt=""11级""/><img src=""/img/star.gif"" alt=""11级""/><img src=""/img/star.gif"" alt=""11级""/>"

  elseif newmyjb>=7001 and newmyjb <= 8000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""12级""/><img src=""/img/moon.gif"" alt=""12级""/><img src=""/img/moon.gif"" alt=""12级""/>"
  elseif newmyjb>=8001 and newmyjb <= 9000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""13级""/><img src=""/img/moon.gif"" alt=""13级""/><img src=""/img/moon.gif"" alt=""13级""/><img src=""/img/star.gif"" alt=""13级""/>"

  elseif newmyjb>=9001 and newmyjb <= 10000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""14级""/><img src=""/img/moon.gif"" alt=""14级""/><img src=""/img/moon.gif"" alt=""14级""/><img src=""/img/star.gif"" alt=""14级""/><img src=""/img/star.gif"" alt=""14级""/>"

  elseif newmyjb>=10001 and newmyjb <= 11000 then
  	getLvl="<img src=""/img/moon.gif"" alt=""15级""/><img src=""/img/moon.gif"" alt=""15级""/><img src=""/img/moon.gif"" alt=""15级""/><img src=""/img/star.gif"" alt=""15级""/><img src=""/img/star.gif"" alt=""15级""/><img src=""/img/star.gif"" alt=""15级""/>"

  elseif newmyjb>=11001 and newmyjb <= 12000 then
  	getLvl="<img src=""/img/sun.gif"" alt=""16级""/>"
  elseif newmyjb>=12001 and newmyjb <= 13000 then
  	getLvl="<img src=""/img/sun.gif"" alt=""17级""/><img src=""/img/star.gif"" alt=""17级""/>"


  elseif newmyjb>=13001 and newmyjb <= 14000 then
  	getLvl="<img src=""/img/sun.gif"" alt=""18级""/><img src=""/img/star.gif"" alt=""18级""/><img src=""/img/star.gif"" alt=""18级""/>"

  elseif newmyjb>=14001 and newmyjb <= 15000 then
  	getLvl="<img src=""/img/sun.gif"" alt=""19级""/><img src=""/img/star.gif"" alt=""19级""/><img src=""/img/star.gif"" alt=""19级""/><img src=""/img/star.gif"" alt=""19级""/><img src='/img/star.gif' alt='19级'/>"
  elseif newmyjb>=15001 and newmyjb <= 16000 then
  	getLvl="<img src='/img/sun.gif' alt='20级'/><img src='/img/moon.gif' alt='20级'/>"
  elseif newmyjb>=20001 and newmyjb <= 27000 then
  	getLvl="<img src='/img/sun.gif' alt='21级'/><img src='/img/moon.gif' alt='21级'/><img src='/img/moon.gif' alt='21级'/>"

  elseif newmyjb>=27001 and newmyjb <= 58000 then
  	getLvl="<img src='/img/sun.gif' alt='22级'/><img src='/img/moon.gif' alt='22级'/><img src='/img/moon.gif' alt='22级'/><img src='/img/moon.gif' alt='22级'/>"

  elseif newmyjb>=58001 and newmyjb <= 89000 then
  	getLvl="<img src='/img/sun.gif' alt='23级'/><img src='/img/sun.gif' alt='23级'/>"
  elseif newmyjb>=89001 and newmyjb <= 150000 then
  	getLvl="<img src='/img/sun.gif' alt='24级'/><img src='/img/sun.gif' alt='24级'/><img src='/img/moon.gif' alt='24级'/>"

  elseif newmyjb >= 1000001 then
  	getLvl="<img src='/img/sun.gif' alt='25级'/><img src='/img/sun.gif' alt='25级'/><img src='/img/sun.gif' alt='25级'/>"

  end if

end function

'取得头衔
function getHandle(mymoney)
  dim lvlstr,lvl0,lvl2,i
  if isNull(mymoney) or mymoney="" then
	   mymoney=0
  end if
  mymoney=left(mymoney,9)
  mymoney=CLng(mymoney)
  lvlstr=saybbslvl1&"_"&saybbslvl&"_"&saybbslvl

  if isNull(lvlstr) or lvlstr="" then
  	 getHandle=""
  	 exit function
  end if 
  
  lvl0=split(split(lvlstr,"_")(0),"|")
  lvl1=split(split(lvlstr,"_")(1),"|")
  on error resume next
  for i=ubound(lvl0) to 0 step -1
  	  if mymoney > Clng(lvl0(i)) then
  	  	 getHandle=lvl1(i)
  	  	 exit function
  	  end if  	
  next  
  getHandle=""
  
end function 


'读取cookies 数据

if Request.Cookies("TextCookies1")<>"" then
sid=Request.Cookies("TextCookies1")

end if
%>
