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

📄 crclass.asp

📁 新闻发布系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
  Sub CrBgClass(BBigID)
  	Set rsnc=Server.CreateObject("adodb.recordset")
	sqlnc="select * from config"
    rsnc.open sqlnc,conn,1,1
	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
       sqlt="Select * from Templet Where TempletName='"&rs("ClassTemplet")&"' and TempletType='BigClass'"
    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
	i_temp=0
	 bl=bl&"<table width='99%' cellpadding='0'><tr valign=top>"
	 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
	    bl=bl&"<td>"
	  '如果你要修改小类标题栏,请修改<td bgcolor=*>中颜色代码
        bl=bl&"<table width='99%' cellpadding='0'><tr><td height='19' valign='bottom'>&nbsp;<font color=red><b>"&rsmall("classcn")&"</b></font></td></tr></table>"
		bl=bl&"<table width=100% border=0 cellspacing=0 cellpadding=0 background=""../../pic/bg_line1.gif""><tr><td height=6></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("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><br>"
	         else
	            bl=bl&""&rs("DirPic")&"<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("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&Month(rstc("date"))&"/"&Day(rstc("date"))&"]</font><br>"
		        else
	               bl=bl&""&rs("DirPic")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&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("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&(rstc("date"))&"]</font><br>"	
		        else
	               bl=bl&""&rs("DirPic")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(rstc("title"))&"</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&(rstc("date"))&"]</font><br>"	
		        end if
	         end if
	      end if
		if trim(rs("NewsBg1"))<>"" then
		bl=bl&"<table width=98% border=0 cellspacing=0 cellpadding=0><tr><td height=2  background="&rs("NewsBg1")&"></td></tr><tr><td height=2></td></tr></table>"
		end if
		rstc.movenext
		next
	  if rs("child")<>0 then
	      bl=bl&"<div align=right><a href=http://"&sowinpath&"Class/"&rsmall("ClassEN")&"/index.htm>更多</a>...&nbsp;&nbsp;</div>"
	   else
	      bl=bl&"<div align=right><a href=http://"&sowinpath&"Class/"&rsmall("ClassEN")&"/"&rsmall("ClassEN")&"01.html>更多</a>...&nbsp;&nbsp;</div>"
	   end if
	   bl=bl&"</td>"
	   rsmall.movenext
	   i_temp=i_temp+1
		   if i_temp mod CInt(rs("ClassNum")) = 0  then
	   bl=bl&"</tr>"
	   end if
       Wend
	   bl=bl&"</table>"

	
	''########读取本类top
	Set rstop=Server.CreateObject("adodb.recordset")
	childtemp=getchild(rs("id"))
    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&""&rsnc("HNTitle1")&"<a href="&rstop("UBiaotiNews")&" target=_blank>"&rstop("title")&"</a><br>"
	else
    blst=blst&""&rsnc("HNTitle1")&"<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")
	childtemp=getchild(rs("id"))
    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&""&rsnc("RNTitle1")&"<a href="&rstr("UBiaotiNews")&" target=_blank>"&rstr("title")&"</a><br>"
	else
    blsr=blsr&""&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 rs3=Server.CreateObject("adodb.recordset")
    sql3="Select * from Config"
    rs3.open sql3,conn,1,1
	
    Set rstl=Server.CreateObject("adodb.recordset")
	childtemp=getchild(rs("id"))
    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&""&rsnc("LNTitle1")&"<a href="&rstl("UBiaotiNews")&" target=_blank>"&rstl("title")&"</a><br>"
	else
    blsl=blsl&""&rsnc("LNTitle1")&"<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")
	childtemp=getchild(rs("id"))
    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]",""&bigclasscn&"")
       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")
       if fso.FolderExists(Server.MapPath("..")&"\Class\"&Classen)=false then Fso.CreateFolder(Server.MapPath("..")&"\Class\"&Classen)
	   Set fout = fso.CreateTextFile(Server.MapPath("..")&"\Class\"&ClassEN&"\index.htm")
       fout.Write bigfso
       fout.close
	end if
	set rs=nothing
	set rst=nothing
	set rsbig=nothing
    End Sub
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -