www.gusucode.com > 黑鹰自助链管理系统 1.1 商业版码程序 > sysc.asp

    <!--#include file="mdb.asp"-->
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from title",conn,1,3
site=rs("site")
siteurl=rs("siteurl")
email=rs("email")
Powered=rs("Powered")
Copyright=rs("Copyright")
keywords=rs("keywords")
description=rs("description")
tjdm=rs("tjdm")
icp=rs("icp")
qq=rs("qq")
ku=rs("ku")
toubu=rs("toubu")
ads01=rs("ads01")
ads02=rs("ads02")
ads03=rs("ads03")
ads04=rs("ads04")
ads05=rs("ads05")
ads06=rs("ads06")
ads07=rs("ads07")
ads08=rs("ads08")
ads09=rs("ads09")
ads10=rs("ads10")
rs.close
set rs=Nothing
%>
<html>
<head>
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="admin/css.css" TYPE="text/css">
</head>
<body>
<p> </p>
<table width="55%" border="0" cellspacing="1" cellpadding="8" align="center" bgcolor="#999999">
<tr>
<td bgcolor="#eeeeee" align="center">生成首页页面</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<br>
<% 
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 "<li>读取最后生成时间成功"&line&"<br>"
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 "<li>与最后更新时间相差 <b>"&xcfz&"</b> 分钟<br>"
'Response.end

if (xs>=6 and xs<18) then	
scpl=3 '白天 3
else
scpl=5 '晚上 5
end if
response.write "<li>生成频率 <b>"&scpl&"</b> 分钟<br>"

if xcfz<scpl then
'if (fz mod scpl) then
response.write "<li>不生成"  '不生成
else
'生成
response.write "<li>生成" 
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 10 id,title,url,se from hymm_ads where weizhi=0 and time>now() order by top desc,id"
ads.open SQLT,conn,1,1
numrow2=0
menuads=menuads&"<table width=970 border=0 align=center>"
menuads=menuads&"<tr><td height=20 width=60><b>特别推荐:</b></td><td height=20>"

if ads.EOF and ads.BOF then
menuads=menuads&"<td height=20 align=center>暂时没有内容</td>"
else
numRows=0
While (Not ads.EOF)
if ads("se")=1 then
menuads=menuads&" <img src=/images/01.gif> <a href="&ads("url")&" target=_blank><font color='#0000ff'>"&ads("Title")&"</font></a>"
else
if ads("se")=2 then
menuads=menuads&" <img src=/images/01.gif> <a href="&ads("url")&" target=_blank><font color='#ff0000'>"&ads("Title")&"</font></a>"
else
menuads=menuads&" <img src=/images/01.gif> <a href="&ads("url")&" target=_blank>"&ads("Title")&"</a>"
end if
end if
numRows=numRows+1
ads.MoveNext
if (numRows mod 10 =0) Then
numrow2=numrow2+1
menuads=menuads&"</td></tr>"
end if
Wend
end if
ads.close
Set ads = Nothing
menuads=menuads&"</table>"
strOut=Replace(strOut,"<{{menuads}}>",menuads)


toubu=toubu
Set top=Server.CreateObject("Adodb.Recordset")
SqlT="select top 20 id,title,url from detail where classid=68 and verity=1 order by topid desc"
top.open SQLT,conn,1,1
numrow2=0
menutop=menutop&"<table width=97% border=0 align=center cellpadding=0 cellspacing=0>"
menutop=menutop&"<tr"
if (numrow2 mod 2=0) then
menutop=menutop&""
end if
menutop=menutop&">"

if top.EOF and top.BOF then
menutop=menutop&"<tr><td height=50 align=center>&nbsp;暂时没有内容</td></tr>"
else
numRows=0
While (Not top.EOF)
menutop=menutop&"<td height=20 align=center background=images/bj2.jpg><a href="&top("url")&" target=_blank class=blue>"&top("Title")&"</a></td>"
numRows=numRows+1
top.MoveNext
if (numRows mod 4 =0) Then
numrow2=numrow2+1
menutop=menutop&"</tr><tr"
if (numrow2 mod 2=0) then
menutop=menutop&""
end if
menutop=menutop&">"
end if
Wend
end if
top.close 
Set top = Nothing
menutop=menutop&"</tr></table>"
strOut=Replace(strOut,"<{{menutop}}>",menutop)

