📄 createhtmlfiles_fun.asp
字号:
<%
'建立HTML页面开始
Sub CreateHtml(PageCount,PageContent,y)
if request.Form("BiaotiNews")="false" then
session("FilePath")=""
Set rs=Server.CreateObject("adodb.recordset")
sql="Select * from Templet Where TempletName='"&request.form("Templet")&"'"
rs.open sql,conn,1,1
set rs1=Server.CreateObject("adodb.recordset")
sql1="Select * from newsClass Where ClassCN='"&request.form("ClassCN")&"'"
rs1.open sql1,conn,1,1
Templet=CoRe(rs("TempletContent"),PageCount,PageContent,y)
Set MyFile=Server.CreateObject("Scripting.FileSystemObject")
if MyFile.FolderExists(Server.MapPath("..")&"\"&year1)=false then MyFile.CreateFolder(Server.MapPath("..")&"\"&year1)
if MyFile.FolderExists(Server.MapPath("..")&"\"&year1&"\"&month1&"-"&day1)=false then MyFile.CreateFolder(Server.MapPath("..")&"\"&year1&"\"&month1&"-"&day1)
if y>1 then
Set CrFi=MyFile.CreateTextFile(Server.MapPath("..")&"\"&year1&"\"&month1&"-"&day1&"\"&FileName&"-"&y&".html")
else
Set CrFi=MyFile.CreateTextFile(Server.MapPath("..")&"\"&year1&"\"&month1&"-"&day1&"\"&FileName&".html")
end if
if request.Form("plxs")="true" then
Set Crfil=MyFile.CreateTextFile(Server.MapPath("..")&"\"&year1&"\"&month1&"-"&day1&"\"&FileName&".asp")
Crfil.Writeline("<font color=red>没有评论</font>")
end if
'-----相关新闻处理开始
set rshtml=Server.CreateObject("adodb.recordset")
sqlKey="Select * from News Where Keyword like '%"&request.form("Keyword")&"%' and classen='"&request.Form("ClassEN")&"' order by Date Desc"
rshtml.open sqlKey,conn,1,1
for i=1 to rs1("MNCount")
if rshtml.eof then exit for
if rshtml("title")=request.form("Title") then
rshtml.MoveNext
end if
if rshtml.eof then exit for
if rshtml("BiaotiNews")=true then
correlation=correlation+""&rs1("MNTitle")&"<a href= "&rshtml("UBiaotiNews")&" target=_blank>"&BTitle(rshtml("title"))&"</a><br>"
else
correlation=correlation+""&rs1("MNTitle")&"<a href= http://"&sowinpath&rshtml("lpath")&rshtml("FileName")&".html target=_blank>"&BTitle(rshtml("title"))&"</a><br>"
end if
rshtml.MoveNext
'-----相关处理开始
next
session("FilePath")="<font color=red>新闻文件名:</font><a href=../"&year1&"\"&month1&"-"&day1&"\"&FileName&".html target=_blank>"&FileName&".html</a><br>"
session("source")="<font color=red>来 源:</font>"&request.Form("source")&"<br>"
session("author")="<font color=red>作 者:</font>"&request.Form("author")&"<br>"
session("Keyword")="<font color=red>关 键 字:</font>"&request.Form("Keyword")&"<br>"
Templet=replace(Templet,"[correlation]",""&correlation&"")
'加入上一篇,下一篇
Templet=replace(Templet,"[Sendmail]","<a href=http://"&sowinpath&"sendmail.asp?filename="&filename&" target=_blank>发送给好友</a>")
if request.Form("plxs")="true" then
Templet=replace(Templet,"[review]","<form method=post action=http://"&sowinpath&"add_review.asp><input type=hidden Name=FileName value="&FileName&">共有评论<font color=red><script src=http://"&sowinpath&"reviewcount.asp?filename="&filename&"></script></font>篇 "&replace(rs1("ReviewCSS"),"[morereview]"," <font color=blue><a href="&Filename&".asp target=_blank>查看评论</a></font>")&"</form>")
else
Templet=replace(Templet,"[review]","此新闻评论已经被关闭")
end if
CrFi.Writeline(""&Templet&"")
rshtml.close
set rshtml=nothing
rs1.close
set rs1=nothing
rs.close
set rs=nothing
CrFi.close
else
session("FilePath")="<font color=red>标题新闻:</font><a href="&request.Form("UBiaotiNews")&" target=_blank>"&Request.Form("Title")&"</a><br>"
end if
End Sub
'建立HTML页面结束
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -