📄 newscode_xy.asp
字号:
<!--
并排显示新闻,可按需选择行数和列数
调用方法:
框架的JS代码:
<iframe src="newscode_xy.asp?lm2=0&x=4&y=3&hot=0&tj=0&t=0&week=0&font=9&line=12&lmname=0&n=40&more=0&hit=0&open=1&icon=images/xuas.gif&new=0&bg=FFFFFF" marginwidth="1" marginheight="1" width="270" height="184" scrolling="no" border="0" frameborder="0"></iframe>
x为每行显示新闻的条数
y为显示的行数
其他的参数是一样的
-->
<head>
<LINK rev=stylesheet href="Css.css" type=text/css charset=gb2312 rel=stylesheet>
</head>
<%
x=chkhtm(trim(request("x")))
y=chkhtm(trim(request("y")))
lm2=trim(request("lm2"))
lm=trim(request("lm"))
if lm="" then lm=lm2
if lm2="" then lm2=lm
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=lm2
if lm="" then lm=0
'if lm2="" then lm2=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)
xy=x*y
xy=int(xy)
if (not isNumeric(lm2)) then
Response.Write "<Script Language=JavaScript>alert('ID参数错误或有非法字符或没指定参数,请勿随意提交数据!');</Script>"
response.end
end if
%>
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<p style="line-height: <%=line%>pt">
<%
sql = "select 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,lm,lm2,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
%>
<table width="100%">
<%
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)
rs.PageSize=cint(xy)
pagecount=rs.pagesize
if page<=0 then page=1
rs.AbsolutePage=page
for ii=1 to y
%>
<tr>
<%
'for i=1 to list
if rs.eof then exit for
for xxxx=1 to x
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")
'if lmid="" then lmid=rs2("id")
lmn=rs2("lm")&rs2("lm2")&rs2("lm3")
pic=rs2("pic")
%>
<td>
<% 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'>["&lmn&"]</font></a>"%>
<%
href_url=fun_html_url(rs("id"))
%>
<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>
<%
rs.movenext
if rs.eof then exit for
next
%>
</tr>
<%
next
else
%>
<tr><td width='100%' height='15'><font style='font-size:9pt'>暂无新闻!</font></td></tr>
<%end if%>
</table>
<%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%>&x=<%=x%>&y=<%=y%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>首页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=page-1%>&lm=<%=lmid%>&x=<%=x%>&y=<%=y%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&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%>&x=<%=x%>&y=<%=y%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>'>下页</a>
<a href='<%=request.servervariables("URL")%>?page=<%=rs.pagecount%>&lm=<%=lmid%>&x=<%=x%>&y=<%=y%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&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%>&x=<%=x%>&y=<%=y%>&hot=<%=hot%>&tj=<%=ttjj%>&t=<%=t%>&week=<%=week%>&font=<%=font%>&line=<%=line%>&lmname=<%=lmname%>&n=<%=n%>&more=<%=more%>&open=<%=open%>&icon=<%=icon%>&bg=<%=bg%>" <%if page=i then response.write "selected"%>>第<%=i%>页</option>
<%next%>
</select>
<%end if%></font>
<%end if%>
</body>
<% call CloseConn() %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -