|
网页调用代码:<script language="javascript" type="text/javascript" src="SNNN.asp?n=10&order=new&width=170&Height=140&id="></script>
SNNN.asp代码为:
<!-- #include file="conn.asp" -->
<!-- #include file="inc/const.asp" -->
<%
'By peter At www.itlyc.com
'QQ: 75224274
'Email: lazich@163.com
Dim n , order , height , width , boardid , searchstr , orders , rs , sql , i , bbsUrl , FileName , annou , dispid
'============================================
'更改BBS目录(注:相对于你用来调用的目录)
'============================================
bbsUrl = "/" '以"/" 结尾
'============================================
n = Request.QueryString("n")
order = Request.QueryString("order")
height = Request.QueryString("height")
width = Request.QueryString("width")
boardid = Request.QueryString("id")
select Case order
Case "new"
orders = "F_AddTime"
Case "view"
orders = "F_ViewNum"
Case "down"
orders = "F_DownNum"
Case Else
orders = "F_AddTime"
End select
searchstr = "F_Type=1 And F_Flag=0 And F_BoardID<>444"
If Left(boardid,1) = "," Then boardid = Right(boardid,Len(boardid)-1)
If Right(boardid,1) = "," Then boardid = Left(boardid,Len(boardid)-1)
If boardid<>"" then
searchstr=searchstr & " And F_BoardID in ("&boardid&") "
End If
sql = "select top "&n&" F_ID,F_BoardID,F_AnnounceID,F_Username,F_FileType,F_Filename,F_FileSize,F_Readme,F_DownNum,F_ViewNum,F_AddTime from [Dv_Upfile] where "& searchstr &" order by "& orders &" desc, F_ID desc"
set rs=Dvbbs.execute(sql)
If Not RS.Eof then
SQL=rs.GetRows(-1)
rs.close:set rs=nothing
Response.Write "<script language=""JavaScript"">"
Response.Write "\r "
Response.Write "<!--"
Response.Write "\r "
Response.write "var imglink = new Array(); "
Response.Write "\r "
Response.write "var imgurl = new Array(); "
Response.Write "\r "
Response.write "var imgalt = new Array(); "
Response.Write "\r "
For i=0 To Ubound(SQL,2)
if SQL(2,i) <> "" and instr(SQL(2,i),"|") > 0 Then
'annou = split(SQL(2,i),"|")
dispid = split(SQL(2,i),"|")(0)
annou = split(SQL(2,i),"|")(1)
else
annou = ""
dispid = ""
End if
FileName = BbsUrl & CheckFileFolder & SQL(5,i)
Response.write "imgurl["&i&"]=\'"&FileName&"\'; "
Response.Write "\r "
Response.write "imglink["&i&"]=\'"&bbsUrl&"dispbbs.asp?boardid="&SQL(1,i)&"&id="&dispid&"&replyid="&annou&"\'; "
Response.Write " \r "
Response.write "imgalt["&i&"]=""〖"&SQL(7,i)&"〗""; "
Response.Write " \r "
NEXT
Response.write "var startnum=0; "
Response.Write " \r "
Response.write " var changetime=4000; "
Response.Write " \r "
Response.write " function loadpic(){ "
Response.Write " \r "
Response.write " var preloadedimages=new Array(); "
Response.Write "\r "
Response.write "for (i=1;i<imgurl.length;i++){ "
Response.Write "\r "
Response.write "preloadedimages[i]=new Image(); "
Response.Write "\r "
Response.write "preloadedimages[i].src=imgurl[i]; "
Response.Write "\r "
Response.write "} "
Response.Write " \r "
Response.write "} "
Response.Write "\r "
Response.write "function setstr(){ "
Response.Write "\r "
Response.write " if (document.all){ "
Response.Write " \r "
Response.write " idname.filters.revealTrans.Transition=Math.floor(Math.random()*23); "
Response.Write " \r "
Response.write " idname.filters.revealTrans.apply(); "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.write " function playimg(){ "
Response.Write " \r "
Response.write " if (document.all) "
Response.Write " \r "
Response.write " idname.filters.revealTrans.play() "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.write " function nextpic(){ "
Response.Write " \r "
Response.write " loadpic() "
Response.Write " \r "
Response.write " if(startnum<imgurl.length-1)startnum++ ; "
Response.Write " \r "
Response.write " else startnum=0; "
Response.Write " \r "
Response.write " setstr(); "
Response.Write " \r "
Response.write " document.images.idname.src=imgurl[startnum]; "
Response.Write " \r "
Response.write " document.images.idname.alt=imgalt[startnum]; "
Response.Write " \r "
Response.write " playimg(); "
Response.Write " \r "
Response.write " theTimer=setTimeout(""nextpic()"", changetime); "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.write " function jumpto(){ "
Response.Write " \r "
Response.write " jumpUrl=imglink[startnum]; "
Response.Write " \r "
Response.write " jumpTarget=\'_blank\'; "
Response.Write " \r "
Response.write " if (jumpUrl != \'\'){ "
Response.Write " \r "
Response.write " if (jumpTarget != \'\')window.open(jumpUrl,jumpTarget); "
Response.Write " \r "
Response.write " else location.href=jumpUrl; "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.write " } "
Response.Write " \r "
Response.Write " //--> "
Response.Write " \r "
Response.Write " </script> "
Response.Write " \r"
Response.write " <A href=""javascript:jumpto()""><IMG style=""FILTER: revealTrans(duration=2,transition=20)"" height="""& height &""" src=""javascript:nextpic()"" width="""& width &""" border=0 name=idname></A> "
else
rs.close:set rs=nothing
end if
Set template = Nothing
Set MyBoardOnline = Nothing
Set Dvbbs = Nothing
Set Conn = Nothing
'读取上传目录
Function CheckFileFolder()
If Dvbbs.Forum_Setting(76)="" Or Dvbbs.Forum_Setting(76)="0" Then Dvbbs.Forum_Setting(76)="UploadFile/"
CheckFileFolder = Replace(Replace(Dvbbs.Forum_Setting(76),Chr(0),""),".","")
'在目录后加(/)
If Right(CheckFileFolder,1)<>"/" Then CheckFileFolder=CheckFileFolder&"/"
End Function
%>
在IE7.0下无法浏览图片!!在IE6.0下可以浏览!!!!
请高手指点下到底是什么问题!!! |
|