<%
Set fs = Server.CreateObject("scripting.filesystemobject")
file = Server.MapPath("sj.txt")
Set txt = fs.opentextfile(file, 1, True)
If Not txt.atendofstream Then
Line = txt.readline
Response.Write "读取最后生成时间成功"&line&" "
End If
Set fs = Nothing
Set txt = Nothing
fz = DatePart("n", Now(), 2)
xs = DatePart("h", Now(), 2)
xcfz = DateDiff("n", Line, Now()) '判断最后更新时间与当前时间相差几分钟
response.write "与最后更新时间相差 "&xcfz&" 分钟 "
'Response.end
If (xs >= 6 And xs < 18) Then
scpl = 1 '白天 3
Else
scpl = 3 '晚上 5
End If
response.write "生成频率 "&scpl&" 分钟 "
If xcfz < scpl Then
'if (fz mod scpl) then
Response.Write "不生成" '不生成
Else
'生成
Response.Write "生成"
Dim fso, f
Dim strTitle, strContent, strOut
Set f = Server.CreateObject("adodb.recordset")
f.open "select * from template where id=2", conn, 1, 3
Name = f("name")
html = f("html")
strOut = f("template")
f.Close
sysj = Month(Now()) & "月" & Day(Now()) & "日" & Hour(Now()) & "时" & Minute(Now()) & "分"
Set ads = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 8 id,title,url,se from ads where weizhi=0 and time>now() order by top desc,id"
ads.open SQLT, conn, 1, 1
numrow2 = 0
menuads=menuads&""
menuads=menuads&"推荐栏目:"
If ads.EOF And ads.BOF Then
menuads=menuads&"暂时没有内容 "
Else
numRows = 0
While (Not ads.EOF)
If ads("se") = 1 Then
menuads=menuads&" | "&ads("Title")&""
Else
If ads("se") = 2 Then
menuads=menuads&" | "&ads("Title")&""
Else
menuads=menuads&" | "&ads("Title")&""
End If
End If
numRows = numRows + 1
ads.MoveNext
If (numRows Mod 8 = 0) Then
numrow2 = numrow2 + 1
End If
Wend
End If
ads.Close
Set ads = Nothing
menuads=menuads&""
strOut = Replace(strOut, "<{{menuads}}>", menuads)
Set Top = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 66 id,title,url,se from mingzhan where verity=1 order by topid desc,id"
Top.open SQLT, conn, 1, 1
numrow2 = 0
menutop=menutop&""
If Top.EOF And Top.BOF Then
menutop=menutop&" 暂时没有内容 "
Else
numRows = 0
While (Not Top.EOF)
If Top("se") = 1 Then
menutop=menutop&" "&top("Title")&""
Else
If Top("se") = 2 Then
menutop=menutop&" "&top("Title")&""
Else
If Top("se") = 3 Then
menutop=menutop&" "&top("Title")&""
Else
If Top("se") = 4 Then
menutop=menutop&" "&top("Title")&""
Else
menutop=menutop&" "&top("Title")&""
End If
End If
End If
End If
menutop=menutop&""
numRows = numRows + 1
Top.MoveNext
If (numRows Mod 7 = 0) Then
numrow2 = numrow2 + 1
menutop=menutop&""
End If
Wend
End If
Top.Close
Set Top = Nothing
menutop=menutop&""
strOut = Replace(strOut, "<{{menutop}}>", menutop)
Set tool = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 30 id,title,url,se from gongju where verity=1 order by topid desc,id"
tool.open SQLT, conn, 1, 1
numrow2 = 0
menutool=menutool&""
If tool.EOF And tool.BOF Then
menutool=menutool&" 暂时没有内容 "
Else
numRows = 0
While (Not tool.EOF)
If tool("se") = 1 Then
menutool=menutool&" "&tool("Title")&""
Else
If tool("se") = 2 Then
menutool=menutool&" "&tool("Title")&""
Else
If tool("se") = 3 Then
menutool=menutool&" "&tool("Title")&""
Else
If tool("se") = 4 Then
menutool=menutool&" "&tool("Title")&""
Else
menutool=menutool&" "&tool("Title")&""
End If
End If
End If
End If
menutool=menutool&""
numRows = numRows + 1
tool.MoveNext
If (numRows Mod 2 = 0) Then
numrow2 = numrow2 + 1
End If
Wend
End If
tool.Close
Set tool = Nothing
menutool=menutool&""
strOut = Replace(strOut, "<{{menutool}}>", menutool)
Set yesdayin = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 55 id,url,yl_yesterin,title from detail where verity=1 order by yl_yesterin desc,id"
yesdayin.open SQLT, conn, 1, 1
numrow2 = 0
menuyesdayin=menuyesdayin&""
If yesdayin.EOF And yesdayin.BOF Then
menuyesdayin=menuyesdayin&" 暂时没有内容 "
Else
numRows = 0
While (Not yesdayin.EOF)
menuyesdayin=menuyesdayin&" "&yesdayin("Title")&""
numRows = numRows + 1
yesdayin.MoveNext
If (numRows Mod 7 = 0) Then
numrow2 = numrow2 + 1
menuyesdayin=menuyesdayin&""
End If
Wend
End If
yesdayin.Close
Set yesdayin = Nothing
menuyesdayin=menuyesdayin&" 申请加入 »"
strOut = Replace(strOut, "<{{menuyesdayin}}>", menuyesdayin)
Set news = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 39 id,url,yl_10in,yl_dayin,yl_in,out,title from detail where verity=1 order by yl_intime desc,id"
news.open SQLT, conn, 1, 1
numrow2 = 0
menunews=menunews&""
strOut = Replace(strOut, "<{{menunews}}>", menunews)
Set dayin = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 55 id,url,yl_dayin,title from detail where verity=1 order by yl_dayin desc,id"
dayin.open SQLT, conn, 1, 1
numrow2 = 0
menudayin=menudayin&""
If dayin.EOF And dayin.BOF Then
menudayin=menudayin&" 暂时没有内容 "
Else
numRows = 0
While (Not dayin.EOF)
menudayin=menudayin&" "&dayin("Title")&""
numRows = numRows + 1
dayin.MoveNext
If (numRows Mod 7 = 0) Then
numrow2 = numrow2 + 1
menudayin=menudayin&""
End If
Wend
End If
dayin.Close
Set dayin = Nothing
menudayin=menudayin&" 申请加入 »"
strOut = Replace(strOut, "<{{menudayin}}>", menudayin)
Set xj = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 55 id,url,title from detail where verity=1 order by id desc,id"
xj.open SQLT, conn, 1, 1
numrow2 = 0
menuxj=menuxj&""
If xj.EOF And xj.BOF Then
menuxj=menuxj&" 暂时没有内容 "
Else
numRows = 0
While (Not xj.EOF)
menuxj=menuxj&" "&xj("Title")&""
numRows = numRows + 1
xj.MoveNext
If (numRows Mod 7 = 0) Then
numrow2 = numrow2 + 1
menuxj=menuxj&""
End If
Wend
End If
xj.Close
Set xj = Nothing
menuxj=menuxj&" 申请加入 »"
strOut = Replace(strOut, "<{{menuxj}}>", menuxj)
Set out = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 39 id,url,title from detail where verity=1 order by yl_outtime desc,id"
out.open SQLT, conn, 1, 1
numrow2 = 0
menuout=menuout&""
menuout=menuout&""
If out.EOF And out.BOF Then
menuout=menuout&" 暂时没有内容 | "
Else
numRows = 0
While (Not out.EOF)
menuout=menuout&" ·"&out("Title")&" | "
numRows = numRows + 1
out.MoveNext
If (numRows Mod 8 = 0) Then
numrow2 = numrow2 + 1
menuout=menuout&""
menuout=menuout&" | "
End If
Wend
End If
out.Close
Set out = Nothing
menuout=menuout&" ·申请加入 » | "
strOut = Replace(strOut, "<{{menuout}}>", menuout)
Set verity = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 55 id,url,title from detail where verity=0 order by id desc,id"
verity.open SQLT, conn, 1, 1
numrow2 = 0
menuverity=menuverity&""
If verity.EOF And verity.BOF Then
menuverity=menuverity&" 暂时没有内容 "
Else
numRows = 0
While (Not verity.EOF)
menuverity=menuverity&" "&verity("Title")&""
numRows = numRows + 1
verity.MoveNext
If (numRows Mod 7 = 0) Then
numrow2 = numrow2 + 1
menuverity=menuverity&""
End If
Wend
End If
verity.Close
Set verity = Nothing
menuverity=menuverity&" 申请加入 »"
strOut = Replace(strOut, "<{{menuverity}}>", menuverity)
Set jingjia = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 30 id,title,url,se from jingjia where time>now() order by topid desc,id"
jingjia.open SQLT, conn, 1, 1
numrow2 = 0
menujingjia=menujingjia&""
If jingjia.EOF And jingjia.BOF Then
menujingjia=menujingjia&" 暂时没有内容 "
Else
numRows = 0
While (Not jingjia.EOF)
If jingjia("se") = 1 Then
menujingjia=menujingjia&" "&jingjia("Title")&""
Else
If jingjia("se") = 2 Then
menujingjia=menujingjia&" "&jingjia("Title")&""
Else
If jingjia("se") = 3 Then
menujingjia=menujingjia&" "&jingjia("Title")&""
Else
If jingjia("se") = 4 Then
menujingjia=menujingjia&" "&jingjia("Title")&""
Else
menujingjia=menujingjia&" "&jingjia("Title")&""
End If
End If
End If
End If
numRows = numRows + 1
jingjia.MoveNext
If (numRows Mod 1 = 0) Then
numrow2 = numrow2 + 1
menujingjia=menujingjia&" "
End If
Wend
End If
jingjia.Close
Set jingjia = Nothing
menujingjia=menujingjia&" 更多推荐 »"
strOut = Replace(strOut, "<{{menujingjia}}>", menujingjia)
zytj = ""
Set ClassCount = Server.CreateObject("Adodb.Recordset")
Sql = "Select * from feilei order by classid"
ClassCount.open Sql, conn, 1, 1
Set Count = Server.CreateObject("Adodb.Recordset")
Sql = "Select * from detail"
Count.open Sql, conn, 1, 1
Set WebCount = Server.CreateObject("Adodb.Recordset")
Sql = "Select * from detail where verity=1"
WebCount.open Sql, conn, 1, 1
Set FCount = Server.CreateObject("Adodb.Recordset")
Sql = "Select * from detail where verity=0"
FCount.open Sql, conn, 1, 1
Set ruanjiansCount = Server.CreateObject("Adodb.Recordset")
Sql = "select * from ruanjian where verity=1"
ruanjiansCount.open Sql, conn, 1, 1
Set jingjiasCount = Server.CreateObject("Adodb.Recordset")
Sql = "select * from jingjia where verity=1"
jingjiasCount.open Sql, conn, 1, 1
Set mingzhansCount = Server.CreateObject("Adodb.Recordset")
Sql = "select * from mingzhan where verity=1"
mingzhansCount.open Sql, conn, 1, 1
Set gongjusCount = Server.CreateObject("Adodb.Recordset")
Sql = "select * from gongju where verity=1"
gongjusCount.open Sql, conn, 1, 1
zytj=zytj&" 分类总数:"&ClassCount.RecordCount&"个 网站总数:"&Count.RecordCount&"个 已审网站:"&WebCount.RecordCount&"个 未审网站:"&FCount.RecordCount&"个 名站导航:"&mingzhansCount.RecordCount&"个 实用工具:"&gongjusCount.RecordCount&"个 竞价推荐:"&jingjiasCount.RecordCount&"个 常用软件:"&ruanjiansCount.RecordCount&"个 "
ClassCount.Close
Set ClassCount = Nothing
Count.Close
Set Count = Nothing
WebCount.Close
Set WebCount = Nothing
FCount.Close
Set FCount = Nothing
ruanjiansCount.Close
Set ruanjiansCount = Nothing
jingjiasCount.Close
Set jingjiasCount = Nothing
mingzhansCount.Close
Set mingzhansCount = Nothing
gongjusCount.Close
Set gongjusCount = Nothing
strOut = Replace(strOut, "<{{zytj}}>", zytj)
Set feilei = Server.CreateObject("Adodb.Recordset")
Sql = "select top 72 classid,se,classname,pinyin from feilei where show=1"
feilei.open Sql, conn, 1, 1
menulist=menulist&""
If (numrow2 Mod 2 = 0) Then
End If
If feilei.EOF And feilei.BOF Then
menulist=menulist&"- 暂时没有栏目
"
Else
numRows = 0
While (Not feilei.EOF)
If feilei("se") = 1 Then
menulist=menulist&""&feilei("classname")&""
Else
If feilei("se") = 2 Then
menulist=menulist&""&feilei("classname")&""
Else
menulist=menulist&""&feilei("classname")&""
End If
End If
feilei.MoveNext
numRows = numRows + 1
If (numRows Mod 9 = 0) Then
numrow2 = numrow2 + 1
If (numrow2 Mod 2 = 0) Then
End If
End If
Wend
End If
feilei.Close
Set feilei = Nothing
menulist=menulist&""
strOut = Replace(strOut, "<{{menulist}}>", menulist)
Set rsDe = Server.CreateObject("Adodb.Recordset")
Sql = "select top 150 classid,classname,pinyin from feilei where ku=1 order by top desc,classid"
rsDe.open Sql, conn, 1, 1
menuku=menuku&""
If rsDe.EOF And rsDe.BOF Then
menuku=menuku&"暂时没有栏目 "
Else
numrow2 = 0
While (Not rsDe.EOF)
menuku=menuku&""
menuku=menuku&"["&rsDe("classname")&"]"
If (numrow2 Mod 2 = 0) Then
Else
End If
Set rsDe1 = Server.CreateObject("Adodb.Recordset")
SQLC = "select * from detail where Classid =" & rsDe("Classid") & " and verity=1 order by yl_dayin desc,id"
rsDe1.open SQLC, conn, 1, 1
If rsDe1.EOF And rsDe1.BOF Then
menuku=menuku&" 暂时没有网址"
If (numrow2 Mod 2 = 0) Then
Else
End If
Else
numRows3 = 0
While (numRows3 <> 6 And Not rsDe1.EOF)
menuku=menuku&""
If rsDe1("yl_dayin") > 9 Then
menuku = menuku & ""
End If
If rsDe1("yl_dayin") > 29 Then
menuku = menuku & ""
End If
menuku = menuku & "" & rsDe1("title") & ""
If rsDe1("yl_dayin") > 9 Then
menuku = menuku & ""
End If
menuku = menuku & ""
numRows3 = numRows3 + 1
rsDe1.MoveNext
Wend
If (numrow2 Mod 2 = 0) Then
Else
End If
menuku=menuku&"更多 »"
End If
rsDe1.Close
Set rsDe1 = Nothing
'-------------------------------------
rsDe.MoveNext
numrow2 = numrow2 + 1
Wend
End If
rsDe.Close
Set rsDe = Nothing
menuku=menuku&""
strOut = Replace(strOut, "<{{menuku}}>", menuku)
Set ruanjian = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 15 id,title,url,logo from ruanjian where verity=1 order by topid desc,id"
ruanjian.open SQLT, conn, 1, 1
numrow2 = 0
menuruanjian=menuruanjian&""
If ruanjian.EOF And ruanjian.BOF Then
menuruanjian=menuruanjian&" 暂时没有内容 "
Else
numRows = 0
While (Not ruanjian.EOF)
menuruanjian=menuruanjian&" "&ruanjian("title")&""
ruanjian.MoveNext
numRows = numRows + 1
If (numRows Mod 5 = 0) Then
menuruanjian=menuruanjian&""
End If
Wend
End If
ruanjian.Close
Set ruanjian = Nothing
menuruanjian=menuruanjian&" 更多软件 »"
strOut = Replace(strOut, "<{{menuruanjian}}>", menuruanjian)
Set link = Server.CreateObject("Adodb.Recordset")
SQLT = "select top 20 id,title,url,se from links where weizhi=0 and time>now() order by top desc,id"
link.open SQLT, conn, 1, 1
numrow2 = 0
If link.EOF And link.BOF Then
zzlink=zzlink&"暂时没有内容"
Else
numRows = 0
While (Not link.EOF)
If link("se") = 1 Then
zzlink=zzlink&""&link("Title")&""
Else
If link("se") = 2 Then
zzlink=zzlink&""&link("Title")&""
Else
zzlink=zzlink&""&link("Title")&""
End If
End If
numRows = numRows + 1
link.MoveNext
If (numRows Mod 8 = 0) Then
numrow2 = numrow2 + 1
End If
Wend
End If
link.Close
Set link = Nothing
zzlink=zzlink&""
strOut = Replace(strOut, "<{{zzlink}}>", zzlink)
Copyright=Copyright&Powered
strOut = Replace(strOut, "<{{sysj}}>", sysj)
strOut = Replace(strOut, "<{{site}}>", site)
strOut = Replace(strOut, "<{{siteurl}}>", siteurl)
strOut = Replace(strOut, "<{{email}}>", email)
strOut = Replace(strOut, "<{{Copyright}}>", Copyright)
strOut = Replace(strOut, "<{{icp}}>", icp)
strOut = Replace(strOut, "<{{qq}}>", qq)
strOut = Replace(strOut, "<{{baidu}}>", baidu)
strOut = Replace(strOut, "<{{ads01}}>", ads01)
strOut = Replace(strOut, "<{{ads02}}>", ads02)
strOut = Replace(strOut, "<{{ads03}}>", ads03)
strOut = Replace(strOut, "<{{ads04}}>", ads04)
strOut = Replace(strOut, "<{{ads05}}>", ads05)
strOut = Replace(strOut, "<{{ads06}}>", ads06)
strOut = Replace(strOut, "<{{ads07}}>", ads07)
strOut = Replace(strOut, "<{{ads08}}>", ads08)
strOut = Replace(strOut, "<{{ads09}}>", ads09)
strOut = Replace(strOut, "<{{ads10}}>", ads10)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath(""&html&""),true)
f.WriteLine strOut
f.Close
Response.Write "生成"&name&"成功 "
Set f = Nothing
Set fso = Nothing
links = ""
Set linksCount = Server.CreateObject("Adodb.Recordset")
Sql = "select * from detail where verity=1 and links>0"
linksCount.open Sql, conn, 1, 1
links=links&"共有["&linksCount.RecordCount&"]个友情连接"
linksCount.Close
Set linksCount = Nothing
strOut = Replace(strOut, "<{{tj}}>", links)
strOut = ""
strOut = Now()
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile(Server.MapPath("sj.txt"), True)
f.WriteLine strOut
f.Close
Response.Write "记录当前操作时间成功 "
Set f = Nothing
Set fso = Nothing
End If
%>
|