标题:ASP读取ACCESS记录中图片地址并显示
取消只看楼主
mandwolf
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-12-6
 问题点数:0 回复次数:0 
ASP读取ACCESS记录中图片地址并显示
我做了一个摄影网站,用了一个源码程序,但是对他的图片展示部分不太满意,想用另外的图片展示效果来替换,请高手帮忙指点,我想用的那个特效,地址都是指定好的
这个是源码的图片展示页
程序代码:
<!--#include file="conn.asp"-->
<!--#include file = "sysadm/inc/ubbcode_pic2.asp"-->
  <%
Set Rs = Conn.Execute("Select * From pic Where CD = '"&Request.QueryString("CD")&"'")
%><style type="text/css">
<!--
body,td,th {
    font-size: 12px;
    color: #FF6600;
}
body {
    background-color: #000000;
    background-image: url();
}
a {
    font-size: 12px;
    color: #FF6600;
}
a:link {
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #FF6600;
}
a:hover {
    text-decoration: none;
    color: #FF0000;
}
a:active {
    text-decoration: none;
}
-->
</style>
<title><%=web_name%></title>
<link rel="shortcut icon" href="favicon.ico" />
<meta name="keywords" content="<%=Keywords%>">
<meta name="description" content="<%=Description%>">
<meta name="Copyright" content="<%=web_banquan%>"/>
<script language="javascript" src="js/alpha.js"></script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="95%" align="center" valign="top"><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><div align="center">
         <%
