📄 html.asp
字号:
<%
if id="" then response.end
sql="select top 1 title,pic,content,author,source,otime,path,skey,categoryid from news where id="&id
rs.open sql,conn,1,1
if not rs.eof then
title =rs(0)
pic =rs(1)
content =rs(2)
author =rs(3)
source =rs(4)
otime =rs(5)
filepath =rs(6)
skey =rs(7)
else
rs.close
call msgbox("该新闻不存在!",1)
end if
rs.close
sql=""
if (skey="" or isNull(skey)) and ubound(cindex)=2 then
sql="select top 10 id,title,pic,otime,path from news where categoryid like '%."&categoryid&".%'"
end if
if skey><"" then
sql="select top 10 id,title,pic,otime,path from news where title like '%"&skey&"%'"
end if
if sql><"" then
sql=sql&" order by otime DESC, hits DESC"
rs.open sql,conn,1,1
if not rs.eof then
aboutlist=rs.getrows()
end if
rs.close
end if
Set rs=nothing
Set conn=nothing
if isarray(cindex) then
if ubound(cindex)<2 then
toptitle="最新新闻"
tophtml="<script language=""javascript"" src=""/"&newsdir&"/html.asp?id="&categoryid&"&height=15""></script>"
abouttitle="相关新闻"
else
toptitle="本专题新闻浏览排行"
tophtml="<script language=""javascript"" src=""/"&newsdir&"/html.asp?id="&categoryid&"&height=15""></script>"
abouttitle="专题新闻"
end if
end if
if isarray(aboutlist) then
for i=0 to ubound(aboutlist,2)
abouthtml =abouthtml&" ·<a href=""/"&replace(aboutlist(4,i),"\","/")&aboutlist(0,i)&".htm"">"&aboutlist(1,i)&"</a>"
if aboutlist(2,i)=true then
abouthtml =abouthtml&"[<font color=D669A5>图</font>]"
end if
abouthtml =abouthtml&" <font color=888888>("&aboutlist(3,i)&")</font><br>"&vbcrlf
next
Set aboutlist=nothing
end if
%><!--#include file="../inc/code.asp"--><%
content=ReplaceText(UBBCode(content),"pic.asp\?id=","/"&newsdir&"/pic.asp?id=")
cmode=replace(cmode,"[HOMEPAGE]",homepage)
cmode=replace(cmode,"[URL]",url)
cmode=replace(cmode,"[NEWS]",newsdir)
cmode=replace(cmode,"[TOPTITLE]",toptitle)
cmode=replace(cmode,"[TOPHTML]",tophtml)
cmode=replace(cmode,"[TOPPATH]",toppath)
cmode=replace(cmode,"[CATEGORY]",categorydir)
cmode=replace(cmode,"[CATEGORYITEM]",categoryitem)
cmode=replace(cmode,"[TITLE]",title)
cmode=replace(cmode,"[TIME]","发稿:"&otime)
if author><"" then
cmode=replace(cmode,"[AUTHOR]","作者:"&author)
else
cmode=replace(cmode,"[AUTHOR]","")
end if
if source><"" then
cmode=replace(cmode,"[SOURCE]","来源:"&source)
else
cmode=replace(cmode,"[SOURCE]","")
end if
cmode=replace(cmode,"[CONTENT]",content)
cmode=replace(cmode,"[ABOUT]",abouttitle)
cmode=replace(cmode,"[ABOUTHTML]",abouthtml)
dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
filepathdir=split(filepath,"\")
if fs.FolderExists(systempath)=false then
fs.CreateFolder(systempath)
end if
if fs.FolderExists(systempath&"\"&filepathdir(0))=false then
fs.CreateFolder(systempath&"\"&filepathdir(0))
end if
if fs.FolderExists(systempath&"\"&filepathdir(0)&"\"&filepathdir(1))=false then
fs.CreateFolder(systempath&"\"&filepathdir(0)&"\"&filepathdir(1))
end if
if fs.FolderExists(systempath&"\"&filepathdir(0)&"\"&filepathdir(1)&"\"&filepathdir(2))=false then
fs.CreateFolder(systempath&"\"&filepathdir(0)&"\"&filepathdir(1)&"\"&filepathdir(2))
end if
if fs.FileExists(systempath&"\"&filepath&"default.htm")=false Then
Set f = fs.CreateTextFile(systempath&"\"&filepath&"default.htm", True)
f.write("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=middle style=""font:9pt"">Copyright © 2001~2002 <a href=""http://www.zwcity.com"" style=""color:0000FF"">ZWCITY.COM</a> 易影中国. All rights reserved. </td></tr></table>")
f.close
Set f = nothing
end if
Set f = fs.CreateTextFile(systempath&"\"&filepath&id&".htm", True)
f.write("<!-- 2001-2002 Copyright by ZWCITY.COM All Rights Reserved. -->" & vbcrlf)
f.write("<!-- News ver 2.0 -->" & vbcrlf)
f.write(cmode)
f.close
Set f = nothing
Set fs = nothing
call msgbox("新闻文件生成成功!\n\n主题:\n"& title &"\n\n路径:\n"&replace(Server.MapPath("../../"&filepath),"\","\\")&"\\"&id&".htm\n\n显示:\nhttp://" & Request.ServerVariables("HTTP_HOST")&"/"&replace(filepath,"\","/")&id&".htm\n\n","chg.asp?id="&id)
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -