📄 crclassp.asp
字号:
set rs1=Server.CreateObject("adodb.recordset")
sql1="Select * from newsClass Where id="&smallID
rs1.open sql1,conn,1,1
set rs=Server.CreateObject("ADODB.RECORDSET")
sql="Select * from News Where ClassCN='"&rs1("ClassCN")&"' and PicNews=true order by "&rs1("OrderRule")&" Desc"
rs.open sql,conn,1,1
set rs3=Server.CreateObject("adodb.recordset")
if rs1("ClassTemplet")="×" then
sql3="Select TempletContent from Templet Where TempletType='Classp'"
else
sql3="Select * from Templet Where TempletName='"&rs1("ClassTemplet")&"' and TempletType='Classp'"
end if
rs3.open sql3,conn,1,1
AllPage=rs.recordcount/rs1("HtmlJSCount")
AllPage1=int(rs.recordcount/rs1("HtmlJSCount"))
if AllPage1<Allpage then AllPage=AllPage1+1
for i=1 to AllPage
set rscon=Server.CreateObject("adodb.recordset")
sqlcon="Select ShowPic from Config"
rscon.open sqlcon,conn,1,1
ShowPic1=rscon("ShowPic")
rscon.close
set rscon=nothing
sl="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=6></td></tr></table>"
sl=sl&"<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td> <font color=red><b>"&rs1("classcn")&"</b></font></td></tr></table>"
sl=sl&"<table width=100% border=0 cellspacing=0 cellpadding=0 background=""../../pic/bg_line1.gif""><tr><td height=6></td></tr></table>"
sl=sl&"<table width=100% border=0 cellspacing=0 cellpadding=4><tr>"
t=0
for x=1 to rs1("HtmlJSCount")
if rs.eof then exit for
ShowPic=""
if instr(1,rs("content"),"<img",1)<>0 then ShowPic=ShowPic1
if rs1("TitleDate") then
if rs1("GDate")=2 then
if rs("BiaotiNews")=true then
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href="&rs("UBiaotiNews")&" target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<font color="&rs1("DateColor")&" size="&rs1("DateSize")&">"&Month(rs("date"))&"/"&Day(rs("date"))&"</font></td>"
else
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href=http://"&sowinpath&rs("lpath")&rs("FileName")&".html target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<font color="&rs1("DateColor")&" size="&rs1("DateSize")&">"&Month(rs("date"))&"/"&Day(rs("date"))&"</font></td>"
end if
end if
if rs1("GDate")=1 then
if rs("BiaotiNews")=true then
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href="&rs("UBiaotiNews")&" target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<font color="&rs1("DateColor")&" size="&rs1("DateSize")&">"&rs("date")&"</font></td>"
else
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href=http://"&sowinpath&rs("lpath")&rs("FileName")&".html target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<font color="&rs1("DateColor")&" size="&rs1("DateSize")&">"&rs("date")&"</font></td>"
end if
end if
else
if rs("BiaotiNews")=true then
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href="&rs("UBiaotiNews")&" target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"</td>"
else
sl=sl&"<td valign='top'><img src="&rs("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs1("TitlePic")&"<a href=http://"&sowinpath&rs("lpath")&rs("FileName")&".html target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"</td>"
end if
end if
rs.movenext
t=t+1
if t mod 4 = 0 then
sl=sl&"</tr>"
end if
next
sl=sl&"</table>"
slp="<div align=center>共<font color=red><b>"&rs.recordcount&"</b></font>条新闻 <a href=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"01.html>首页</a> "
if i<>AllPage then
slp=slp&"<a href=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"0"&i+1&".html>下一页</a> "
else
slp=slp&"下一页 "
end if
if i<>1 then
slp=slp&"<a href=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"0"&i-1&".html>上一页</a> "
else
slp=slp&"上一页 "
end if
slp=slp&"<a href=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"0"&AllPage&".html>尾页</a> 页次:<font color=red><b>"&i&"</b></font>/<b>"&AllPage&"</b> <font color=red><b>"&rs1("HtmlJSCount")&"</b></font>条新闻/页 转到:"
slp=slp&"<select onchange=if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}>"
for x=1 to AllPage
if x=i then
slp=slp&"<option value=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"0"&x&".html selected>第"&x&"页</option>"
else
slp=slp&"<option value=http://"&sowinpath&"Photo/"&rs1("ClassEN")&"/"&rs1("ClassEN")&"0"&x&".html>第"&x&"页</option>"
end if
next
slp=slp&"</select></div>"
''########读取本类top
Set rstop=Server.CreateObject("adodb.recordset")
sqltop="select * from News where Classcn='"&rs1("classcn")&"' and PicNews=true order by click desc"
rstop.open sqltop,conn,1,1
if rstop.eof then
blst="·本类还没有TOP新闻"
else
slst="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=6></td></tr></table>"
do while not rstop.eof
h=h+1
if rstop("BiaotiNews")=true then
slst=slst&""&rsnc("HNTitle1")&"<a href="&rstop("UBiaotiNews")&" target=_blank>"&rstop("title")&"</a><br>"
else
slst=slst&""&rsnc("HNTitle1")&"<a href=http://"&sowinpath&rstop("lpath")&rstop("FileName")&".html target=_blank>"&rstop("title")&"</a><br>"
end if
if h>=rs1("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='"&rs1("classcn")&"' and Recommend=true and PicNews=true order by newsid desc"
rstr.open sqltr,conn,1,1
if rstr.eof then
slsr="·本类还没有推荐新闻"
else
slsr="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=6></td></tr></table>"
do while not rstr.eof
h=h+1
if rstr("BiaotiNews")=true then
slsr=slsr&""&rsnc("RNTitle1")&"<a href="&rstr("UBiaotiNews")&" target=_blank>"&rstr("title")&"</a><br>"
else
slsr=slsr&""&rsnc("RNTitle1")&"<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 rstl=Server.CreateObject("adodb.recordset")
sqltl="select * from News where Classcn='"&rs1("classcn")&"' and PicNews=true order by Date desc"
rstl.open sqltl,conn,1,1
if rstl.eof then
slsl="·本类还没有最新新闻"
else
slsl="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=6></td></tr></table>"
do while not rstl.eof
h=h+1
if rstl("BiaotiNews")=true then
slsl=slsl&""&rsnc("LNTitle1")&"<a href="&rstl("UBiaotiNews")&" target=_blank>"&rstl("title")&"</a><br>"
else
slsl=slsl&""&rsnc("LNTitle1")&"<a href=http://"&sowinpath&rstl("lpath")&rstl("FileName")&".html target=_blank>"&rstl("title")&"</a><br>"
end if
if h>=10 then exit do
rstl.movenext
loop
h=0
end if
rstl.close
if rs3.eof and rs3.bof then
else
strNavigate=GetDaohang(rs1("ID"))
sfso=rs3("TempletContent")
sfso=replace(sfso,"[hotnews]","<script src=http://"&sowinpath&"CodeJS/Hots_News.js></script>")
sfso=replace(sfso,"[recommendnews]","<script src=http://"&sowinpath&"CodeJS/Tj_News.js></script>")
sfso=replace(sfso,"[newssearch]","<script src=http://"&sowinpath&"JS/search.js></script>")
sfso=replace(sfso,"[newsJS]",sl)
sfso=replace(sfso,"[sTopNews]",slst)
sfso=replace(sfso,"[srecommend]",slsr)
sfso=replace(sfso,"[sLastNews]",slsl)
sfso=replace(sfso,"[Navigation]",strNavigate)
sfso=replace(sfso,"[stitle]",""&rs1("Classcn")&"")
sfso=replace(sfso,"[PageNum]",slp)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Server.MapPath("..")&"\Photo\"&rs1("Classen"))=false then Fso.CreateFolder(Server.MapPath("..")&"\Photo\"&rs1("Classen"))
Set fout = fso.CreateTextFile(Server.MapPath("..")&"\Photo\"&rs1("ClassEN")&"\"&rs1("ClassEN")&"0"&i&".html")
fout.Writeline("<!--Published Date:"&Now&" Powered by www.Foosun.net-->")
fout.Write sfso
fout.close
end if
next
rs.close
set rs=nothing
rs1.close
set rs1=nothing
rs3.close
set rs3=nothing
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -