listphoto.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="com.redmoon.blog.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="cn.js.fan.module.photo.*"%>
  5. <%@ page import="cn.js.fan.util.*"%>
  6. <%@ page import="cn.js.fan.web.*"%>
  7. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  8. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  9. <%
  10. String userName = ParamUtil.get(request, "userName");
  11. if (userName.equals("")) {
  12. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request,"res.label.blog.list","not_name")));
  13. return;
  14. }
  15. UserConfigDb ucd = new UserConfigDb();
  16. ucd = ucd.getUserConfigDb(userName);
  17. if (!ucd.isLoaded()) {
  18. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request,"res.label.blog.list","activate_blog_fail")));
  19. return;
  20. }
  21. String skinPath = "skin/" + ucd.getSkin();
  22. %>
  23. <html>
  24. <head>
  25. <title><%=ucd.getPenName()%> - <%=Global.AppName%></title>
  26. <LINK href="<%=skinPath%>/skin.css" type=text/css rel=stylesheet>
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. </head>
  29. <body>
  30. <%@ include file="header.jsp"%>
  31. <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class=blog_table_main>
  32.   <tr>
  33.     <td width="220"><%@ include file="left.jsp"%></td>
  34.     <td valign="top" class="blog_td_main"><%
  35. String privurl = StrUtil.getUrl(request);
  36. PhotoDb pd = new PhotoDb();
  37. String strcurpage = StrUtil.getNullString(request.getParameter("CPages"));
  38. if (strcurpage.equals(""))
  39. strcurpage = "1";
  40. if (!StrUtil.isNumeric(strcurpage)) {
  41. out.print(StrUtil.makeErrMsg(SkinUtil.LoadString(request, "err_id")));
  42. return;
  43. }
  44. String sql;
  45. sql = "select id from " + pd.getTableName() + " where userName=" + StrUtil.sqlstr(userName) + " ORDER BY addDate desc";
  46.     int total = 0;
  47. int pagesize = 20;
  48. int curpage = Integer.parseInt(strcurpage);
  49. ListResult lr = pd.ListPhotos(sql, curpage, pagesize);
  50. if (lr!=null)
  51. total = lr.getTotal();
  52. Paginator paginator = new Paginator(request, total, pagesize);
  53. // 设置当前页数和总页数
  54. int totalpages = paginator.getTotalPages();
  55. if (totalpages==0)
  56. {
  57. curpage = 1;
  58. totalpages = 1;
  59. }
  60.         Iterator irphoto = null;
  61. if (lr!=null)
  62. irphoto = lr.getResult().iterator();
  63. %>
  64.       <table width="98%" border="0" class="p9">
  65.         <tr>
  66.           <td width="44%" align="left"></td>
  67.           <td width="56%" align="right"><%=paginator.getPageStatics(request)%></td>
  68.         </tr>
  69.       </table>
  70.       <%
  71. String id="",topic = "",name="",lydate="",rename="",redate="";
  72. int level=0,iselite=0,islocked=0,expression=0;
  73. int i = 0,recount=0,hit=0,type=0;
  74. ForumDb forum = new ForumDb();
  75. %>
  76.       <%
  77. if (irphoto!=null)   
  78. while (irphoto.hasNext()) {
  79.     pd = (PhotoDb) irphoto.next(); 
  80.   i++;
  81.   %>
  82.       <table bordercolor=#edeced cellspacing=0 cellpadding=5 width="98%" align=center border=0>
  83.         <tbody>
  84.           
  85.           <tr>
  86.             <td width="77%" align=left bgcolor=#f8f8f8><a href="showphoto.jsp?id=<%=pd.getId()%>&userName=<%=StrUtil.UrlEncode(userName)%>"><%=pd.getTitle()%></a></td>
  87.             <td width="23%" align=left bgcolor=#f8f8f8><%=pd.getAddDate()%></td>
  88.           </tr>
  89.           <tr>
  90.             <td height=1 colspan="2" align=left background="../images/comm_dot.gif"></td>
  91.           </tr>
  92.         </tbody>
  93.       </table>
  94. <%}%>
  95.       <table width="98%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  96.         <tr>
  97.           <td height="23" align="right"><%
  98. String querystr = "";
  99. out.print(paginator.getPageBlock(request,"listtopic.jsp?"+querystr));
  100. %>
  101.             &nbsp;&nbsp;</td>
  102.         </tr>
  103.       </table></td>
  104.   </tr>
  105. </table>
  106. <%@ include file="footer.jsp"%>
  107. </body>
  108. </html>