📄 newscode.asp
字号:
<head>
<LINK rev=stylesheet href="Css.css" type=text/css charset=gb2312 rel=stylesheet>
</head>
<%
'lmid=trim(request("lm"))
lm=trim(request("lm"))
'if lmid="" then lmid=lm
'if lm="" then lm=lmid
lmname=trim(request("lmname"))
n=trim(request("n"))
list=trim(request("list"))
more=trim(request("more"))
open=trim(request("open"))
bg=trim(request("bg"))
hot=trim(request("hot"))
tj=trim(request("tj"))
week=trim(Request("week"))
hit=trim(request("hit"))
font=trim(Request("font"))
t=trim(request("t"))
news=trim(request("new"))
line=trim(Request("line"))
icon=trim(request("icon"))
if bg="" then bg="ffffff"
%>
<Body bgcolor=<%=bg%> topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<%
if lmname="" then lmname=0
'if lmid=0 then lmid=lm
'if lm="" then lm=0
if lm="" then lm=0
if n="" then n=30
if list="" then list=10
if more="" then more=1
if open="" then open=1
if t="" then t=0
if hot="" then hot=0
if font="" then font=9
if week="" then week=0
if line="" then line=12
if hit="" then hit=0
if icon="" then icon=1
ttjj=tj
week=int(week)
list=int(list)
n=int(n)
if (not isNumeric(lm)) then
Response.Write "<Script Language=JavaScript>alert('ID参数错误或有非法字符或没指定参数,请勿随意提交数据!');</Script>"
response.end
end if
%>
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<%
sql = "select top "&list&" id,title,titlecolor,hit,pic,ontop,time,lm,lm2,lm3,updat,file_path,file_name from news where title<>'' and sh=1 "
if more="2" then sql = "select id,title,titlecolor,hit,pic,ontop,time,lm2,lm,lm3,updat,file_path,file_name from news where title<>'' and sh=1 "
if lm<>"0" then
sql=sql&" and (lm='"&lm&"' or lm2='"&lm&"' or lm3='"&lm&"') "
end if
if tj="1" then sql = sql & " and tj='推荐' "
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
'response.write sql
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount<>0 then
page=trim(request("page"))
if page="" then page=1
rs.PageSize=cint(list)
pagecount=rs.pagesize
if page<=0 then page=1
rs.AbsolutePage=page
for i=1 to list
if rs.eof then exit for
lm2=rs("lm3")
if lm2="0" or lm2="" then lm2=rs("lm2")
if lm2="0" or lm2="" then lm2=rs("lm")
sql2 = "select * from lm where id="&clng(lm2)
Set rs2 = Server.CreateObject("ADODB.RecordSet")
rs2.Open sql2,conn,1,1
'lmid=rs2("lmid")
lm=rs2("lm")&rs2("lm2")&rs2("lm3")
pic=rs2("pic")
%><tr><td valign=top align=left height=<%=line%>>
<% if icon="1" then %>
<font face=Wingdings style="font-size: <%=font%>pt">1</font>
<% elseif icon="0" then %>
<% else %>
<img src=<%=icon%> border=0>
<% end if %>
<%if lmname=1 then response.write "<a href='"&list_html_url(rs2("id"))&"' target=_blank><font style='font-size:"&font&"pt'>["&lm&"]</font></a>"%>
<%
href_url=fun_html_url(rs("id")) '豪-增,取出静态文件的路径. 2006-9-14
%>
<a href="<%=href_url%>" title="<%=rs("title")%>"
<%
if open="1" then
response.write "target=_blank"
else
response.write "target=_top"
end if
%>><font color="<%=trim(fontcolor)%>" style="font-size: <%=font%>pt"><%=titleb(rs("title"),n)%></font></a>
<%
if news="1" then
if datediff("d",rs("time"),date())<=newsx() then
Response.Write "<img src=images/new.gif>"
end if
end if
if trim(rs("pic"))<>"" and rs2("pic")="1" then Response.Write "<font color=99999 style='font-size:"&font&"pt'>[图]</font>"
%>
<%
if t=1 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&formatdatetime(rs("time"),1)&")</font>"
if t=2 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&formatdatetime(rs("time"),2)&")</font>"
if t=3 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&month(rs("time"))&"月"&day(rs("time"))&"日)</font>"
if t=4 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&month(rs("time"))&"-"&day(rs("time"))&")</font>"
if week=1 then response.write "<font color=999999 style='font-size:"&font&"pt'>("&weekDayName(weekday(rs("time")))&")</font>"
%>
<%
if hit="1" then response.write "<font color=999999 style='font-size:"&font&"pt'>[阅:"&rs("hit")&"次]</font>"
if hit="2" then response.write "<font color=999999 style='font-size:"&font&"pt'>["&rs("hit")&"]</font>"
%>
</td></tr>
<%
rs.movenext
if rs.eof then exit for
next
%><tr><td>
<%if more="1" then%>
<div align=right><a href='<%=list_html_url(trim(request("lm")))%>'
<%
if open="1" then
response.write "target=_blank"
else
response.write "target=_top"
end if
%>
><font style="font-size: <%=font%>pt">更多内容</font></a></div>
<%elseif more="2" then%>
<center><font style="font-size: <%=font%>pt">
<%
if rs.recordcount<>0 then
page=int(page)
lmid=trim(Request("lm"))
if page>1 then%>
<a href='<%=request.servervariables("URL")%>?page=1&lm=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>首页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&lm=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>上页</a>
<%end if%>
<%if page<rs.pagecount then%>
<a href='<%=request.servervariables("URL")%>?page=<%=page+1%>&lm=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>下页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&lm=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>尾页</a>
<%end if%>
共<%=rs.recordcount%>条
<script language="JavaScript">
<!--
function FP_jumpMenu(el,frm,sel) {//v1.0
var href=el.options[el.selectedIndex].value; if(sel) el.selectedIndex=0;
if('_new'==frm) open(href); else eval(frm+".location='"+href+"'");
}
// -->
</script>
<select size="1" onChange="FP_jumpMenu(this,'window',false)" id="id1" name="D1" style="font-size: 9pt; border-style: solid; border-width: 1px">
<%for i=1 to rs.pagecount%>
<option <% if int(i)=int(page) then response.write " selected "%> value="<%=request.servervariables("URL")%>?page=<%=i%>&lm=<%=lmid%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&list=<%=list%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
<%next%>
</select>
<%end if%></font>
</center>
<%end if%>
<%end if%>
</td></tr></table>
</body>
<%
conn.close:set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -