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

       '最新文件
function newfile(num,relid1,reidd,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
  dim e1,rs77
if relid1<>0 then
if relid1<>0 and reidd<>0 then
gettest="where lid="&relid1&" and idd="&reidd
Elseif reidd<>0 And relid1=0 then
gettest="where idd="&reidd
Elseif reidd=0 and relid1<>0 Then
gettest="where lid="&relid1
else
gettest="where typeid=0"
end if
end if
        set rs77 = server.createobject("adodb.recordset")
sql1="Select id,name,YD_size,Hit,filepin,TYPE,LID,IDD from xzfile "&gettest&" order by id desc"
rs77.open sql1,conn,1,1
pa=request.QueryString("pa")
if pa="" or IsNumeric(pa)=False then pa=1
          If rs77.eof Then 
            response.write("还没有文件！<br/>")
                  else
            rs77.Move(0)

                  e1=1
 do while ((not rs77.EOF) and e1 <=num)
 If saytk=100 Then response.write"<li>"
 If CLng(he)=1 Then response.write ubbimg(ubblese5)
response.write"<a href='/soft_view.asp?id=" &  rs77("id") & "&amp;class="&rs77("LID")&"&amp;cid="&rs77("IDD")&"&amp;pa="&pa&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs77("name")),CLng(le))&"</a><br/>"
If saytk=100 Then response.write"</li>"
rs77.MoveNext
e1=e1+1
loop
end If
If saytk=100 Then response.write"</ul>"
rs77.close
set rs77=nothing
end function
'=======================================
       '最热文件
function hotfile(num,relid1,reidd,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
  dim rs78
if relid1<>0 then
if relid1<>0 and reidd<>0 then
gettest="where lid="&relid1&" and idd="&reidd
Elseif reidd<>0 And relid1=0 then
gettest="where idd="&reidd
Elseif reidd=0 and relid1<>0 Then
gettest="where lid="&relid1
else
gettest="where typeid=0"
end if
end if
        set rs78 = server.createobject("adodb.recordset")
sql1="Select id,lid,ldd,name from xzfile "&gettest&" order by hit desc"
rs78.open sql1,conn,1,1
pa=request.QueryString("pa")
if pa="" or IsNumeric(pa)=False then pa=1
          If rs78.eof Then 
            response.write("还没有文件！<br/>")
                  else
            rs78.Move(0)

                  e1=1
 do while ((not rs78.EOF) and e1 <=num)
  If saytk=100 Then response.write"<li>"
 If CLng(he)=1 Then response.write ubbimg(ubblese20)
response.write"<a href='/soft_view.asp?id=" &  rs78("id") & "&amp;class="&rs78("LID")&"&amp;cid="&rs78("IDD")&"&amp;pa="&pa&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs78("name")),CLng(le))&"</a><br/>"
 If saytk=100 Then response.write"</li>"
rs78.MoveNext
e1=e1+1
loop
end If
If saytk=100 Then response.write"</ul>"
rs78.close
set rs78=nothing
end function