cd=request("cd")
set rsw=server.createobject("adodb.recordset")
sql="select top 2 * from [picurl] where id='"&cd&"' order by pid asc"
rsw.open sql,Conn,1,1
rsw.movenext '这样就跳到了下一个
'这样下面条语句输出的就是第二个。
response.write "<img id=""img"" src=""UploadFiles/"&Rsw("picurl")&""">"

rsw.close
set rsw=nothing
%>
        </div></td>
      </tr>
      <tr>
        <td><br>
          <div align="center"><%=dvHTMLEnCode(Rs("dbcl_english"))%></div></td>
      </tr>
    </table>    </td>
    <td width="5%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%"  border="0" cellspacing="5" cellpadding="0">
      <tr>
       
        <%
cd=request("cd")
dim sql,rsf,arrlists,p,ii
set rsf=server.createobject("adodb.recordset")
sql="select * from [picurl] where id='"&cd&"' and len(picurl) > 0 order by pid asc"
rsf.open sql,Conn,1,1
i=0
ii=1
rsf.PageSize =10 '每页记录条数
mpages=rsf.PageSize
            iCount=rsf.RecordCount '记录总数
            iPageSize=rsf.PageSize
            maxpage=rsf.PageCount
            page=request("page")
   
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
   
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
   
    rsf.AbsolutePage=Page

    if page=maxpage then
        x=iCount-(maxpage-1)*iPageSize
    else
        x=iPageSize
    end if

rsf.movenext
do while not rsf.eof and ii<=rsf.pagesize

response.write "<Td><img style='filter:alpha(opacity=50);cursor:hand; border:1px #ffffff solid;' onMouseOver='nereidFade(this,100,30,5)' onMouseOut='nereidFade(this,50,50,5)'' onclick=""img('"&rsf("picurl")&"')"" src='UploadFiles/"&rsf("picurl")&"' width='76' height='68'></td>"
rsf.movenext
i=i+1
ii=ii+1
if i mod 2=0 then
response.write "</tr><tr>"
end if
loop

%><div align="center"><span class="pages cb">当前第<%=page%>页 共<%=(iCount-1)%></span></div></tr></table>
<%
rsf.close
set rsf=nothing
call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>","")%></td>
      </tr>
      <tr>
        <td><table width="100%"  border="0" align="left" cellpadding="0" cellspacing="0">
            <tr>
              <td><table width="100%" height="21"  border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="25"><b style="color:#ffffff; ">拍摄主题:<%=Rs("title_china")%>&nbsp;</b></td>
                  </tr>
                </table>
                  <table width="100%" height="21"  border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="25"><b style="color:#ffffff; ">拍摄时间:</b> <%=Rs("ks_china")%></td>
                    </tr>
                  </table>
                  <table width="100%" height="50"  border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="25"><%=dvHTMLEnCode(Rs("dbcl_china"))%></td>
                    </tr>
                    <tr>
                      <td height="25"><div align="center"><a href="#" onClick="javascript:window.close();return false;">关闭窗口</a></div></td>
                    </tr>
                </table></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<script language="JavaScript">
<!--

function high(which2)
{
theobject=which2
highlighting=setInterval("highlightit(theobject)",10)
}
function low(which2)
{
clearInterval(highlighting)
which2.filters.alpha.opacity=50
}
function highlightit(cur2)
{
if(cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if(window.highlighting)
clearInterval(highlighting)
}

//-->
    </script>
    <script language="javascript" defer>
function img(obj){
var img = document.getElementById("img");
img.style.filter="revealTrans(duration=1)";
img.style.filter="revealTrans(transition=23)";
img.filters(0).apply();
img.src = "UploadFiles/"+obj
img.filters(0).play();
}
    </script>
</body>
</html>
<%
Sub PageControl(iCount,pagecount,page,table_style,font_style,alt)
'生成上一页下一页链接
    Dim query, a, x, temp
    action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

    query = Split(Request.ServerVariables("QUERY_STRING"), "&")
    For Each x In query
        a = Split(x, "=")
        If StrComp(a(0), "page", vbTextCompare) <> 0 Then
            temp = temp & a(0) & "=" & a(1) & "&"
        End If
    Next

    Response.Write("<table " & Table_style & " border=1 width=100% cellpadding=4 style=""border-collapse: collapse"" bordercolor=#CCCCCC>" & vbCrLf )       
    Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
    Response.Write("<TD align=left >" & vbCrLf )
    Response.Write(font_style & vbCrLf )   
       
    if page<=1 then
     
        Response.Write ("<font color='#FF6600'>上页</font> " & vbCrLf)
    else        

        Response.Write("<A style='color:#FF6600' HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A>&nbsp;" & vbCrLf)
    end if

    if page>=pagecount then
        Response.Write ("<font color='#FF6600'>下页</font>&nbsp;" & vbCrLf)
      
    else
        Response.Write("<A style='color:#FF6600' HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A>&nbsp;" & vbCrLf)
     
    end if


    Response.Write("</TD>" & vbCrLf )               
    Response.Write("</TR></form>" & vbCrLf )       
    Response.Write("</table>" & vbCrLf )       
End Sub

%>
下面是JS效果的图片地址区
程序代码:
<div id="imageFlow">
        <div class="top"></div>
        <div class="bank">
            <a rel="images/ct81.jpg" title="Optimists" href="123">They don't know all the facts yet</a>
            <a rel="images/ct134.jpg" title="Empathy" href="123">Emotional intimacy</a>
            <a rel="images/ct41.jpg" title="Much work" href="123">...remains to be done before we can announce our total failure to make any progress</a>
            <a rel="images/ct75.jpg" title="System error" href="123">Errare Programma Est</a>
            <a rel="images/bl201.jpg" title="Nonexistance" href="123">There's no such thing</a>
            <a rel="images/ct137.jpg" title="Inside" href="123">I抦 now trapped, without hope of escape or rescue</a>
            <a rel="images/ct65.jpg" title="E-Slaves" href="123">The World is flat</a>
            <a rel="images/or105.jpg" title="l0v3" href="123">1 l0v3 j00 - f0r3v3r</a>
            <a rel="images/ct139.jpg" title="T minus zero" href="123">111 111 111 x 111 111 111 = 12345678987654321</a>
            <a rel="images/ct27.jpg" title="The End" href="123">...has not been written yet</a>
        </div>

请高手帮帮忙,改一下,谢谢了啊
搜索更多相关主题的帖子: ACCESS ASP 记录 地址 
2010-12-06 10:13



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-328048-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.064133 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved