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

📄 createhtmlclass_fun_bak.asp

📁 新闻发布系统
💻 ASP
字号:
<%
  Sub CrBigClass()
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    Set rs=Server.CreateObject("adodb.recordset")
    sql="Select * from newsClass where ClassCN='"&request.form("ClassCN")&"'"
    rs.open sql,conn,1,1
    if rs("depth")>0 then
	  sql1="select * from newsclass where id in ("&rs("parentstr")&")"
    else
      rs.close
      set rs=nothing
      exit sub
    end if
    rs.close
    rs.open sql1,conn,1,1
    do while not rs.eof
    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")
    sql="select * from newsclass where ParentID="&rs("id")
    rsmall.open sql,conn,1,1
	while not rsmall.eof
    childtemp=getchild(rsmall("id"))

    set rstc=Server.CreateObject("ADODB.RECORDSET")
    sql="Select * from news Where ClassCN in ("&childtemp&") order by Newsid Desc"
    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
	bl=bl&"<div align=right><a href=http://"&sowinpath&"ClassHtml/"&rsmall("ClassEN")&".html target=_blank>更多</a>...&nbsp;&nbsp;</div>"
	rsmall.movenext
    Wend
	if rst.eof and rst.bof then
	response.Write("新闻添加失败,你没有添加大类模板,请添加模板")
	response.end
	else
	strNavigate=nav(ID,"列表","")
	bigfso=rst("TempletContent")
	bigfso=replace(bigfso,"[bignewsjs]",bl)
    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/"&rs("ClassEN")&".html")
    fout.Write bigfso
    fout.close
	end if
	rs.movenext
	loop
	rs.close
	set rs=nothing
	set rst=nothing
	set rsbig=nothing
    End Sub
	
	Sub CCrMoreJS()
    set rs1=Server.CreateObject("adodb.recordset")
    sql1="Select * from newsClass Where ClassCN='"&request.form("ClassCN")&"'"
    rs1.open sql1,conn,1,1
    set rs=Server.CreateObject("ADODB.RECORDSET")
    sql="Select * from News Where ClassCN='"&request.form("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
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    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/"&request.form("ClassEN")&"01.html>首页</a>&nbsp;&nbsp;"
      if i<>AllPage then
        slp=slp&"<a href=http://"&sowinpath&"ClassHtml/"&request.form("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/"&request.form("ClassEN")&"0"&i-1&".html>上一页</a>&nbsp;&nbsp;"
      else
        slp=slp&"上一页&nbsp;&nbsp;"
      end if
      slp=slp&"<a href=http://"&sowinpath&"ClassHtml/"&request.form("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/"&request.form("ClassEN")&"0"&x&".html selected>第"&x&"页</option>"
        else
          slp=slp&"<option value=http://"&sowinpath&"ClassHtml/"&request.form("ClassEN")&"0"&x&".html>第"&x&"页</option>"
       end if
      next
      slp=slp&"</select></div>"
	  
      if rs3.eof and rs3.bof then
        response.Write("新闻添加失败,没有添加终极小类模板,请添加")
		response.end
      else
        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,"[PageNum]",slp,i)
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
        Set fout = fso.CreateTextFile(Server.MapPath("..")&"\ClassHtml\"&request.form("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 + -