'随机文件
function sjfile(num,relid1,reidd,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
       dim rs79
if relid1<>0 then
if relid1<>0 and reidd<>0 then
gettest="where lid="&relid1&" and idd="&reidd
Else
if reidd<>0 And relid1=0 then
gettest="where idd="&reidd
Else
if relid1<>0 and reidd=0 Then
gettest="where lid="&relid1
else
gettest="where typeid=0"
end if
end If
end If
end if
set rs79 = server.createobject("adodb.recordset")
        sqlsjfile="select id,lid,ldd,name from xzfile "&gettest&" order by id desc"
        rs79.open sqlsjfile,conn,1,1
sjxh=num 
a=1
Do While a<=sjxh

if rs79.recordcount <=0 then
response.write"还没有文件！<br/>"
else 
 randomize
sjj=int(rnd()*rs79.recordcount)+1
rs79.absoluteposition=sjj
 If saytk=100 Then response.write"<li>"
 If CLng(he)=1 Then response.write ubbimg(ubblese21)
response.write"<a href='/soft_view.asp?id="&rs79("ID")&"&amp;class="&rs79("lid")&"&amp;cid="&rs79("IDD")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"
response.write""&left(rs79("name"),CLng(le))&"</a><br/>"
 If saytk=100 Then response.write"</li>"
end If
a=a+1 
Loop
If saytk=100 Then response.write"</ul>"
rs79.close
set rs79=nothing
end function
  


'问候语

function wenhouyu()

If time<#02:00:00# and time>=#01:00:00# then

Response.write ""&saytkwhyw&""
End if

If time<#03:00:00# and time>=#02:00:00# then
Response.write ""&saytkwhyw1&""
End if

If time<#04:00:00# and time>=#03:00:00# then
Response.write ""&saytkwhyw2&""
End if

If time<#05:00:00# and time>=#04:00:00# then
Response.write ""&saytkwhyw3&""
End if

If time<#06:00:00# and time>=#05:00:00# then
Response.write ""&saytkwhyw4&""
End if

If time<#07:00:00# and time>=#06:00:00# then
Response.write ""&saytkwhyw5&""
End if

If time<#08:00:00# and time>=#07:00:00# then
Response.write ""&saytkwhyw6&""
End if

If time<#11:00:00# and time>=#08:00:00# then
Response.write ""&saytkwhyw7&""
End if

If time<#12:00:00# and time>=#11:00:00# then
Response.write ""&saytkwhyw8&""
End if

If time<#13:00:00# and time>=#12:00:00# then
Response.write ""&saytkwhyw9&""
End if

If time<#18:00:00# and time>=#13:00:00# then
Response.write ""&saytkwhyw10&""
End if

If time<#19:00:00# and time>=#18:00:00# then
Response.write ""&saytkwhyw11&""
End if

If time<#20:00:00# and time>=#19:00:00# then
Response.write ""&saytkwhyw12&""
End if

If time<#23:00:00# and time>=#20:00:00# then
Response.write ""&saytkwhyw13&""
End if

If time<#23:59:59# and time>=#23:00:00# then
Response.write ""&saytkwhyw14&""
End if

If time<#01:00:00# and time>=#00:00:00# then
Response.write ""&saytkwhyw15&""
End If
end Function
Function nnsaytk()

%>


农历<%=TianGan(((curYear - 4) Mod 60) Mod 10)%><%=DiZhi(((curYear - 4) Mod 60) Mod 12)%>年(<%=ShuXiang(((curYear - 4) Mod 60) Mod 12)%>)<%=NongliDayStr%><br/> 
<%

end Function
Function weather()
%>
<a href="/foryou/tq/index.asp?sid=<%=sid%>&amp;saytk=<%=saytk%>"><img src="http://wap.youdao.com/weather?doctype=image&amp;keyfrom=wap.mobkd.cn" alt="" /></a>
<%
end Function

function onlineCoun11()


Dim onlineCounts222
onlineCounts222 = conn.execute("Select count(ID) from [online]")(0)
Set rson111= Server.CreateObject("ADODB.Recordset")
rson111.open"select * from online where online=1 order by times desc",conn,1,1
Counton22=rson111.recordcount
rson111.close
set rson111=nothing
response.write "全站在线<a href=""/bbs/onlineview.asp?saytk="&saytk&"&amp;sid=" & sid & """>"&onlineCounts222&"</a>会员<a href=""/bbs/hy.asp?saytk="&saytk&"&amp;sid=" & sid & """>"&Counton22&"</a>游客<a href=""/bbs/onlineview.asp?saytk="&saytk&"&amp;sid=" & sid & """>"&onlineCounts222-Counton22&"</a>" & Chr(13)



end function



'随机广告
function adstr1(num,adsnum,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
   dim rsads1


set rsads1 = server.createobject("adodb.recordset")
rsads1.open"select id,name from gogo where typeID="&CLng(adsnum)&" order by id desc ",conn,1,1
if rsads1.recordcount <= 0 Then
If adsnum=1 Then
Response.write "<b>暂无主站广告！</b><br/>"
elseIf adsnum=2 Then
Response.write "<b>暂无社区广告！</b><br/>"
elseIf adsnum=2 Then
Response.write "<b>暂无文章广告！</b><br/>"
elseIf adsnum=2 Then
Response.write "<b>暂无文件广告！</b><br/>"
elseIf adsnum=2 Then
Response.write "<b>暂无图片广告！</b><br/>"
elseIf adsnum=2 Then
Response.write "<b>暂无赚币广告！</b><br/>"
End If
Else
sjads1=num 
a=1
Do While a<=sjads1
 randomize
sjj=int(rnd()*rsads1.recordcount)+1
rsads1.absoluteposition=sjj
If saytk=100 Then response.write"<li>"
 If CLng(he)=1 Then response.write ubbimg(ubblese1)
Response.Write ("<a href='url.asp?id="&ubb(rsads1("id"))&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&Left(ubb(rsads1("name")),CLng(le))&"</a><br/>")
 If saytk=100 Then response.write"</li>"
 a=a+1
loop  
end if


rsads1.close
set rsads1=Nothing
If saytk=100 Then response.write"</ul>"
end Function

function indexso()

if saytk<>1 Then
Response.write "<form name=""form"" method=""post"" action=""/searchall.asp?saytk="&saytk&"&amp;sid="&sid&""">"

%>
<dl class="srh"><dt>
<input type="text" name="keyword" size="24" value="" emptyok="true"/></dt><dd>
<%
response.write"文章<input type=""radio"" name=""sear"" value=""1""/>下载<input type=""radio"" name=""sear"" value=""2""/>图片<input type=""radio"" name=""sear"" value=""3""/><input type=""submit"" name=""submit"" value=""搜索"" style=""border:1px solid #fff;background:#191970;padding:2px 0 2px 0;color:#FFF;""/></dd></dl>"

else
response.write "<input name=""keyword"" emptyok=""true"" value="""" title=""请输入关键词""/>" & Chr(13)
response.write "<select name=""sear"" value=""1"">" & Chr(13)
response.write "<option value=""1"">标题</option>" & Chr(13)
response.write "<option value=""2"">内容</option>" & Chr(13)
response.write "</select><br/>"

response.write "搜站内:<anchor>下载<go href=""/soft_search.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"">" & Chr(13)
response.write "<postfield name=""keyword"" value=""$(keyword)""/>" & Chr(13)
response.write "<postfield name=""sear"" value=""$(sear)""/>" & Chr(13)
response.write "</go></anchor>" & Chr(13)
response.write ".<anchor>美图<go href=""/pic_search.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"">" & Chr(13)
response.write "<postfield name=""keyword"" value=""$(keyword)""/>" & Chr(13)
response.write "<postfield name=""sear"" value=""$(sear)""/>" & Chr(13)
response.write "</go></anchor>" & Chr(13)

response.write ".<anchor>文章<go href=""/search.asp?saytk="&saytk&"&amp;sid="&sid&""" method=""post"">" & Chr(13)
response.write "<postfield name=""keyword"" value=""$(keyword)""/>" & Chr(13)
response.write "<postfield name=""sear"" value=""$(sear)""/>" & Chr(13)
response.write "</go></anchor><br/>" & Chr(13)
end if
end function

Function qiu()
If instr(Request.ServerVariables("http_accept"),"wap")>0  Then
%>
<table align="center" border="1" width="239" bgColor=efefef  bordercolor=9400d3>
<td>
<%

Else
%>
<table align="center" border="1" width="320" bgColor=efefef  bordercolor=9400d3>
<td>
<%
End if
end Function


Function qiu1()%>
<body background=<%=saytkfbj%> VLINK="red" TEXT="Purple">
<script language="JavaScript1.2">
if (document.all)
document.body.style.cssText="border:15 ridge #ff33ff"
</script>
<TBODY>
<TR>
<table align="center"  width="520" border="1" bordercolor=9400d3 background=<%=saytkf1bj%>>
<tr>
<td>
<font size="5" >
<%end Function%>
<%


Function qiu2()%>
<body background=<%=saytkf1bj%> VLINK="red" TEXT="Purple">
<script language="JavaScript1.2">
if (document.all)
document.body.style.cssText="border:15 ridge #ff33ff"
</script>
<TBODY>
<TR>
<table align="center" border="1" width="520" bordercolor=9400d3 background=<%=saytkf2bj%>>
<tr>
<td>
<font size="5" >
<%end Function%>


<%
Function qiu3()%>

<body background=<%=saytkf2bj%> VLINK="red" TEXT="Purple">
<script language="JavaScript1.2">
if (document.all)
document.body.style.cssText="border:15 ridge #ff33ff"
</script>
<TBODY>
<TR>
<table align="center" border="1" width="520" bordercolor=9400d3 background=<%=saytkf1bj%>>
<tr>
<td>
<font size="5" >
<%end Function
%>


<%
Function qiu8()%>
<body background=<%=saytkzbj%> VLINK="red" TEXT="Purple">
<script language="JavaScript1.2">
if (document.all)
document.body.style.cssText="border:15 ridge #ff33ff"
</script>
<TBODY>
<TR>
<table align="center" border="1" width="520" bordercolor=9400d3 background=<%=saytkf4bj%>>
<tr>
<td>
<font size="5" >
<%end Function





function view(str)
if str<>"" then
Dim fso, ts, FilePath
FilePath=server.mappath(""&str&"")
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(FilePath) then
Set ts = fso.OpenTextFile(FilePath, ForReading)
view = ts.ReadAll()
else
view = "出错了:内容丢失!"
end if
set ts=nothing
set fso=nothing
end if
end function

'商品随机
Function shopsj(num,le,he)
If saytk=100 Then response.write"<ul class=""ulhot"">"
dim connsshop
set connsshop=Createobject("ADODB.connection")
connsshop.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/shop/saytkcom_shop")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
connsshop.open
   dim brs1
sjshop1=num 
a=1
Do While a<=sjshop1
set brs1=Server.CreateObject("ADODB.Recordset")
     ssql1="select id,name from shop_xx"
  brs1.open ssql1,connsshop,1,1

if brs1.recordcount <= 0 then
   Response.write "<b>暂无新品</b><br/>"
Else
 randomize
sjj=int(rnd()*brs1.recordcount)+1
brs1.absoluteposition=sjj
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese)
    Response.write "<a href='/shop/view.asp?id=" & brs1("id") & "&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&left(brs1("name"),CLng(le))&"</a><br/>"  
	If saytk=100 Then response.write"</LI>"
end if
a=a+1
loop
If saytk=100 Then response.write"</ul>"
brs1.close
set brs1=Nothing
connsshop.close
end Function

'最新商品
Function shopnew(num,le,he)
If saytk=100 Then response.write"<ul class=""alst"">"
set connsshop=Createobject("ADODB.connection")
connsshop.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/shop/saytkcom_shop")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
connsshop.open
   dim brs2

set brs2=Server.CreateObject("ADODB.Recordset")
     ssql2="select id,name from shop_xx order by id desc"
  brs2.open ssql2,connsshop,1,1

If brs2.eof Then 
   Response.write "<b>暂无新品</b><br/>"
   else
brs2.Move(0)
a=1
do while ((not brs2.EOF) and a<=num)
If saytk=100 Then response.write"<LI>"
If CLng(he)=1 Then response.write ubbimg(ubblese16)

Response.write "<a href='/shop/view.asp?id="&brs2("id")&"&amp;sid="&sid&"&amp;saytk="&saytk&"'>"&left(brs2("name"),CLng(le))&"</a><br/>"  
If saytk=100 Then response.write"</LI>"
brs2.MoveNext
a=a+1
loop
end If
If saytk=100 Then response.write"</ul>"
brs2.close
set brs2=Nothing
connsshop.close
end Function
Function saydjs(num)
dim countdowndate,thedate,daysleft,hoursleft,minutesleft,secondsleft,toverday,starttime,djsnum
djsnum=num
overday=0
starttime=saystarttime
t=DateAdd("d",overday,starttime)
CountdownDate =t
theDate = now()
aa = DateDiff("s",theDate,CountdownDate)
daysleft=int(aa/60/60/24)
hoursleft=int((aa-daysleft*60*60*24)/60/60)
minutesleft=int((aa-daysleft*60*60*24-hoursleft*60*60)/60)
secondsleft=int(aa-daysleft*60*60*24-hoursleft*60*60-minutesleft*60)

If djsnum=1 then%>
<%= DaysLeft%>天
<%ElseIf djsnum=2 then%>
<%= DaysLeft%>天<%= HoursLeft %>小时
<%ElseIf djsnum=3 then%>
<%= DaysLeft%>天<%= HoursLeft %>小时<%= MinutesLeft %>分
<%ElseIf djsnum=4 then%>
<%= DaysLeft%>天<%= HoursLeft %>小时<%= MinutesLeft %>分<%=secondsleft%>秒
<%End if
end Function


'最新许愿
function xy(num,le,he)

If saytk=100 Then response.write"<ul class=""alst"">"
dim connxy,connstr
connstr="DBQ="+server.mappath("/shujuku/chajianshujuku/xy/#SAYTK")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
set connxy=server.createobject("ADODB.CONNECTION")
connxy.open connstr

  dim rs146,gas9
set rs146=server.createobject("adodb.recordset")
sql="select name,id,tel,tj from jiudian order by id desc"
rs146.open sql,connxy,1,1

If rs146.eof Then 
            response.write("还没有友友放飞愿望！<br/>")
                  else
            rs146.Move(0)
                  gas9=1
            do while ((not rs146.EOF) and gas9 <=num)
If saytk=100 Then response.write"<li>"
If CLng(he)=1 Then response.write ubbimg(ubblese18)
  response.write ""&left(UBB(rs146("name")),6)&":<a href='/bbs/xy/ck.asp?id="&rs146("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs146("tel")),CLng(le))&"</a>"
response.write "(<a href='/bbs/xy/ZF.asp?id="&rs146("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>+"&UBB(rs146("tj"))&"</a>)"
 response.write "<br/>"
If saytk=100 Then response.write"</li>"

    rs146.MoveNext
                      gas9=gas9+1
                            loop
                   end if

If saytk=100 Then response.write"</ul>"
rs146.close
set rs146=nothing
connxy.close
end function



'最新家族
function zonetalk(num,le,he)

  dim rs141,gas1
set rs141=Server.CreateObject("ADODB.Recordset")
rs141.open"select id,zonejb,name,grouptxt from ydbbs where prentID=0 and city=2  order by zonejb desc",conn,1,1
If rs141.eof Then 
response.write("还没有创建"&zonene&"！<br/>")
                  else
            rs141.Move(0)
                  gas1=1
            do while ((not rs141.EOF) and gas1 <=num)
If saytk=100 Then response.write"<div style='padding-left:15px;'><dt style='background:url(/main/img/indexbg.gif) 0 -474px no-repeat;padding-left:6px;'>"
 dim zonenum
    zonenum=conn.execute("Select count(ID) from [users] where zoneid="&rs141("id"))(0)
If CLng(he)=1 Then response.write ubbimg(ubblese15)
response.write"<a href='/bbs/zoneall.asp?bbsid="&rs141("id")&"&amp;zall="&zonenum&"&amp;zjb="&rs141("zonejb")&"&amp;saytk="&saytk&"&amp;sid="&sid&"'>"&left(UBB(rs141("name")),CLng(le))&"</a>"
response.write"(<a href=""/bbs/zoneman.asp?id="&rs141("id")&"&amp;saytk="&saytk&"&amp;sid="&sid&""">"&zonenum&"</a>人)<br/>"&chr(13)
If saytk=100 Then response.write"</dt></div><div style='padding-left:22px;'>"
response.write""&left(rs141("grouptxt"),CLng(le))&"<br/>"
If saytk=100 Then response.write"</div>"
rs141.MoveNext
 gas1=gas1+1
 Loop

                   end if

rs141.close
set rs141=Nothing
end function



'最新足球赛事
function zhuqiu1(num) 

dim connzhuqiu1
set connzhuqiu1=Createobject("ADODB.connection")
connzhuqiu1.connectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/saytk_zhuqiu/lmzhuqiu.mdb")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
connzhuqiu1.open

 set rsqiu=Server.CreateObject("ADODB.Recordset")
  rsqiu.open "select yfmd,id,about from [zhuqiu] order by times desc",connzhuqiu1,1,1
if rsqiu.eof then 


response.write"暂无足球赛事！<br/>"
                  else
            rsqiu.Move(0)
                  gass1=1
do while ((not rsqiu.EOF) and gass1 <=num) 	
%><%=nuber%>.<%=rsqiu("yfmd")%><br/>
<a href="/saytkcom/lmzhuqiu/lmyf.asp?id=<%=rsqiu("id")%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>"><%=rsqiu("about")%></a>
<br/><%
rsqiu.MoveNext
gass1=gass1+1
Loop                         
end If

 rsqiu.close
 set rsqiu=Nothing
  connzhuqiu1.close
       end Function

%>
