📄 newscodejs.asp
字号:
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
document.write("<head><meta http-equiv='Content-Language' content='zh-cn'><meta http-equiv='Content-Type' content='text/html; charset=gb2312'></head>");
<%
lm=chkhtm(trim(request("lm")))
lm2=chkhtm(trim(request("lm2")))
if lm="" then lm=lm2
if lm2="" then lm2=lm
t=trim(request("t"))
hot=trim(request("hot"))
tj=chkhtm(trim(request("tj")))
news=trim(request("new"))
n=trim(request("n"))
more=trim(request("more"))
week=trim(request("week"))
line=trim(Request("line"))
zzly=trim(Request("zzly"))
hit=trim(Request("hit"))
pls=trim(Request("pls"))
lmname=trim(Request("lmname"))
font=trim(request("font"))
if font="" then font="9"
if line="" then line="2"
if n="" then n=30
n=int(n)
open=trim(request("open"))
if open="1" then
open="_blank"
else
open="_top"
end if
list=trim(request("list"))
if list="" then list=10
list=int(list)
icon=trim(request("icon"))
if icon="1" then
icon="<font face=Wingdings>1</font>"
elseif icon<>"0" and icon<>"1" then
icon="<img src="&icon&" align='absmiddle' border=0>"
else
icon=""
end if
if (not isNumeric(lm2)) then
lm2=0
end if
path=config("path")
sql = "select top "&list&" id,title,titlecolor,hit,pic,ontop,time,lm,lm2,lm3,updat,zz,file_path,file_name from news where title<>'' and sh=1 "
if tj="1" then sql=sql&" and tj='推荐' "
if lm2<>"0" then
sql=sql&" and (lm='"&lm2&"' or lm2='"&lm2&"' or lm3='"&lm2&"') "
end if
if hot=1 then
addtime=year(now())&"-"&month(now())&"-"&day(now())
sql = sql&" and datediff('d',time,'"&addtime&"')<30 order by hit desc , updat desc , id desc"
else
sql= sql&" order by ontop desc , updat desc, id desc"
end if
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
%>
document.write("<table border=0 cellpadding=0 cellspacing=0 width=100%>");
<%
if rs.recordcount<>0 then
while not rs.eof
lm2=trim(rs("lm3"))
if lm2="0" or lm2="" then lm2=trim(rs("lm2"))
if lm2="0" or lm2="" then lm2=trim(rs("lm"))
if lm2="" then lm2=0
sql2 = "select * from lm where id="&clng(lm2)
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
fontcolor=rs2("fontcolor")
pic=rs2("pic")
lmid=rs2("id")
lm=rs2("lm")&rs2("lm2")&rs2("lm3")
if rs("titlecolor")="默认颜色" then
fontcolor=rs2("fontcolor")
else
fontcolor=rs("titlecolor")
end if
id=rs("id")
title=rs("title")
newshit=rs("hit")
title=replace(title,"""","")
%>
document.write("<tr><td valign=top align=left height=<%=line%>><font style='font-size:<%=font%>pt'><%=icon%> </font>");
<%
if lmname="1" then
%>
document.write("<a href='<%=list_html_url(lmid)%>' target=_blank><font color=999999 style='font-size:<%=font%>pt'>[<%=lm%>]</font></a> ");
<%
end if
%>
// document.write("<a href=<%=path%>news_view.asp?newsid=<%=id%> target=<%=open%> title='<%=title%>'><font color='<%=fontcolor%>' style='font-size:<%=font%>pt'><%=titleb(title,n)%></font></a>");
// 豪--取消了上面一句,改为下一句.
document.write("<a href=<%=fun_html_url(id)%> target=<%=open%> title='<%=title%>'><font color='<%=fontcolor%>' style='font-size:<%=font%>pt'><%=titleb(title,n)%></font></a>"); // -2006-9-14-豪-修改
<% if trim(rs("pic"))<>"" and pic="1" then %>
document.write("<font style='font-size:<%=font%>pt'>[图]</font>");
<%
end if
Newszz=rs("zz") '显示作者
if zzly="1" then
%>
document.write("<font style='font-size:<%=font%>pt' color='#999999'>{<%=titleb(Newszz,7)%>}</font>");
<%
end if
if hit="1" then '显示阅读数
%>
document.write("<font style='font-size:<%=font%>pt' color='#999999'><a title='阅读数'>[<%=Newshit%>]</a></font>");
<%
end if
if pls="1" then '显示评论数
set rspl = Server.CreateObject("ADODB.RecordSet")
rspl.Open "select * from [NewsPL] where NewsID="&id&" order by id desc",conn,1,1
NewsPLS=rspl.recordcount
rspl.close:set rspl=nothing
%>
document.write("<font style='font-size:<%=font%>pt' color='#999999'><a title='评论数'>[<%=NewsPLS%>]</a></font>");
<%
end if
if news="1" then
if datediff("d",rs("time"),date())<=newsx() then
%>
//document.write("</td><td align=left><img src=<%=path%>images/new.gif>"); 2006_12_10修改
document.write("<img src=<%=path%>images/new.gif>");
<%
end if
else
%>
document.write("</td><td>");
<%
end if
tttt=rs("time")
nowdate=rs("time")
y=Year(nowdate)
m=Month(nowdate)
d=Day(nowdate)
if len(m)=1 then
m="0"&m
end if
if len(d)=1 then
d="0"&d
end if
tttt1=y&"年"&m&"月"&d&"日" '2006年01月01日
tttt2=y&"-"&m&"-"&d '2006-01-01
tttt3=m&"月"&d&"日" '01月01日
tttt4=m&"-"&d '01-01
%>
document.write("</td><td align=right>");
<%
if t="1" then%>
document.write("<font color=333333 style='font-size:<%=font%>pt'><%=tttt1%></font>");
<%elseif t="2" then %>
document.write("<font color=333333 style='font-size:<%=font%>pt'><%=tttt2%></font>");
<%elseif t="3" then%>
document.write("<font color=333333 style='font-size:<%=font%>pt'>[<%=tttt3%>]</font>");
<%elseif t="4" then%>
document.write("<font color=333333 style='font-size:<%=font%>pt'>[<%=tttt4%>]</font>");
<% end if %>
<%if week="1" then%>
document.write("<font color=333333 style='font-size:<%=font%>pt'>[<%=weekDayName(weekday(tttt))%>]</font>");
<%end if%>
document.write("</td></tr>");
<%
rs.movenext
wend
lm=trim(request("lm"))
lm2=trim(request("lm2"))
if more="1" then
%>
document.write("<tr><td align=right colspan=2><a href='<%=list_html_url(lm2)%>'>更多内容</font></a></td></tr>");
<%
else
end if
else
%>
document.write("<tr><td width='100%' height='15'><font style='font-size:<%=font%>pt'>暂无内容!</font></td></tr>");
<%
end if
rs.close:set rs=nothing
conn.close:set conn=nothing
%>
document.write("</table>");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -