⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crclass_bak.asp

📁 新闻发布系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
    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")&"' 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='Class'"
    else
      sql3="Select * from Templet Where TempletName='"&rs1("ClassTemplet")&"' and TempletType='Class'"
    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
	  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&""&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><br>"
			  else
		      sl=sl&""&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><br>"
		      end if
		   end if
		   if rs1("GDate")=1 then
		      if rs("BiaotiNews")=true then
			  sl=sl&""&rs1("TitlePic")&"<a href="&rs("UBiaotiNews")&" target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<font color="&rs1("DateColor")&" size="&rs1("DateSize")&">"&rs("date")&"</font><br>"
			  else
		      sl=sl&""&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><br>"
		      end if
		   end if
        else
		   if rs("BiaotiNews")=true then
		   sl=sl&""&rs1("TitlePic")&"<a href="&rs("UBiaotiNews")&" target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<br>"
		   else
           sl=sl&""&rs1("TitlePic")&"<a href=http://"&sowinpath&rs("lpath")&rs("FileName")&".html target=_blank>"&CovtTitle(rs("title"))&"</a>"&ShowPic&"<br>"
           end if
		end if
        rs.movenext
      next
      slp=slp&"<div align=center>共<font color=red><b>"&rs.recordcount&"</b></font>条新闻&nbsp;&nbsp;<a href=http://"&sowinpath&"ClassHtml/"&rs1("ClassEN")&"01.html>首页</a>&nbsp;&nbsp;"
      if i<>AllPage then
        slp=slp&"<a href=http://"&sowinpath&"ClassHtml/"&rs1("ClassEN")&"0"&i+1&".html>下一页</a>&nbsp;&nbsp;"
      else
        slp=slp&"下一页&nbsp;&nbsp;"
      end if
      if i<>1 then
        slp=slp&"<a href=http://"&sowinpath&"ClassHtml/"&rs1("ClassEN")&"0"&i-1&".html>上一页</a>&nbsp;&nbsp;"
      else
        slp=slp&"上一页&nbsp;&nbsp;"
      end if
      slp=slp&"<a href=http://"&sowinpath&"ClassHtml/"&rs1("ClassEN")&"0"&AllPage&".html>尾页</a>&nbsp;&nbsp;页次:<font color=red><b>"&i&"</b></font>/<b>"&AllPage&"</b>&nbsp;&nbsp;<font color=red><b>"&rs1("HtmlJSCount")&"</b></font>条新闻/页&nbsp;&nbsp;转到:"
      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&"ClassHtml/"&rs1("ClassEN")&"0"&x&".html selected>第"&x&"页</option>"
        else
          slp=slp&"<option value=http://"&sowinpath&"ClassHtml/"&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")&"' 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
	slst=slst&"·<a href="&rstop("UBiaotiNews")&" target=_blank>"&rstop("title")&"</a><br>"
	else
    slst=slst&"·<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 order by newsid desc"
    rstr.open sqltr,conn,1,1
    if rstr.eof then
    slsr="·本类还没有推荐新闻"
    else
    do while not rstr.eof
    h=h+1
	if rstr("BiaotiNews")=true then
	slsr=slsr&"·<a href="&rstr("UBiaotiNews")&" target=_blank>"&rstr("title")&"</a><br>"
	else
    slsr=slsr&"·<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")&"' order by Date desc"
    rstl.open sqltl,conn,1,1
    if rstl.eof then
    slsl="·本类还没有最新新闻"
    else
    do while not rstl.eof
    h=h+1
	if rstl("BiaotiNews")=true then
	slsl=slsl&"·<a href="&rstl("UBiaotiNews")&" target=_blank>"&rstl("title")&"</a><br>"
	else
    slsl=slsl&"·<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
  ''########读取本类最新图片新闻
    Set rscc=Server.CreateObject("adodb.recordset")
    sqlcc="select Top 5 * from News where Classcn='"&rs1("classcn")&"' 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	
	
      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>",i)
        sfso=replace(sfso,"[recommendnews]","<script src=http://"&sowinpath&"CodeJS/Tj_News.js></script>",i)
        sfso=replace(sfso,"[newssearch]","<script src=http://"&sowinpath&"JS/search.js></script>",i)
	    sfso=replace(sfso,"[newsJS]",sl,i)
		sfso=replace(sfso,"[sTopNews]",slst,i)
		sfso=replace(sfso,"[srecommend]",slsr,i)
		sfso=replace(sfso,"[sLastNews]",slsl,i)
		sfso=replace(sfso,"[CoPic]",slsc,i)
		sfso=replace(sfso,"[Navigation]",strNavigate,i)
		sfso=replace(sfso,"[stitle]",""&rs1("Classcn")&"",i)
		sfso=replace(sfso,"[PageNum]",slp,i)
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
        Set fout = fso.CreateTextFile(Server.MapPath("..")&"\ClassHtml\"&rs1("ClassEN")&"0"&i&".html")
        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 + -