⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 html_pic.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 ASP
字号:
<!--
图片+标题+内容 幻灯片显示程序
全部参数如下:

lm            栏目id      默认为0,即全部栏目
fx           方向  fx=1 为左右显示  fx=0 为上下显示  默认为左右显示
n           内容显示字数,多余字由“…”代替     默认300
nt            标题显示字数,  默认为30   
picw          图片宽度        默认220
pich          图片高度        默认170
tfont         标题字号      默认9
cfont         内容字号      默认9
titlecolor    标题颜色值,16进制,如 红色 FF0000 黑色000000  默认为黑色
contentcolor  内容颜色值,16进制,如 红色 FF0000 黑色000000    默认为黑色

上下显示框架调用代码:
<iframe src="html_pic.asp?fx=1&n=300&nt=20&picw=220&pich=170&tfont=9&cfont=9&titlecolor=FF0000&contentcolor=000000" width="400" marginwidth="0" height="500" marginheight="0" align="center" scrolling="No" frameborder="0" hspace="0" vspace="0" border="0" framespacing="0"></iframe>
左右显示框架调用代码:
<iframe src="html_pic.asp" width="600" marginwidth="0" height="200" marginheight="0" align="center" scrolling="No" frameborder="0" hspace="0" vspace="0" border="0" framespacing="0"></iframe>

加参数的方法:html_pic.asp?参数=值&参数=值&参数=值
例:html_pic.asp?lm=0&fx=1&n=350&picw=220&pich=170&tfont=10 等等
注意:如果设置了图片宽高,框架宽高也要相应的修改,不然显示不完全,具体请各位自己动手测试!
-->
<!--#include file = admin_conn.asp -->
<!--#include file = admin/titleb.asp -->
<STYLE type="text/css">
<!--
.body,td,table {color: #333333; font-size: 9pt;}
.txt {COLOR: #333333; LINE-HEIGHT: 25px; text-decoration:none; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 18pt;}
-->
</STYLE>
<%
ON ERROR RESUME NEXT
lm=int(trim(request("lm")))
fx=int(trim(request("fx")))
n=int(trim(request("n")))
nt=int(trim(request("nt")))
picw=int(trim(request("picw")))
pich=int(trim(request("pich")))
tfont=int(trim(request("tfont")))
cfont=int(trim(request("cfont")))
titlecolor=trim(request("titlecolor"))
contentcolor=trim(request("contentcolor"))

if n="" then n=300
if nt="" then nt=30
if fx="" then fx=1
if lm="" then lm=0
if picw="" then picw=50
if pich="" then pich=60
if tfont="" then tfont=9
if cfont="" then cfont=9
if titlecolor="" then titlecolor="000000"
if contentcolor="" then contentcolor="000000"


if (not isNumeric(lm)) or (not isNumeric(fx)) or (not isNumeric(picw)) or (not isNumeric(pich)) or (not isNumeric(tfont)) or (not isNumeric(cfont))  then
  Response.Write "<Script Language=JavaScript>alert('参数错误或有非法字符或没指定参数,请检查参数是否都为数字,请勿随意提交数据!');location.href='/';</Script>"
  response.end  
end if

set rs = server.CreateObject ("adodb.recordset")
sql="select id,title,pic,sh,lm,lm2,lm3,hit,ontop from [news] where ( pic like '%.jpg%' or pic like '%.JPG%' or pic like '%.gif%' or pic like '%.GIF%' ) and sh=1 "
if lm<>"0" then sql=sql&" and (lm='"&lm&"' or lm2='"&lm&"' or lm3='"&lm&"') "
sql=sql&" order by ontop desc , updat desc , id desc"
rs.open sql,conn,1,1
if rs.recordcount=0 then
  Response.Write "<Script Language=JavaScript>alert('该栏目图片不存在,可能已经删除或没有图片新闻!');location.href='/';</Script>"
  rs.close:set rs=nothing
  conn.close:set conn=nothing
  Response.end
end if

for i=1 to rs.recordcount

pic1=rs("pic")
id1=rs("id")
title1=titleb(rs("title"),nt)
content1=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for

pic2=rs("pic")
id2=rs("id")
title2=titleb(rs("title"),nt)
content2=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for

pic3=rs("pic")
id3=rs("id")
title3=titleb(rs("title"),nt)
content3=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for

pic4=rs("pic")
id4=rs("id")
title4=titleb(rs("title"),nt)
content4=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for

pic5=rs("pic")
id5=rs("id")
title5=titleb(rs("title"),nt)
content5=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for

pic6=rs("pic")
id6=rs("id")
title6=titleb(rs("title"),nt)
content6=glhtml(titleb(rs("content"),n))
	rs.movenext
	if rs.eof then exit for
	
next

rs.close
set rs=nothing 
%>
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var adNum=0;
imgUrl[1]="<%=pic1%>";
imgLink[1]="<%=fun_html_url(id1)%>";
imgtext[1]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title1%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content1%></font>";

imgUrl[2]="<%=pic2%>";
imgLink[2]="<%=fun_html_url(id2)%>";
imgtext[2]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title2%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content2%></font>";

imgUrl[3]="<%=pic3%>";
imgLink[3]="<%=fun_html_url(id3)%>";
imgtext[3]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title3%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content3%></font>";

imgUrl[4]="<%=pic4%>";
imgLink[4]="<%=fun_html_url(id4)%>";
imgtext[4]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title4%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content4%></font>";

imgUrl[5]="<%=pic5%>";
imgLink[5]="<%=fun_html_url(id5)%>";
imgtext[5]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title5%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content5%></font>";

imgUrl[6]="<%=pic6%>";
imgLink[6]="<%=fun_html_url(id6)%>";
imgtext[6]="<center><font color='<%=titlecolor%>' style='font-size:<%=tfont%>pt'><%=title6%></font></center><font color='<%=contentcolor%>' style='font-size:<%=cfont%>pt'><%=content6%></font>";

var imgPre=new Array();
var count=0;
for (i=1;i<=6;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
count++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
}
var key=0;
function nextAd(){
if(adNum<count)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
//imgInit.filters.revealTrans.Transition=20;      2007_01_10修改为下两句
//imgInit.filters.revealTrans.apply();
document.imgInit.filters[0].Transition=26;
document.imgInit.filters[0].apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
focustext.innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", 4000);
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
</script>

<% if fx=0 then%> <!-- 参数fx=0图片和内容为上下结构 -->
<table width="100%" border=0 align="center" cellpadding=0 cellspacing=0 bordercolor=#111111 style="border-collapse: collapse">
  <tr> 
     <TD valign="top" width=<%=picw%> height=<%=pich%>><a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" src="javascript:nextAd()" width=<%=picw%> height=<%=pich%> border=0 class=img01 name=imgInit></a></TD>
  </TR>
  <TR>
     <TD valign="top" width=<%=picw%> height=<%=pich%>><a target=_self href="javascript:goUrl()"><font color=red class=txt><span id=focustext></span></font></a></TD>
  </TR>
</table>
<%elseif fx=1 then%><!-- 参数fx=1 图片和内容为左右结构,默认为左右显示 -->  
<table width="400" border=0 align="center" cellpadding=0 cellspacing=10 bordercolor=#111111 style="border-collapse: collapse">
   <tr> 
       <TD valign="top" width=<%=picw%> height=<%=pich%>><a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);border-color:black;color:#000000" src="javascript:nextAd()" width=<%=picw%> height=<%=pich%> border=0 class=img01 name=imgInit></a></TD>
       <TD valign="top" height=<%=pich%>><a target=_self href="javascript:goUrl()"><font color=red class=txt><span id=focustext></span></font></a></TD>
   </TR>
</table>
<%end if%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -