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

📄 crclassp.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='BigClassp'"
    else
       if rs("child")<>0 then
          sqlt="Select * from Templet Where TempletName='"&rs("ClassTemplet")&"' and TempletType='BigClassp'"
       else
          sqlt="Select TempletContent from Templet Where TempletType='BigClassp'"
       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&") and PicNews=true order by Newsid Desc"
       else
          sql="Select * from news Where ClassCN='"&rsmall("ClassCN")&"' and PicNews=true order by Newsid Desc"
       end if
       rstc.open sql,conn,1,1
	   '如果你要修改小类标题栏,请修改<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>"
        bl=bl&"<table width=100% border=0 cellspacing=0 cellpadding=4><tr>"
		t=0
		for x=1 to rs("iiNews")      
          '开始生成文件
		   if rstc.eof then exit for
	      if rs("Tdate")=2 then
	         if rstc("BiaotiNews")=true then
	            bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a></td>"
	         else
	            bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a></td>"
	         end if
	      end if 
	      if rs("Tdate")=1 then
	         if rs("GDate")=2 then
	            if rstc("BiaotiNews")=true then
		           bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&Month(rstc("date"))&"/"&Day(rstc("date"))&"]</font></td>"
		        else
	               bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&Month(rstc("date"))&"/"&Day(rstc("date"))&"]</font></td>"	
		        end if
	         end if
	         if rs("Gdate")=1 then
	            if rstc("BiaotiNews")=true then
		           bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href="&rstc("UBiaotiNews")&" target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&(rstc("date"))&"]</font></td>"	
		        else
	               bl=bl&"<td valign='top'><img src="&rstc("PicNewsa")&" width=""100"" height=""100"" border=0><br>"&rs("DirPic")&"<a href=http://"&sowinpath&rstc("lpath")&rstc("FileName")&".html target=_blank>"&CovtTitle(left(rstc("title"),8))&".</a><font color="&rs("Datecolor")&" size="&rs("Datesize")&">["&(rstc("date"))&"]</font></td>"	
		        end if
	         end if
	      end if
          rstc.movenext
		  t=t+1
		 if t mod 4 = 0  then
		bl=bl&"</tr>"
		end if
	   next
	   bl=bl&"</table>"
       if rs("child")<>0 then
	      bl=bl&"<div align=right><a href=http://"&sowinpath&"Photo/"&rsmall("ClassEN")&"/index.htm>更多</a>...&nbsp;&nbsp;</div>"
	   else
	      bl=bl&"<div align=right><a href=http://"&sowinpath&"Photo/"&rsmall("ClassEN")&"/"&rsmall("ClassEN")&"01.html>更多</a>...&nbsp;&nbsp;</div>"
	   end if
	   rsmall.movenext
    Wend
	''########读取本类top
	Set rstop=Server.CreateObject("adodb.recordset")
    sqltop="select * from News where Classcn in ("&childtemp&") and PicNews=true 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")
    sqltr="select * from News where Classcn in ("&childtemp&") and Recommend=true and PicNews=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")
    sqltl="select * from News where Classcn in ("&childtemp&") and PicNews=true 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
  
'########替换代码,并生成HTML文件
	if rst.eof and rst.bof then
	else
	   strNavigate=GetDaohang(rs("ID"))
	   bigfso=rst("TempletContent")
	   bigfso=replace(bigfso,"[bignewsjs]",bl)
	   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")
       if fso.FolderExists(Server.MapPath("..")&"\Photo\"&Classen)=false then Fso.CreateFolder(Server.MapPath("..")&"\Photo\"&Classen)
	   Set fout = fso.CreateTextFile(Server.MapPath("..")&"\Photo\"&ClassEN&"\index.htm")
       fout.Write bigfso
       fout.close
	end if
	set rs=nothing
	set rst=nothing
	set rsbig=nothing
    End Sub
	
Sub CrSmClass(SmallID)
    z=10
	Set rsnc=Server.CreateObject("adodb.recordset")
	sqlnc="select * from config"
    rsnc.open sqlnc,conn,1,1

⌨️ 快捷键说明

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