一个是公告的gonggaoinfo.asp一个是图片显示的DISPLAY.ASP。只有删除公告代码图片才能正确显示。<-display。asp->
<%if not isnumeric(request("Id")) and request("Id")<>"" then
Response.Redirect"info.asp?info=ID必须是数字"
response.end
end if
if request("Id")="0" or request("Id")="" then
Response.Redirect"info.asp?info=对不起,您输入错误的ID"
response.end
end if%>
<%
sql="select * from desktop where DesktopId="&request.querystring("Id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Response.Redirect"info.asp?info=对不起,没有找到相关图片!"
response.end
else
sql1="select * from type where TypeId="&rs("typeid")
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,0,1
zhutiname="<A href=type.asp?typeid="&rs1("TypeId")& ">"&rs1("TypeName")&"</a>"
rs1.close%>
<%
dim classid,classname,typeid,typename
if IsNumeric(Request.QueryString("pid"))=False then
Response.Redirect"info.asp?info=错误的参数"
else
id=cint(Request.QueryString("id"))
end if
set temprs=conn.execute("select typeid,classid,DesktopName from desktop where DesktopId="&Id)
typeid=temprs(0)
classid=temprs(1)
filename=temprs(2)
set temprs=nothing
set temprs=conn.execute("select ClassName from class where ClassId="&classid)
classname=temprs(0)
set temprs=nothing
set temprs=conn.execute("select TypeName from type where TypeId="&typeid)
typename=temprs(0)
set temprs=nothing
%><script language=JavaScript>
function smallit(){
var height1=PhotoViewer.images1.height;
var width1=PhotoViewer.images1.width;
PhotoViewer.images1.height=height1/1.2;
PhotoViewer.images1.width=width1/1.2;
}
function bigit(){
var height1=PhotoViewer.images1.height;
var width1=PhotoViewer.images1.width;
PhotoViewer.images1.height=height1*1.2;
PhotoViewer.images1.width=width1*1.2;
}
function fullit()
{
var width_s=screen.width-10;
var height_s=screen.height-30;
window.open("photo.asp?ID=<%=rs("Desktopid")%>", "PhotoView", "width="+width_s+",height="+height_s+",left=0,top=0,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,menubar=no,directories=no");
}
function realsize()
{
PhotoViewer.images1.height=PhotoViewer.images2.height;
PhotoViewer.images1.width=PhotoViewer.images2.width;
PhotoViewer.block1.style.left = 0;
PhotoViewer.block1.style.top = 0;}
function featsize()
{
var width1=PhotoViewer.images2.width;
var height1=PhotoViewer.images2.height;
var width2=760;
var height2=500;
var h=height1/height2;
var w=width1/width2;
if(height1<height2&&width1<width2)
{
PhotoViewer.images1.height=height1;
PhotoViewer.images1.width=width1;
}
else
{
if(h>w)
{
PhotoViewer.images1.height=height2;
PhotoViewer.images1.width=width1*height2/height1;
}
else
{
PhotoViewer.images1.width=width2;
PhotoViewer.images1.height=height1*width2/width1;
}
}
PhotoViewer.block1.style.left = 0;
PhotoViewer.block1.style.top = 0;
}
</script>
<SCRIPT language=JavaScript>
document.onkeydown=nextpage
function nextpage() {
if (event.keyCode==37) location="DISPLAY.asp?id=<% call ShowNextPic(200) %>"
if (event.keyCode==39) location="DISPLAY.asp?id=<% call ShowPrevPic(200) %>"
}
</SCRIPT>
<HTML><HEAD><TITLE>图文展示-<%=title%></TITLE>
<META content=<%=des%> name=description>
<META content=<%=key%> name=keywords>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="images/style.css" type=text/css rel=stylesheet><META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<style type="text/css">
<!--
.h10 {LINE-HEIGHT: 10px
}
-->
</style>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<!--#include file="head.asp"-->
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><TABLE cellSpacing=0 cellPadding=0 width="95%" align=center
border=0>
<TBODY>
<tr>
<td height="25" align="center"><table width="570" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30"><div align="center"><font style="line-height:25px;font-size:18px"><%=rs("DesktopName")%></font></div></td>
</tr>
</table></td>
</tr>
</TBODY>
</TABLE>
<table width="95%" height="25" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td width="31%"><div align="center">所属类别:<%=zhutiname%></div></td>
<td width="38%"><div align="center">更新时间:<%=year(rs("DesktopTime"))%>-<%=month(rs("DesktopTime"))%>-<%=day(rs("DesktopTime"))%></div></td>
<td width="31%">来源:兴桥中心小学</td>
</tr>
</TABLE>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td align="center" valign="middle" Class="left_tdbgall"><table style='table-layout:fixed' width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td style='word-wrap : break-word'><div align="center"><img src="<%=rs("DesktopPic")%>" border="0"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" align="center" valign="middle"><input name='Prev' type='button' id='Prev' value='上一张' </BODY></HTML>
下面的代码是公告的
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="table-layout:fixed;WORD-BREAK:break-all">
<tr>
<div align="center"><img src="images/notice.jpg" width="230" height="30" /></div></td>
</tr>
<tr>
<td style="table-layout:fixed;WORD-BREAK:break-all" >
<div id="marquees">
<table width="85%" border="0" align="center" cellspacing="0">
<%
sql="select * from web where webid>0 order by webid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if Not rs.EOF thenDo While Not rs.EOF
%>
<tr>
<td width="64%" height="30" valign="top" class="txt"><img src="images/i4.gif" border="0"><a href="show.asp?id=<%=rs("webid")%>" target="_blank"> <%=left(rs("title"),8)%></a></td>
<td width="36%" align="center" valign="top" ><%=rs("addtime")%></span></td>
</tr>
<%rs.movenext
loop
else
if rs.EOF and rs.BOF then%>
<tr align="center">
<td bgcolor="#FFFFFF" colspan="3" class="txt">暂无公告!</td>
</tr>
<%End if
End if%>
</table>
</div>
<script language="JavaScript">marqueesHeight=160;
stopscroll=false;with(marquees){
style.width=240;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');preTop=0; currentTop=0;function init(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueesHeight){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",100);
}
document.body.onload=init;function scrollUp(){
if(stopscroll==true) return;
preTop=marquees.scrollTop;
marquees.scrollTop+=1;
if(preTop==marquees.scrollTop){
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
marquees.scrollTop+=1;
}
}
</script></td>
</tr>
</table>
<%if not isnumeric(request("Id")) and request("Id")<>"" then
Response.Redirect"info.asp?info=ID必须是数字"
response.end
end if
if request("Id")="0" or request("Id")="" then
Response.Redirect"info.asp?info=对不起,您输入错误的ID"
response.end
end if%>
<%
sql="select * from desktop where DesktopId="&request.querystring("Id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Response.Redirect"info.asp?info=对不起,没有找到相关图片!"
response.end
else
sql1="select * from type where TypeId="&rs("typeid")
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,0,1
zhutiname="<A href=type.asp?typeid="&rs1("TypeId")& ">"&rs1("TypeName")&"</a>"
rs1.close%>
<%
dim classid,classname,typeid,typename
if IsNumeric(Request.QueryString("pid"))=False then
Response.Redirect"info.asp?info=错误的参数"
else
id=cint(Request.QueryString("id"))
end if
set temprs=conn.execute("select typeid,classid,DesktopName from desktop where DesktopId="&Id)
typeid=temprs(0)
classid=temprs(1)
filename=temprs(2)
set temprs=nothing
set temprs=conn.execute("select ClassName from class where ClassId="&classid)
classname=temprs(0)
set temprs=nothing
set temprs=conn.execute("select TypeName from type where TypeId="&typeid)
typename=temprs(0)
set temprs=nothing
%><script language=JavaScript>
function smallit(){
var height1=PhotoViewer.images1.height;
var width1=PhotoViewer.images1.width;
PhotoViewer.images1.height=height1/1.2;
PhotoViewer.images1.width=width1/1.2;
}
function bigit(){
var height1=PhotoViewer.images1.height;
var width1=PhotoViewer.images1.width;
PhotoViewer.images1.height=height1*1.2;
PhotoViewer.images1.width=width1*1.2;
}
function fullit()
{
var width_s=screen.width-10;
var height_s=screen.height-30;
window.open("photo.asp?ID=<%=rs("Desktopid")%>", "PhotoView", "width="+width_s+",height="+height_s+",left=0,top=0,location=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,menubar=no,directories=no");
}
function realsize()
{
PhotoViewer.images1.height=PhotoViewer.images2.height;
PhotoViewer.images1.width=PhotoViewer.images2.width;
PhotoViewer.block1.style.left = 0;
PhotoViewer.block1.style.top = 0;}
function featsize()
{
var width1=PhotoViewer.images2.width;
var height1=PhotoViewer.images2.height;
var width2=760;
var height2=500;
var h=height1/height2;
var w=width1/width2;
if(height1<height2&&width1<width2)
{
PhotoViewer.images1.height=height1;
PhotoViewer.images1.width=width1;
}
else
{
if(h>w)
{
PhotoViewer.images1.height=height2;
PhotoViewer.images1.width=width1*height2/height1;
}
else
{
PhotoViewer.images1.width=width2;
PhotoViewer.images1.height=height1*width2/width1;
}
}
PhotoViewer.block1.style.left = 0;
PhotoViewer.block1.style.top = 0;
}
</script>
<SCRIPT language=JavaScript>
document.onkeydown=nextpage
function nextpage() {
if (event.keyCode==37) location="DISPLAY.asp?id=<% call ShowNextPic(200) %>"
if (event.keyCode==39) location="DISPLAY.asp?id=<% call ShowPrevPic(200) %>"
}
</SCRIPT>
<HTML><HEAD><TITLE>图文展示-<%=title%></TITLE>
<META content=<%=des%> name=description>
<META content=<%=key%> name=keywords>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="images/style.css" type=text/css rel=stylesheet><META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<style type="text/css">
<!--
.h10 {LINE-HEIGHT: 10px
}
-->
</style>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<!--#include file="head.asp"-->
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><TABLE cellSpacing=0 cellPadding=0 width="95%" align=center
border=0>
<TBODY>
<tr>
<td height="25" align="center"><table width="570" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30"><div align="center"><font style="line-height:25px;font-size:18px"><%=rs("DesktopName")%></font></div></td>
</tr>
</table></td>
</tr>
</TBODY>
</TABLE>
<table width="95%" height="25" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td width="31%"><div align="center">所属类别:<%=zhutiname%></div></td>
<td width="38%"><div align="center">更新时间:<%=year(rs("DesktopTime"))%>-<%=month(rs("DesktopTime"))%>-<%=day(rs("DesktopTime"))%></div></td>
<td width="31%">来源:兴桥中心小学</td>
</tr>
</TABLE>
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="3">
<tr>
<td align="center" valign="middle" Class="left_tdbgall"><table style='table-layout:fixed' width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td style='word-wrap : break-word'><div align="center"><img src="<%=rs("DesktopPic")%>" border="0"></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" align="center" valign="middle"><input name='Prev' type='button' id='Prev' value='上一张' </BODY></HTML>
下面的代码是公告的
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="table-layout:fixed;WORD-BREAK:break-all">
<tr>
<div align="center"><img src="images/notice.jpg" width="230" height="30" /></div></td>
</tr>
<tr>
<td style="table-layout:fixed;WORD-BREAK:break-all" >
<div id="marquees">
<table width="85%" border="0" align="center" cellspacing="0">
<%
sql="select * from web where webid>0 order by webid desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if Not rs.EOF thenDo While Not rs.EOF
%>
<tr>
<td width="64%" height="30" valign="top" class="txt"><img src="images/i4.gif" border="0"><a href="show.asp?id=<%=rs("webid")%>" target="_blank"> <%=left(rs("title"),8)%></a></td>
<td width="36%" align="center" valign="top" ><%=rs("addtime")%></span></td>
</tr>
<%rs.movenext
loop
else
if rs.EOF and rs.BOF then%>
<tr align="center">
<td bgcolor="#FFFFFF" colspan="3" class="txt">暂无公告!</td>
</tr>
<%End if
End if%>
</table>
</div>
<script language="JavaScript">marqueesHeight=160;
stopscroll=false;with(marquees){
style.width=240;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');preTop=0; currentTop=0;function init(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueesHeight){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",100);
}
document.body.onload=init;function scrollUp(){
if(stopscroll==true) return;
preTop=marquees.scrollTop;
marquees.scrollTop+=1;
if(preTop==marquees.scrollTop){
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
marquees.scrollTop+=1;
}
}
</script></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="table-layout:fixed;WORD-BREAK:break-all">
<tr>
<div align="center"><img src="images/notice.jpg" width="230" height="30" /></div></td>
</tr>
<tr>
<td style="table-layout:fixed;WORD-BREAK:break-all" >
<div id="marquees">
<table width="85%" border="0" align="center" cellspacing="0">
<%
sql="select * from web where webid>0 order by webid desc"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if Not rs2.EOF thenDo While Not rs.EOF
%>
<tr>
<td width="64%" height="30" valign="top" class="txt"><img src="images/i4.gif" border="0"><a href="show.asp?id=<%=rs2("webid")%>" target="_blank"> <%=left(rs2("title"),8)%></a></td>
<td width="36%" align="center" valign="top" ><%=rs("addtime")%></span></td>
</tr>
<%rs.movenext
loop
else
if rs.EOF and rs.BOF then%>
<tr align="center">
<td bgcolor="#FFFFFF" colspan="3" class="txt">暂无公告!</td>
</tr>
<%End if
End if%>
</table>
</div>
<script language="JavaScript">marqueesHeight=160;
stopscroll=false;with(marquees){
style.width=240;
style.height=marqueesHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');preTop=0; currentTop=0;function init(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueesHeight){
templayer.innerHTML+=marquees.innerHTML;
}
marquees.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",100);
}
document.body.onload=init;function scrollUp(){
if(stopscroll==true) return;
preTop=marquees.scrollTop;
marquees.scrollTop+=1;
if(preTop==marquees.scrollTop){
marquees.scrollTop=templayer.offsetHeight-marqueesHeight;
marquees.scrollTop+=1;
}
}
</script></td>
</tr>
</table>反正公告的页面所以的rs都要换成rs2