后台编辑新闻时,上传多张图片,怎样在前台显示每一张呢?急求!!

qingyun1020 2003-09-17 10:57:11
各位同仁,我在做新闻编辑时,后台的上传图片是一个一个上传的,上传到数据库中以新闻的id存放的,一个新闻id对应着几张图片,可我不知如何将它们一个一个的显示在前台,求助!!!最好能给我一段代码
...全文
178 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xulovewei 2003-09-21
  • 打赏
  • 举报
回复
先建立一个类别表,并使用自动编号记录类别
在建立一个上传文件表,并建立记录类别编号的字段,这样在上传图片的同时也记录到了类别属性,在查询所属类别的图片显示
makay 2003-09-21
  • 打赏
  • 举报
回复
gz
xjbx 2003-09-21
  • 打赏
  • 举报
回复
图片是放在什么地方呢?数据库?服务器的目录?

用新闻的id来关联做图片的名称,比如01_01.jpg,01_02.jpg,在添加新闻记录的时,用一个字段来放与之关联的图片的位置与名称!
超级大笨狼 2003-09-21
  • 打赏
  • 举报
回复
我的acdsee,嘿嘿,也许帮不上你忙,但是他很好用
两个文件,把DoDir FSO.GetFolder("c:")换成你想看的路径就可以了
acdsee.htm

<html>
<head>
<META name=VI60_defaultClientScript content=VBScript>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>浏览器防acdsee看图程序</title>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Sub Submit_onclick
window.open "acdsee.asp",null,"fullscreen=yes"
window.opener=null
window.close
End Sub

-->
</SCRIPT>
</head>

<body>
浏览器防acdsee看图程序,载入根据图片多少,每500张,需要1分钟或者更长时间,请稍等.....<br>
<input type="button" name="Submit" value="是,我想看">


</body>
</html>




acdsee.asp文件


<body bgcolor="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>

<td align="left" valign="top" nowrap id=mytd>
<select id=select1 name=select1>
<%


Dim FSO,picname,mycount
mycount=0
Set FSO = server.CreateObject("Scripting.FileSystemObject")
DoDir FSO.GetFolder("c:")
Sub DoDir(Folder)
On Error Resume Next
Dim File,SubFolder
For Each File In Folder.Files
'WScript.StdOut.WriteLine File.Path

if lcase(right(File.Path,4))=".jpg" or lcase(right(File.Path,4))="jpeg" then
mycount=mycount+1
%>
<option value="<%=File.Path%>"><%=trim(File.Name)%></option>
<%
picname=File.Path
end if
Next
For Each SubFolder in Folder.SubFolders
DoDir SubFolder
Next
End Sub
-->
%></select>
<br>
<input type="button" name="Submit1" value="上一个" onclick="vbs:prevpic">
<br>
<input type="button" name="Submit2" value="下一个" onclick="vbs:nextpic">
<br>
<input type="button" name="Submit3" value="随机播放幻灯片" onclick="vbs:showme">
<br>
<input type="button" name="Submit32" value="关闭窗口" onClick="vbs:shutdown">
<br>
<font color="#FFFFFF">共<%=mycount%>张</font><br>
</td>

<td width="100%" align="center" valign="top" ><img src="<%=picname%>" id="mypic" onmouseout="vbs:mytd.style.display='block'" onmouseover="vbs:mytd.style.display='none'"></td>
</tr>
</table>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

dim flag
flag=0



Sub select1_onchange
showpic
End Sub
sub prevpic()
if select1.selectedIndex=0 then
select1.selectedIndex=select1.options.length-1
showpic
else
select1.selectedIndex=select1.selectedIndex-1
showpic
end if
end sub

sub nextpic()
if select1.selectedIndex=select1.options.length-1 then
select1.selectedIndex=0
showpic
else
select1.selectedIndex=select1.selectedIndex+1
showpic
end if
end sub

sub slidshow()

if Submit3.value=" 停 止 " then
window.setTimeout "rndpic","3000"
window.setTimeout "slidshow","3000"
end if
end sub
sub showpic()
dim beisx,beisy,beis
mypic.src=trim(select1.value)
end sub

sub rndpic()
dim Mypicid
randomize
Mypicid=int(rnd * select1.options.length)
select1.selectedIndex=Mypicid
showpic
end sub
sub showme()
flag=flag+1
if flag mod 2 =0 then
Submit3.value="随机播放幻灯片"

else
Submit3.value=" 停 止 "
slidshow
end if
end sub
sub shutdown()
window.opener=null
window.close
end sub
-->
</SCRIPT>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