Set Tool=Server.CreateObject("Adodb.Recordset")
SqlT="select top 30 id,title from detail where classid=63 and verity=1 order by topid desc"
Tool.open SQLT,conn,1,1
numrow2=0
menutool=menutool&"<table width=100% cellpadding=0 cellspacing=0>"
if Tool.EOF and Tool.BOF then
menutool=menutool&"<tr><td height=50 align=center>&nbsp;暂时没有内容</td></tr>"
else
numRows=0
menutool=menutool&"<tr>"
While (Not Tool.EOF)
menutool=menutool&"<td width=50% height=22 align=center><img src='/images/01.gif' border=0 align=absMiddle>&nbsp; <a href=showurl.asp?id="&Tool("id")&" target=_blank>"&Tool("Title")&"</a></td>"
Tool.MoveNext
numRows=numRows+1
if (numRows mod 2 =0) Then
menutool=menutool&"</tr><tr>"
end if
Wend
end if
Tool.close 
Set Tool = Nothing
menutool=menutool&"</table>"
strOut=Replace(strOut,"<{{menutool}}>",menutool)

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

zytj=zytj&"&nbsp;&nbsp;<img src=logo/01.gif> 分类:<font color=#ff0000>"&ClassCount.RecordCount&"</font>个&nbsp;&nbsp;<img src=logo/01.gif> 总数:<font color=#ff0000>"&Count.RecordCount&"</font>个<BR>&nbsp;&nbsp;<img src=logo/01.gif> 已审:<font color=#FF0000>"&WebCount.RecordCount&"</font>个&nbsp;&nbsp;<img src=logo/01.gif> 未审:<font color=#FF0000>"&FCount.RecordCount&"</font>个"
ClassCount.close 
Set ClassCount = Nothing
Count.close 
Set Count = Nothing
WebCount.close 
Set WebCount = Nothing
FCount.close 
Set FCount = Nothing
strOut=Replace(strOut,"<{{zytj}}>",zytj)

Set feilei=Server.CreateObject("Adodb.Recordset")
Sql= "select top 72 classid,classname from feilei where show=1"
feilei.open Sql,conn,1,1
menulist=menulist&"<table width=100% bgcolor=#F7F7F7 BORDER=0 CELLPADDING=0 CELLSPACING=0>"
menulist=menulist&"<tr"
if (numrow2 mod 2=0) then
menulist=menulist&" bgcolor=#F1FAFE"
end if
menulist=menulist&">"
if feilei.Eof and feilei.Bof then
menulist=menulist&"<tr><td height=25 align=middle>暂时没有栏目</td></tr>"
else
numRows = 0
While (Not feilei.Eof)
menulist=menulist&"<td height=25 align=center><a href=html/hymm_url0"&feilei("classid")&".htm target=_blank>"&feilei("classname")&"</A></td>"
feilei.MoveNext
numRows = numRows + 1
if (numRows mod 3 =0) Then
numrow2=numrow2+1

menulist=menulist&"</tr><tR"
if (numrow2 mod 2=0) then
menulist=menulist&" bgcolor=#F1FAFE"
end if
menulist=menulist&">"

end if
Wend
end if
feilei.Close
Set feilei=Nothing
menulist=menulist&"</table>"
strOut=Replace(strOut,"<{{menulist}}>",menulist)

Set rsDe=Server.CreateObject("Adodb.Recordset")
Sql= "select top 70 classid,classname from feilei where ku=1"
rsDe.open Sql,conn,1,1
menuku=menuku&"<table width=100% align=center cellpadding=0 cellspacing=0>"
if rsDe.EOF and rsDe.BOF then
menuku=menuku&"<tr><td height=25 align=middle>暂时没有栏目</td></tr>"
else
numrow2=0
While (Not rsDe.EOF)
menuku=menuku&"<tr height=25"
if (numrow2 mod 2=0) then
menuku=menuku&" bgcolor=#eeeeee"
else
menuku=menuku&" bgcolor=#f2f9fe"
end if
menuku=menuku&">"
menuku=menuku&"<td align=middle width=60 align=middle><a href=html/hymm_url0"&rsDe("classid")&".htm target=_blank><FONT color=#ff8833>"&rsDe("classname")&"</FONT></A></td>"
menuku=menuku&"<td " 
if (numrow2 mod 2=0) then
menuku=menuku&" bgcolor=#f7fbff"
else
menuku=menuku&" bgcolor=#FFFFFF"
end if
menuku=menuku&">"
Set rsDe1=Server.CreateObject("Adodb.Recordset")
SqlC="select * from detail where Classid ="&rsDe("Classid")&" and verity=1 order by topid desc,id"
rsDe1.open SQLC,conn,1,1	
if rsDe1.Eof and rsDe1.Bof then
menuku=menuku&"&nbsp;暂时没有网址</td>"
menuku=menuku&"<td "
if (numrow2 mod 2=0) then
menuku=menuku&"bgcolor=#f7fbff"
else
menuku=menuku&"bgcolor=#FFFFFF"
end if
menuku=menuku&">&nbsp;</td>"
else
menuku=menuku&"<table width=100% border=0 align=center>"
menuku=menuku&"<tr>"
numRows3=0
While (numRows3<>6 and Not rsDe1.Eof)
menuku=menuku&"<td width=16.6%/>&nbsp;<a href=showurl.asp?id="&rsDe1("id")&" title=当天来路:"&rsDe1("yl_dayin")&"次|历史来路:"&rsDe1("yl_in")&"次|历史去路:"&rsDe1("out")&"次 target=_blank>"
if rsDe1("yl_dayin")>9 then
menuku = menuku &"<font color=#0000FF>"
end if
if rsDe1("yl_dayin")>29 then
menuku = menuku &"</font><font color=#FF0000><b>"
end if
menuku = menuku &""&left(rsDe1("title"),7)&""
if rsDe1("yl_dayin")>9 then
menuku = menuku &"</b></font>"
end if
menuku = menuku &"</a></td>"
numRows3=numRows3+1
rsDe1.MoveNext
Wend
menuku=menuku&"</table>"
menuku=menuku&"</td>"
menuku=menuku&"<td width=40 align=middle"
if (numrow2 mod 2=0) then
menuku=menuku&" bgcolor=#f7fbff"
else
menuku=menuku&" bgcolor=#FFFFFF"
end if
menuku=menuku&"><a href=html/hymm_url0"&rsDe("classid")&".htm target=_blank>更多..</a></td></tr>"
end if
rsDe1.Close
Set rsDe1=Nothing
rsDe.MoveNext
numrow2=numrow2+1
Wend
end if
rsDe.close 
Set rsDe = Nothing
menuku=menuku&"</table>"
strOut=Replace(strOut,"<{{menuku}}>",menuku)

set rsDe=server.createobject("adodb.recordset")
sql= "select * from detail Where verity=1 and links>0 order by yl_intime desc" 
rsDe.open sql,conn,1,1
links=links&"<table border=0 cellpadding=0 cellspacing=0 width=100% height=4 bgcolor=#f5f5f5>"
n=1 
While Not rsDe.Eof and n<53
links = links &"<td height=18>&nbsp;<a href="&rsDe("url")&" target='_blank'>"&rsDe("title")&"</a></td>"
if n mod 12 =0 then
links = links &"</Tr>"  
end if     
rsDe.MoveNext
n=n+1
Wend
rsDe.close
set rsDe=nothing
links=links&"</table>"
strOut=Replace(strOut,"<{{links}}>",links)

Copyright=Copyright&Powered
strOut=Replace(strOut,"<{{sysj}}>",sysj)
strOut=Replace(strOut,"<{{toubu}}>",toubu)
strOut=Replace(strOut,"<{{site}}>",site) 
strOut=Replace(strOut,"<{{siteurl}}>",siteurl)
strOut=Replace(strOut,"<{{email}}>",email)
strOut=replace(strOut,"<{{tjdm}}>",tjdm)
strOut=replace(strOut,"<{{description}}>",description)
strOut=Replace(strOut,"<{{keywords}}>",keywords)
strOut=Replace(strOut,"<{{Copyright}}>",Copyright)
strOut=Replace(strOut,"<{{icp}}>",icp)
strOut=Replace(strOut,"<{{qq}}>",qq)
strOut=Replace(strOut,"<{{menuads}}>",menuads)
strOut=Replace(strOut,"<{{toubu}}>",toubu)
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 "<li>生成"&name&"成功</A><br>"
set f=Nothing
set fso=Nothing

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 "<li>记录当前操作时间成功<br>"
set f=Nothing
set fso=Nothing	
end if
%>
<br></td>
</tr>
</table>
</body>
</html>