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

📄 newsaddjssave.asp

📁 很好的企业网站管理系统!可以适应各种不同的小型企业!
💻 ASP
📖 第 1 页 / 共 2 页
字号:

<!--#include file="check.asp"-->
<!--#include file="mdb_path_info.asp"-->
<%
'#################################################################
'#  晓宇听幽网站内容管理系统(xoYu CMS)
'# 
'#  版权所有: 晓宇听幽工作室
'#
'#  制作人  :  xoyu(晓宇)            
'#           
'#  主页地址: http://www.xoYu.com	    晓宇听幽工作室
'#  论坛地址: http://www.xoYu.com/bbs/	晓宇听幽讨论区
'#
'#【版权声明】
'#################################################################
'# 本软体为共享软体(shareware)提供个人网站免费使用,请勿非法修改,
'# 转载,散播,或用于其他图利行为,并请勿删除版权声明。
'# 如果您的网站正式起用了这个脚本,请您通知我们,以便我们能够知晓!
'# 如果可能,请在您的网站做上我们的链接,希望能给予合作。谢谢!
'#################################################################
'# 程序名称:晓宇听幽网站内容管理系统·网站内容管理系统
'# 英文名称:xoYu News 2004 Professional For xoYu CMS
'# 程序创建时间:2003-7-10
'# 程序完成时间:2003-9-11
'# 最后修改时间:2003-11-15
'#################################################################
'# 请您尊重我们的劳动和版权,不要删除以上的版权声明部分,谢谢合作
'# 如有任何问题请到我们的论坛(http://www.xoyu.com/bbs/)告诉我们。 
'#################################################################
  Domain=Request.ServerVariables("SERVER_NAME")
  gFilePath=Request.ServerVariables("PATH_INFO")
  gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/")))
  CountN=len(gFilePath)
  gFilePath=lcase(left(gFilePath,CountN-1))
  gFilePath=lcase(left(gFilePath,instrRev(gFilePath,"/")))
  AllPath="http://"+Domain&gfilepath

  filename=request("filename1")
  filenamex=request("filename2")
  if request.form("WordNews")<>"" then
    set rs1=Server.CreateObject("adodb.recordset")
    sql1="select * from JSFile where FileName='"&request.form("FileName1")&"' and JSName='"&request.form("WordNewsName")&"'"
    rs1.open sql1,conn,3,3
    session("errormsg")=""
    if not rs1.eof then session("errormsg")="JS列表已存在此条新闻,请另选其它的JS列表"    
    if session("errormsg")="" then
      set rs3=Server.CreateObject("adodb.recordset")
      sql3="Select IndexCount from JS where Type='文字新闻' and JSNameCN='"&request.form("WordNewsName")&"'"
      rs3.open sql3,conn,1,1
      IndexCount=rs3("IndexCount")
      rs3.close
      set rs3=nothing
      set rs2=Server.CreateObject("adodb.recordset")
      sql2="select * from JSFile where JSType='文字新闻' and JSName='"&request.form("WordNewsName")&"'"
      rs2.open sql2,conn,3,3
      if not rs2.eof then rs2.movefirst
      if rs2.recordcount>=IndexCount then rs2.delete:rs2.update
      set rs=Server.CreateObject("adodb.recordset")
      rs.open"select * from info Where id="&filename,conn,1,1
      rs1.addnew
      rs1("Title")=rs("title")
      rs1("tid")=rs("tid")
      rs1("FileName")=rs("id")
      rs1("Date")=rs("Date")
      rs1("JSType")="文字新闻"
      rs1("JSName")=request.form("WordNewsName")
      rs1.update
      rs.close
      set rs=nothing
    end if
    rs1.close
    set rs1=nothing
    Call WordNews
    Call result
  elseif request.form("PhotoNews")<>"" then
    set rs1=Server.CreateObject("adodb.recordset")
    sql1="select * from JSFile where FileName='"&request.form("FileName2")&"' and JSName='"&request.form("PhotoNewsName")&"'"
    rs1.open sql1,conn,3,3
    session("errormsg")=""
    if not rs1.eof then session("errormsg")="JS列表已存在此条新闻,请另选其它的JS列表"
    if request.form("PhotoPath")="" then session("errormsg")="图片新闻必须填写图片的路径"
    if session("errormsg")="" then
      set rs3=Server.CreateObject("adodb.recordset")
      sql3="Select PhotoCSS,IndexCount from JS where Type='图片新闻' and JSNameCN='"&request.form("PhotoNewsName")&"'"
      rs3.open sql3,conn,1,1
      IndexCount=rs3("IndexCount")
      PhotoCSS=rs3("PhotoCSS")
      rs3.close
      set rs3=nothing
      set rs2=Server.CreateObject("adodb.recordset")
      sql2="select * from JSFile where JSType='图片新闻' and JSName='"&request.form("PhotoNewsName")&"'"
      rs2.open sql2,conn,3,3
      if not rs2.eof then rs2.movefirst
      if rs2.recordcount>=IndexCount then rs2.delete:rs2.update
      set rs=Server.CreateObject("adodb.recordset")
      rs.open"select * from info Where id="&filenamex,conn,1,1
      rs1.addnew
      rs1("Title")=rs("title")
      rs1("tid")=rs("tid")
      rs1("FileName")=rs("id")	  
      rs1("Date")=rs("Date")
      rs1("JSType")="图片新闻"
      rs1("JSName")=request.form("PhotoNewsName")
      rs1("PhotoPath")=request.form("PhotoPath")
      rs1.update
      rs.close
      set rs=nothing
    end if
    rs1.close
    set rs1=nothing
    select case PhotoCSS
    case "CSS1" Call CSS1
    case "CSS2" Call CSS2
    case "CSS3" Call CSS3
    end select
    Call result
  End if

  Sub WordNews()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='文字新闻' and JSName='"&request.form("WordNewsName")&"'"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select IndexCount,JSNameEN,NewsTP,sort from JS where Type='文字新闻' and JSNameCN='"&request.form("WordNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".html")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    if rs3("sort")="2" then
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      filejs=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
      if instr(rs("Title"),"<font")>0 then
      titlez=rs("Title")&"</font>"
      else
      titlez=rs("Title")
      end if
      set rs_type=server.CreateObject("ADODB.RecordSet")
      rs_type.open "select * from infotype where id="&rs("tid"),conn,1,1
      if not rs_type.EOF then
      TN=split(rs_type("tname"),"|")
      Content=""&rs3("NewsTP")&"[<a href=../List/List_"&rs("tid")&"_1.html>"&TN(ubound(TN)-1)&"</a>]<a href="&AllPath&"Html/"&filejs&"-1.html target=_blank>"&titlez&"</a><br>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs_type.close
      end if
      rs.movenext
    next
    end if
      if rs3("sort")="1" then
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      filejs=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))
      if instr(rs("Title"),"<font")>0 then
      titlez=rs("Title")&"</font>"
      else
      titlez=rs("Title")
      end if
      Content=""&rs3("NewsTP")&"<a href="&AllPath&"Html/"&filejs&"-1.html target=_blank>"&titlez&"</a><br>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    end if            
      rs.close
    set rs=nothing
  End Sub

  Sub CSS1()
    set rs=Server.CreateObject("adodb.recordset")
    sql="select * from JSFile where JSType='图片新闻' and JSName='"&request.form("PhotoNewsName")&"' order by ID desc"
    rs.open sql,conn,1,1
    set rs3=Server.CreateObject("adodb.recordset")
    sql3="Select IndexCount,JSNameEN,PicWi,PicHi,NewsTP,sort from JS where Type='图片新闻' and JSNameCN='"&request.form("PhotoNewsName")&"'"
    rs3.open sql3,conn,1,1
    Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
    set CrHNJS=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".js")
    set CrHNHt=MyFile.CreateTextFile(Server.MapPath("..")&"\JS\"&rs3("JSNameEN")&".html")
    CrHNHt.WriteLine("<script src="&rs3("JSNameEN")&".js></script>")
    Table="<table whidth=100% ><tr>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      Content="<td><a href="&AllPath&"Html/"&filejs&"-1.html target=_blank><img src="&rs("PhotoPath")&" width="&rs3("PicWi")&" height="&rs3("PicHi")&" border=1 style='border-color:#000000'></a></td>"
      CrHNJS.WriteLine("document.write("""&Content&""")")
      rs.movenext
    next
    Table="</tr><tr>"
    CrHNJS.WriteLine("document.write("""&Table&""")")
    rs.movefirst
    if rs3("sort")="2" then
    for i=1 to rs3("IndexCount")
      if rs.eof then exit for
      filejs=year(rs("date"))&month(rs("date"))&day(rs("date"))&hour(rs("date"))&minute(rs("date"))&second(rs("date"))

⌨️ 快捷键说明

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