<%
dim connnong,connnongstr
connnongstr="DBQ="+server.mappath("/shujuku/chajianshujuku/nongchang/saytk_nongchang")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set connnong=server.createobject("ADODB.connECTION")
connnong.open connnongstr


'==获取种植类型==
function nonglx(num)
set rslx=Server.CreateObject("ADODB.Recordset")
rslx.Open "select * from sd where id="&num,connnong,1,1
If Not rslx.eof Then
response.Write rslx("name")
End If
rslx.close
Set rslx=nothing
end Function

'取用户币数
'==================================
Function userjb(usersid)
if usersid="" or isnumeric(usersid)=False then usersid=0
set rsusername=server.CreateObject("ADODB.RecordSet")
rsusername.Open "select myjb from Users where ID="&usersid,conn,1,1
usersnamjb=rsusername("myjb")
rsusername.close
Set rsusername=nothing
If usersid=0 Then
response.write"无此会员!"
else
response.write""&usersnamjb&""
End if
end Function
'取时间值
Function date_nongtalk(gamedatenum)
Dim aas,bbs,ccs,dds,ees,ffs,ggs 
aas=DateDiff("s",now(),gamedatenum) 
bbs=Int(aas/86400) 
ccs=aas-bbs*86400 
dds=Int(ccs/3600)
ees=ccs-dds*3600 
ffs=Int(ees/60)
ggs=ees-ffs*60 

if ggs="" or ggs<=0 then ggs=1
if bbs>0 then Response.write bbs&"天"&dds&"小时"&ffs&"分钟"
if clng(bbs)<1 then
if bbs>0 or dds>0 then Response.write dds&"小时"&ffs&"分钟"
end if
if clng(dds)<1 and clng(bbs)<1 then
if bbs>0 or dds>0 or ffs>0 then Response.write ffs&"分钟"&ggs&"秒" 
end if
if clng(ffs)<1 then
Response.write ggs&"秒" 
end If

end Function

'===取农场动态==
Function nongchangdt(num)
If num>10 Then num=10
If saytk=100 Then Response.write "<div class=""alst"">"
set rs=server.createobject("adodb.recordset")
rs.open"select * from nongdt order by shijian desc",connnong,1,1
If Not rs.eof	Then
For i=1 To num     						
	If rs.eof Then Exit For	
If saytk=100 Then Response.write "<li>"
response.write ubb3(rs("dz"))
If rs("ids")<>0 Then response.write nonglx(rs("ids"))
response.write"["
response.write date_gametalk(rs("shijian"))
response.write"前]<br/>"
If saytk=100 Then Response.write "</li>"
rs.moveNext
 	Next

	Else
Response.write "暂无动态!"
End If
If saytk=100 Then Response.write "</div>"
rs.close
Set rs=nothing
end Function

userid=request("userid")
If userid="" Then userid=myid
%>



