<%
'===============================

dim Giftsconn
on error resume next
Response.Buffer=True
dbname="/bbs/Gifts/Gifts.mdb"
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbname)
Set Giftsconn = Server.CreateObject("ADODB.Connection")
Giftsconn.Open connstr

	set rsSwitch=Server.CreateObject("ADODB.Recordset")
	rsSwitch.open"select * from Seta ",Giftsconn,1,2
	if not rsSwitch.eof then
	GiftsSwitch=rsSwitch("Switch")
	GiftsSend=rsSwitch("Send")
	GiftsClosea=rsSwitch("Closea")
	end if
	rsrsSwitch.close
	set rsrsSwitch=nothing 
	
function gametalk(num)
        dim rs11,ga
        set rs11 = server.createobject("adodb.recordset")
          rs11.open"select * from Record order by time desc",Giftsconn,1,1
          If rs11.eof Then 
            response.write("还没有任何动作记录！<br/>")
                  else
            rs11.Move(0)
                  ga=1
            do while ((not rs11.EOF) and ga <=num)
response.write  date_gametalk(rs11("time"))&"前>><a href=""/bbs/uinfo.asp?id="&rs11("uid")&"&amp;sid="&sid&""">"&myname(rs11("uid"))&"</a>给<a href=""/bbs/uinfo.asp?id="&rs11("ids")&"&amp;sid="&sid&""">"&myname(rs11("ids"))&"</a>送了一个"&rs11("nane")&"<br/>----------<br/>"
                  rs11.MoveNext
                      ga=ga+1
                            loop
                   end if
                rs11.close
        set rs11=nothing
end function
Function date_gametalk(gamedatenum)
Dim aa,bb,cc,dd,ee,ff,gg 
aa=DateDiff("s",gamedatenum,now()) 
bb=Int(aa/86400) 
cc=aa-bb*86400 
dd=Int(cc/3600)
ee=cc-dd*3600 
ff=Int(ee/60)
gg=ee-ff*60 
if gg="" or gg<=0 then gg=1
if bb>0 then Response.write bb&"天" 
if clng(bb)<1 then
if bb>0 or dd>0 then Response.write dd&"小时" 
end if
if clng(dd)<1 and clng(bb)<1 then
if bb>0 or dd>0 or ff>0 then Response.write ff&"分钟" 
end if
if clng(ff)<1 then
Response.write gg&"秒" 
end if
end Function

function myname(str)
set rsmyname=Server.CreateObject("ADODB.Recordset")
rsmyname.open"select top 1 * from Users where id="&str,conn,1,1
if rsmyname.eof then
myname="没有此会员！"
else
myname=rsmyname("name")
end if
rsmyname.close
set rsmyname=nothing 
end function
sub aa()
'检查有几条新留言
dim newguest
newguest = 0
IF myid > 0 THEN
newguest = ForNewGuest(myid)
END IF
if myid<>0 then
if newguest > 0 then
Response.write "<a href='../msgview.asp?url="&Replace(Replace(R_url(),"sid=","o="),"sid=","o=")&"&amp;sid="&sid&"'>您有"&newguest&"条新消息</a><br/>"& chr(13)
end if
end if
end sub
%>