?? showphoto.jsp
字號:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ page import="com.ayi.web.*" %>
<%@ page import="java.util.*" %>
<%
User user=new User();
DB db=new DB();
Pic p=new Pic();
Vector allPicPath=p.getAllPicPath(db);
Vector path = p.picPath(db, (String) session.getAttribute(Constant.USER_KEY));
%>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="12" height="13" align="center" background="images/corner_top_left.gif"></td>
<td width="420" align="center" background="images/line_top.gif"></td>
<td width="14" align="center" background="images/corner_top_right.gif"></td>
</tr>
<tr>
<td width="12" height="300" align="center" background="images/line_left.gif"></td>
<td width="420" align="center" valign="top" bgcolor="#FFFFFF" >
<!--顯示照片開始-->
<%-- 如果集合內有元素,即有照片 --%>
<%if(allPicPath!=null&&allPicPath.size()!=0){ %>
<table>
<%-- 如果照片數不多于4張開始 --%>
<%if(allPicPath.size()<5){ %>
<tr>
<%for(int i=0;i<allPicPath.size();i++){ %>
<td width="97" align="center" height="120">
<jsp:plugin code="com.ayi.web.applet.ShowImage.class"
codebase="upload/"
type="applet"
align="left"
width="97"
height="120"
iepluginurl="http://www.sun.com" >
<jsp:params>
<jsp:param name="picPath" value="<%=((Pic)allPicPath.get(i)).getPath() %>"/>
<jsp:param name="img_width" value="97"/>
<jsp:param name="img_height" value="120"/>
</jsp:params>
<jsp:fallback>插件無法啟動</jsp:fallback>
</jsp:plugin>
</td>
<%} %>
</tr>
<tr>
<%for(int i=0;i<allPicPath.size();i++){ %>
<td width="97" height="20" align="center">
<a href="showuser.jsp?&userID=<%=((Pic)allPicPath.get(i)).getOwner() %>">
<%=((Pic)allPicPath.get(i)).getOwner() %>
</a>
</td>
<%} %>
</tr>
<%} %>
<%-- 如果照片數不多于4張結束 --%>
<%-- 如果照片數不多于8張開始 --%>
<%if(allPicPath.size()<9&&allPicPath.size()>4){ %>
<!--第一行開始-->
<tr>
<%for(int i=0;i<4;i++){ %>
<td width="97" align="center" height="120">
<jsp:plugin code="com.ayi.web.applet.ShowImage.class"
codebase="upload/"
type="applet"
align="left"
width="97"
height="120"
iepluginurl="http://www.sun.com" >
<jsp:params>
<jsp:param name="picPath" value="<%=((Pic)allPicPath.get(i)).getPath() %>"/>
<jsp:param name="img_width" value="97"/>
<jsp:param name="img_height" value="120"/>
</jsp:params>
<jsp:fallback>插件無法啟動</jsp:fallback>
</jsp:plugin>
</td>
<%} %>
</tr>
<tr>
<%for(int i=0;i<4;i++){ %>
<td width="97" height="20" align="center">
<a href="showuser.jsp?&userID=<%=((Pic)allPicPath.get(i)).getOwner() %>">
<%=((Pic)allPicPath.get(i)).getOwner() %>
</a>
</td>
<%} %>
</tr>
<!--第一行結束-->
<!--第二行開始-->
<tr>
<%for(int i=4;i<allPicPath.size();i++){ %>
<td width="97" align="center" height="120">
<jsp:plugin code="com.ayi.web.applet.ShowImage.class"
codebase="upload/"
type="applet"
align="left"
width="97"
height="120"
iepluginurl="http://www.sun.com" >
<jsp:params>
<jsp:param name="picPath" value="<%=((Pic)allPicPath.get(i)).getPath() %>"/>
<jsp:param name="img_width" value="97"/>
<jsp:param name="img_height" value="120"/>
</jsp:params>
<jsp:fallback>插件無法啟動</jsp:fallback>
</jsp:plugin>
</td>
<%} %>
</tr>
<tr>
<%for(int i=4;i<allPicPath.size();i++){ %>
<td width="97" height="20" align="center">
<a href="showuser.jsp?&userID=<%=((Pic)allPicPath.get(i)).getOwner() %>">
<%=((Pic)allPicPath.get(i)).getOwner() %>
</a>
</td>
<%} %>
</tr>
<!--第二行結束-->
<%} %>
<%-- 如果照片數不多于8張結束 --%>
<%-- 如果照片數多于8張開始 --%>
<%if(allPicPath.size()>8){ %>
<!--第一行開始-->
<tr>
<%for(int i=0;i<4;i++){ %>
<td width="97" align="center" height="120">
<jsp:plugin code="com.ayi.web.applet.ShowImage.class"
codebase="upload/"
type="applet"
align="left"
width="97"
height="120"
iepluginurl="http://www.sun.com" >
<jsp:params>
<jsp:param name="picPath" value="<%=((Pic)allPicPath.get(i)).getPath() %>"/>
<jsp:param name="img_width" value="97"/>
<jsp:param name="img_height" value="120"/>
</jsp:params>
<jsp:fallback>插件無法啟動</jsp:fallback>
</jsp:plugin>
</td>
<%} %>
</tr>
<tr>
<%for(int i=0;i<4;i++){ %>
<td width="97" height="20" align="center">
<a href="showuser.jsp?&userID=<%=((Pic)allPicPath.get(i)).getOwner() %>">
<%=((Pic)allPicPath.get(i)).getOwner() %>
</a>
</td>
<%} %>
</tr>
<!--第一行結束-->
<!--第二行開始-->
<tr>
<%for(int i=4;i<8;i++){ %>
<td width="97" align="center" height="120">
<jsp:plugin code="com.ayi.web.applet.ShowImage.class"
codebase="upload/"
type="applet"
align="left"
width="97"
height="120"
iepluginurl="http://www.sun.com" >
<jsp:params>
<jsp:param name="picPath" value="<%=((Pic)allPicPath.get(i)).getPath() %>"/>
<jsp:param name="img_width" value="97"/>
<jsp:param name="img_height" value="120"/>
</jsp:params>
<jsp:fallback>插件無法啟動</jsp:fallback>
</jsp:plugin>
</td>
<%} %>
</tr>
<tr>
<%for(int i=4;i<8;i++){ %>
<td width="97" height="20" align="center">
<a href="showuser.jsp?&userID=<%=((Pic)allPicPath.get(i)).getOwner() %>">
<%=((Pic)allPicPath.get(i)).getOwner() %>
</a>
</td>
<%} %>
</tr>
<!--第二行結束-->
<%} %>
<%-- 如果照片數多于8張結束 --%>
</table>
<%-- 如果集合內沒有元素,即沒有照片 --%>
<%}else{ %>
<br />
目前還沒有照片<br />
<%} %>
<!--顯示照片結束-->
</td>
<td width="14" align="center" background="images/line_right.gif"></td>
</tr>
<tr>
<td width="12" height="20" align="center" background="images/line_left.gif"></td>
<td width="420" align="right" valign="middle" bgcolor="#E8E8E8" >
<%if(allPicPath.size()>8) {%>
<a href="allpic.jsp" ><img alt="更多照片" src="images/more.gif" border="0"/></a>
<%} %>
</td>
<td width="14" align="center" background="images/line_right.gif"></td>
</tr>
<tr>
<td width="12" height="15" align="center" background="images/corner_bottom_left.gif"></td>
<td width="420" align="center" background="images/line_bottom.gif"></td>
<td width="14" align="center" background="images/corner_bottom_right.gif"></td>
</tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -