📄 crclass_bak.asp
字号:
<%
Sub CrBgClass(BBigID)
Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
Set rs=Server.CreateObject("adodb.recordset")
BBigID=BBigID
sql="Select * from newsClass where ID="&BBigID
rs.open sql,conn,1,1
ClassEN=rs("classen")
set rst=Server.CreateObject("adodb.recordset")
if rs("ClassTemplet")="×" then
sqlt="Select TempletContent from Templet Where TempletType='BigClass'"
else
if rs("child")<>0 then
sqlt="Select * from Templet Where TempletName='"&rs("ClassTemplet")&"' and TempletType='BigClass'"
else
sqlt="Select TempletContent from Templet Where TempletType='BigClass'"
end if
end if
rst.open sqlt,conn,1,1
bigclasscn=rs("classcn")
set rsmall=Server.CreateObject("adodb.recordset")
if rs("child")<>0 then
sql="select * from newsclass where ParentID="&rs("id")
else
sql="select * from newsclass where id="&rs("id")
end if
rsmall.open sql,conn,1,1
while not rsmall.eof
childtemp=getchild(rsmall("id"))
set rstc=Server.CreateObject("ADODB.RECORDSET")
if rs("child")<>0 then
sql="Select * from news Where ClassCN in ("&childtemp&") order by Newsid Desc"
else
sql="Select * from news Where ClassCN='"&rsmall("ClassCN")&"' order by Newsid Desc"
end if
rstc.open sql,conn,1,1
'如果你要修改小类标题栏,请修改<td bgcolor=F3F3F3>中颜色代码
bl=bl&"<table width='99%' cellpadding='2'><tr><td bgcolor=F3F3F3><font color=red><b>"&rsmall("classcn")&"</b></font></td></tr></table>"
for x=1 to rs("iiNews")
'开始生成文件
if rstc.eof then exit for
if rs("Tdate")=2 then
if rstc("BiaotiNews")=true then
bl=bl&""&rs("NewsTitle")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><br>"
else
bl=bl&""&rs("NewsTitle")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(rstc("title"))&"</a><br>"
end if
end if
if rs("Tdate")=1 then
if rs("GDate")=2 then
if rstc("BiaotiNews")=true then
bl=bl&""&rs("NewsTitle")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Tcolor")&" size="&rs("Tsize")&">["&Month(rstc("date"))&"/"&Day(rstc("date"))&"]</font><br>"
else
bl=bl&""&rs("NewsTitle")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Tcolor")&" size="&rs("Tsize")&">["&Month(rstc("date"))&"/"&Day(rstc("date"))&"]</font><br>"
end if
end if
if rs("Gdate")=1 then
if rstc("BiaotiNews")=true then
bl=bl&""&rs("NewsTitle")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Tcolor")&" size="&rs("Tsize")&">["&(rstc("date"))&"]</font><br>"
else
bl=bl&""&rs("NewsTitle")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Tcolor")&" size="&rs("Tsize")&">["&(rstc("date"))&"]</font><br>"
end if
end if
end if
rstc.movenext
next
if rs("child")<>0 then
bl=bl&"<div align=right><a href=http://"&sowinpath&"ClassHtml/"&rsmall("ClassEN")&".html>更多</a>... </div>"
else
bl=bl&"<div align=right><a href=http://"&sowinpath&"ClassHtml/"&rsmall("ClassEN")&"01.html>更多</a>... </div>"
end if
rsmall.movenext
Wend
''########读取本类top
Set rstop=Server.CreateObject("adodb.recordset")
sqltop="select * from News where Classcn in ("&childtemp&") order by click desc"
rstop.open sqltop,conn,1,1
if rstop.eof then
blst="·本类还没有TOP新闻"
else
do while not rstop.eof
h=h+1
if rstop("BiaotiNews")=true then
blst=blst&"·<a href="&rstop("UBiaotiNews")&" target=_blank>"&rstop("title")&"</a><br>"
else
blst=blst&"·<a href=http://"&sowinpath&rstop("lpath")&rstop("FileName")&".html target=_blank>"&rstop("title")&"</a><br>"
end if
if h>=rs("TopNum") then exit do
rstop.movenext
loop
h=0
end if
rstop.close
''########读取本类推荐TOP10
Set rstr=Server.CreateObject("adodb.recordset")
sqltr="select * from News where Classcn in ("&childtemp&") and Recommend=true order by Newsid desc"
rstr.open sqltr,conn,1,1
if rstr.eof then
blsr="·本类还没有推荐新闻"
else
do while not rstr.eof
h=h+1
if rstr("BiaotiNews")=true then
blsr=blsr&"·<a href="&rstr("UBiaotiNews")&" target=_blank>"&rstr("title")&"</a><br>"
else
blsr=blsr&"·<a href=http://"&sowinpath&rstr("lpath")&rstr("FileName")&".html target=_blank>"&rstr("title")&"</a><br>"
end if
if h>=10 then exit do
rstr.movenext
loop
h=0
end if
rstr.close
''########读取本类最新新闻
set rs3=Server.CreateObject("adodb.recordset")
sql3="Select * from Config"
rs3.open sql3,conn,1,1
Set rstl=Server.CreateObject("adodb.recordset")
sqltl="select * from News where Classcn in ("&childtemp&") order by Date desc"
rstl.open sqltl,conn,1,1
if rstl.eof then
blsl="·本类还没有最新新闻"
else
do while not rstl.eof
h=h+1
if rstl("BiaotiNews")=true then
blsl=blsl&"·<a href="&rstl("UBiaotiNews")&" target=_blank>"&rstl("title")&"</a><br>"
else
blsl=blsl&"·<a href=http://"&sowinpath&rstl("lpath")&rstl("FileName")&".html target=_blank>"&rstl("title")&"</a><br>"
end if
if h>=rs3("LastNews") then exit do
rstl.movenext
loop
h=0
end if
rstl.close
''########读取本类最新图片新闻
Set rscc=Server.CreateObject("adodb.recordset")
sqlcc="select Top 5 * from News where Classcn in ("&childtemp&") and PicNews=true order by Newsid desc"
rscc.open sqlcc,conn,1,1
if not rscc.eof then
blc=blc&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr>"
h=0
while not rscc.eof
if rscc("BiaotiNews")=true then
blc=blc&"<td valign=top><div align=center><table width=100 height=75 border=0 cellpadding=0 cellspacing=1 bgcolor=#000000><tr><td height=3 bgcolor=#FFFFFF><a href="&rscc("UBiaotiNews")&" target=_blank><img src="&rscc("PicNewsa")&" height=75 width=100 border=0></img></a></td></tr></table><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=4></td></tr></table><span class=b>"&rscc("title")&"</span></td>"
else
blc=blc&"<td valign=top><div align=center><table width=100 height=75 border=0 cellpadding=0 cellspacing=1 bgcolor=#000000><tr><td height=3 bgcolor=#FFFFFF><a href=http://"&sowinpath&rscc("lpath")&rscc("FileName")&".html target=_blank><img src="&rscc("PicNewsa")&" height=75 width=100 border=0></img></a></td></tr></table><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=4></td></tr></table><span class=b>"&rscc("title")&"</span></td>"
end if
rscc.movenext
h=h+1
if h mod 5 = 0 then
blc=blc&"</tr>"
end if
wend
blc=blc&"</table>"
else
blc=blc&"尚无图片新闻"
end if
rscc.close
'########替换代码,并生成HTML文件
if rst.eof and rst.bof then
else
strNavigate=GetDaohang(rs("ID"))
bigfso=rst("TempletContent")
bigfso=replace(bigfso,"[bignewsjs]",bl)
bigfso=replace(bigfso,"[CoPic]",blc)
bigfso=replace(bigfso,"[BLastNews]",blsl)
bigfso=replace(bigfso,"[BTopNews]",blst)
bigfso=replace(bigfso,"[Brecommend]",blsr)
bigfso=replace(bigfso,"[Navigation]",strNavigate)
bigfso=replace(bigfso,"[Btitle]",""&ClasscN&"")
bigfso=replace(bigfso,"[newssearch]","<script src=http://"&sowinpath&"js/search.js></script>")
bigfso=replace(bigfso,"[recommendnews]","<script src=http://"&sowinpath&"CodeJS/Tj_News.js></script>")
bigfso=replace(bigfso,"[hotnews]","<script src=http://"&sowinpath&"CodeJS/Hots_News.js></script>")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(Server.MapPath("..")&"\ClassHtml\"&ClassEN&".html")
fout.Write bigfso
fout.close
end if
set rs=nothing
set rst=nothing
set rsbig=nothing
End Sub
Sub CrSmClass(SmallID)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -