%
Function glhtml(title)
title=replace(title," "," ")
title=replace(title," ","")
title=replace(title,chr(32),"")
title=replace(title,chr(13),"")
title=replace(title,chr(10),"")
title=replace(title,chr(9),"")
title=replace(title," ","")
title=replace(title,"""","")
title=replace(title,"'","")
set reg=new regexp
reg.IgnoreCase=true
reg.Global=true
reg.Pattern="<(.+?)>"
glhtml=reg.Replace(title,"")
set reg=nothing
End Function
Function glhtml2(title)
'title=replace(title," "," ")
'title=replace(title," ","")
'title=replace(title,chr(32),"") '是一个空格符
title=replace(title,chr(13),"") '是一个回车
title=replace(title,chr(10),"") '是个换行符
title=replace(title,chr(9),"")
'title=replace(title," ","")
title=replace(title,"""","\""")
title=replace(title,"'","\'")
glhtml2=title
End Function
Function GetImg(str)
dim regEx,Match,Matches,imgTemp
imgTemp=""
set regEx=New RegExp
regEx.IgnoreCase=true
regEx.Global=false
regEx.pattern="(
)"
set Matches=regEx.Execute(str)
If Matches.count>0 Then
imgTemp=Matches(0)
End if
GetImg=imgTemp
End Function
%>
<%
Function finddir(filepath)
finddir=""
for i=1 to len(filepath)
if left(right(filepath,i),1)="/" or left(right(filepath,i),1)="\" then
abc=i
exit for
end if
next
if abc <> 1 then
finddir=left(filepath,len(filepath)-abc+1)
end if
end Function
%>
<%
'content_news_view.asp?newsid=66&news_type=content&n=80&imgw=100&imgh=100&hspace=5
n=clng(trim(Request("n"))) '新闻字数
'newsid=chkhtm(trim(Request("newsid")))
newsid=trim(Request("newsid")) '新闻ID
news_type=trim(Request("news_type")) '内容类型
imgw = trim(Request("imgw")) '图片高度
imgh = trim(Request("imgh")) '图片宽度
if imgw ="" then
imgw = trim(Request("w")) '图片高度
end if
if imgh ="" then
imgh = trim(Request("h")) '图片宽度
end if
hspace = trim(Request("hspace"))
'news_type = title 新闻标题
'news_type = htitle 新闻副标题
'news_type = titleimg 新闻标题图片
'news_type = img 新闻内容图片
'news_type = content 新闻内容
if newsid="" then newsid=0
if (not isNumeric(newsid)) then
response.write("document.Write ('ID参数错误或有非法字符或没指定参数,请勿随意提交数据!');")
end if
if newsid=0 or newsid="" or isnull(newsid) or isempty( newsid) then
response.write("document.write ('ID参数错误或有非法字符或没指定参数');")
else
sql = "select * from news where id="&newsid
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount=0 then
response.write("document.write ('该新闻已经没有了,可能已经删除了');")
rs.close:set rs=nothing
conn.close:set conn=nothing
Response.end
end if
select case news_type
case "title"
if n="0" or n="" or isnull(n) then
response.write("document.write ('"&rs("title")&"');")
else
response.write("document.write ('"&left(glhtml(rs("title")),n)&"');")
end if
case "htitle"
if n="0" or n="" or isnull(n) then
response.write("document.write ('"&rs("htitle")&"');")
else
response.write("document.write ('"&left(glhtml(rs("htitle")),n)&"');")
end if
case "titleimg"
'response.write("document.write ('
');")
response.write("document.write ('
');")
case "img"
response.write("document.write ('"&GetImg(rs("content"))&"');")
case "time"
response.write("document.write ('"&year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))&"');")
case "pic"
response.write("document.write ('