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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="cn.js.fan.web.*"%>
  6. <%@ page import="com.redmoon.forum.plugin.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <%@ page import="com.redmoon.forum.treasure.*"%>
  9. <%@ page import="com.redmoon.forum.person.*"%>
  10. <%@ page import="com.redmoon.blog.*"%>
  11. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  12. <%
  13. String skincode = UserSet.getSkin(request);
  14. if (skincode.equals(""))
  15. skincode = UserSet.defaultSkin;
  16. SkinMgr skm = new SkinMgr();
  17. Skin skin = skm.getSkin(skincode);
  18. if (skin==null)
  19. skin = skm.getSkin(UserSet.defaultSkin);
  20. String skinPath = skin.getPath();
  21. %>
  22. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  23. <html><head>
  24. <meta http-equiv="pragma" content="no-cache">
  25. <link href="forum/<%=skinPath%>/skin.css" rel="stylesheet" type="text/css">
  26. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  27. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  28. <title><lt:Label res="res.label.usercenter" key="user_center"/> - <%=Global.AppName%></title>
  29. <style type="text/css">
  30. <!--
  31. .style1 {
  32. font-size: 14px;
  33. font-weight: bold;
  34. }
  35. -->
  36. </style>
  37. <body topmargin='0' leftmargin='0'>
  38. <%@ include file="forum/inc/header.jsp"%>
  39. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  40. <%
  41. if (!privilege.isUserLogin(request)) {
  42. response.sendRedirect("info.jsp?op=login&info=" + StrUtil.UrlEncode(SkinUtil.LoadString(request, "err_not_login")));
  43. return;
  44. }
  45. String userName = privilege.getUser(request);
  46. UserDb user = new UserDb();
  47. user = user.getUser(userName);
  48. String op = ParamUtil.get(request, "op");
  49. int myfacewidth=120,myfaceheight=150;
  50. String name="",lydate="",content="",topic="";
  51. String RegDate="",Gender="",RealPic="",email="",sign="",myface="";
  52. int experience=0;
  53. int credit=0;
  54. int addcount=0;
  55. RealPic = user.getRealPic();
  56. Gender = StrUtil.getNullStr(user.getGender());
  57. if (Gender.equals("M"))
  58. Gender = SkinUtil.LoadString(request, "res.label.forum.showtopic", "sex_man"); // "男";
  59. else if (Gender.equals("F"))
  60. Gender = SkinUtil.LoadString(request, "res.label.forum.showtopic", "sex_woman"); // "女";
  61. else
  62. Gender = SkinUtil.LoadString(request, "res.label.forum.showtopic", "sex_none"); // "不详";
  63. RegDate = com.redmoon.forum.ForumSkin.formatDate(request, user.getRegDate());
  64. experience = user.getExperience();
  65. credit = user.getCredit();
  66. addcount = user.getAddCount();
  67. email = user.getEmail(); 
  68. sign = user.getSign();
  69. myface = StrUtil.getNullStr(user.getMyface());
  70. myfacewidth = user.getMyfaceWidth();
  71. myfaceheight = user.getMyfaceHeight();
  72. %>
  73. <br>
  74. <%
  75. int pagesize = 10;
  76. Paginator paginator = new Paginator(request);
  77. TreasureUserDb tu = new TreasureUserDb();
  78. String sql = "select userName,treasureCode from " + tu.getTableName() + " where userName=" + StrUtil.sqlstr(userName);
  79. int total = tu.getObjectCount(sql);
  80. int curpage = paginator.getCurPage();
  81. paginator.init(total, pagesize);
  82. //设置当前页数和总页数
  83. int totalpages = paginator.getTotalPages();
  84. if (totalpages==0)
  85. {
  86. curpage = 1;
  87. totalpages = 1;
  88. }
  89. %>
  90. <table width='780' border="0" align="center" cellpadding='0' cellspacing='1' >
  91.   <tr>
  92.     <td colspan="2" height="25" align="center" background="forum/<%=skinPath%>/images/bg1.gif" class="text_title"><lt:Label res="res.label.usercenter" key="user_center"/></td>
  93.   </tr>
  94.   <tr>
  95.     <td width="18%" align="center" valign="top" bgcolor="#F5F5F5" class="head">&nbsp;&nbsp;
  96.         <table cellspacing=0 cellpadding=0 width="90%" align=center 
  97. border=0>
  98.           <tbody>
  99.             <tr>
  100.               <td align=left><table style="FILTER: glow(color=a4b6d7)">
  101.                   <caption>
  102.                   <b><font style="FONT-SIZE: 10pt" 
  103.                     color=#ffffff><%=user.getNick()%></font></b>
  104.                   </caption>
  105.               </table>
  106.                 <%
  107.   UserGroupDb ugd = user.getUserGroupDb();
  108.   if (!ugd.getCode().equals(UserGroupDb.EVERYONE)) {
  109.    out.print("<table><tr><td>" + ugd.getDesc() + "</td></tr></table>");
  110.   }
  111. %>
  112.                 </td>
  113.             </tr>
  114.             <tr>
  115.               <td align=left height=42><%if (myface.equals("")) {%>
  116.                   <img src="forum/images/face/<%=RealPic%>">
  117.                   <%}else{%>
  118.                   <img src="images/myface/<%=myface%>" width=<%=myfacewidth%> height=<%=myfaceheight%>>
  119.                   <%}%>
  120.               </td>
  121.             </tr>
  122.             <tr>
  123.               <td align=left height=17><img src="forum/images/<%=user.getLevelPic()%>"> <%=Gender%></td>
  124.             </tr>
  125.             <tr>
  126.               <td align=left height=54><lt:Label res="res.label.forum.showtopic" key="rank"/><%=user.getLevelDesc()%><br>
  127. <lt:Label res="res.label.forum.showtopic" key="experience"/><%=experience%><br>
  128. <lt:Label res="res.label.forum.showtopic" key="credit"/><%=credit%><br>
  129. <%
  130. ScoreMgr sm = new ScoreMgr();
  131. ScoreUnit su = sm.getScoreUnit("gold");
  132. out.print(StrUtil.toHtml(su.getName(request)));
  133. %>
  134. :<%=user.getGold()%><br>
  135. <lt:Label res="res.label.forum.showtopic" key="topic_count"/><%=addcount%> <br>
  136. <lt:Label res="res.label.forum.showtopic" key="topic_elite"/><%=user.getEliteCount()%><br>
  137. <lt:Label res="res.label.forum.showtopic" key="reg_date"/><%=RegDate%> <br>
  138. <lt:Label res="res.label.forum.showtopic" key="online_status"/><%
  139. OnlineUserDb ou = new OnlineUserDb();
  140. ou = ou.getOnlineUserDb(user.getName());
  141. if (ou.isLoaded())
  142. out.print(SkinUtil.LoadString(request, "res.label.forum.showtopic", "online_status_yes")); // "在线");
  143. else
  144. out.print(SkinUtil.LoadString(request, "res.label.forum.showtopic", "online_status_no")); // "离线");
  145. %>
  146. <%
  147. com.redmoon.forum.Config cfg1 = new com.redmoon.forum.Config();
  148. if (cfg1.getBooleanProperty("forum.showFlowerEgg")) {
  149. UserPropDb up = new UserPropDb();
  150. up = up.getUserPropDb(user.getName());
  151. %>
  152. <BR>
  153. <img src="images/flower.gif">&nbsp;(<%=up.getInt("flower_count")%>)&nbsp;&nbsp;&nbsp; <img src="images/egg.gif">&nbsp;(<%=up.getInt("egg_count")%>)
  154. <%}
  155. %></td>
  156.             </tr>
  157.           </tbody>
  158.         </table>
  159.           
  160.     </td>
  161.     <td width="82%" align="center" valign="top" bgcolor="#F7F7F7" class="head"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">
  162.       <tr>
  163.         <td align="left" valign="top" bgcolor="#F7F7F7" class="head"><a href="myinfo.jsp"><lt:Label res="res.label.usercenter" key="modify_myinfo"/></a>&nbsp;</td>
  164.         <td width="55%" align="left" valign="top" bgcolor="#F7F7F7" class="head"><a href="javascript:hopenWin('../message/message.jsp',320,260)"></a><a href="forum/myfriend.jsp"><lt:Label res="res.label.usercenter" key="list_myfriend"/></a></td>
  165.       </tr>
  166.       <tr>
  167.         <td align="left" valign="top" bgcolor="#F7F7F7" class="head"><a href="forum/mytopic.jsp?action=mytopic"><lt:Label res="res.label.usercenter" key="mytopic"/></a></td>
  168.         <td align="left" valign="top" bgcolor="#F7F7F7" class="head"><a href="javascript:hopenWin('message/send.jsp',320,260)"><lt:Label res="res.label.usercenter" key="send_bbs_message"/></a></td>
  169.       </tr>
  170.       <tr>
  171.         <td align="left" valign="top" bgcolor="#F7F7F7" class="head"><a href="forum/myfavoriate.jsp"><lt:Label res="res.label.usercenter" key="myfavoriate"/></a>&nbsp;</td>
  172.         <td align="left" valign="top" bgcolor="#F7F7F7" class="head"><%
  173. if (Global.hasBlog) {
  174. UserConfigDb ucd = new UserConfigDb();
  175. ucd = ucd.getUserConfigDb(userName);
  176. if (ucd.isLoaded()) {
  177. %>
  178.           <a href="blog/user/frame.jsp?userName=<%=StrUtil.UrlEncode(userName)%>"><lt:Label res="res.label.usercenter" key="blog_mgr"/></a>
  179.           <%}else{%>
  180.           <a href="blog/user/userconfig_add.jsp"><lt:Label res="res.label.usercenter" key="userconfig_add"/></a>
  181.           <%}
  182. }%></td>
  183.       </tr>
  184.       <tr>
  185.         <td colspan="2" align="left" valign="top" bgcolor="#F7F7F7" class="head"><a title="<lt:Label res="res.label.usercenter" key="ad_msg"/>" href="#"><lt:Label res="res.label.usercenter" key="ad_link"/></a> : <%=Global.getRootPath()%>/ad_user_link.jsp?userId=<%=user.getId()%></td>
  186.         </tr>
  187.       <tr>
  188.         <td colspan="2" align="center" valign="top" bgcolor="#F7F7F7" class="head"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  189.             <tr>
  190.               <td width="15%"><lt:Label res="res.label.usercenter" key="disk_space"/></td>
  191.               <td width="53%" height="22"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  192.                   <tr>
  193.                     <td height=16 bgcolor="#CCCCCC"><%
  194. int wpercent = (int)Math.round((double)user.getDiskSpaceUsed()/user.getDiskSpaceAllowed()*100);
  195. %>
  196.                         <img src=forum/images/vote/bar1.gif width="<%=wpercent%>%" height=16></td>
  197.                   </tr>
  198.               </table></td>
  199.               <td width="32%">&nbsp;<lt:Label res="res.label.usercenter" key="disk_space_used"/><%=wpercent%>%&nbsp;(<%=user.getDiskSpaceUsed()%>)<lt:Label res="res.label.usercenter" key="disk_space_allowed"/><%=NumberUtil.round((double)user.getDiskSpaceAllowed()/1024000, 1)%>M</td>
  200.               </tr>
  201.                 </table></td>
  202.         </tr>
  203.       
  204.     </table>
  205.         <table width="100%" border="0" cellspacing="1" bgcolor="#FFFFFF">
  206.           <tr>
  207.             <td height="24" colspan="6" bgcolor="#F7F7F7">&nbsp;<strong><lt:Label res="res.label.usercenter" key="user_priv"/></strong></td>
  208.           </tr>
  209.           <tr>
  210.             <td width="18%" height="24" align="center" bgcolor="#F7F7F7">
  211.               <lt:Label res="res.forum.person.UserPrivDb" key="add_topic"/>            </td>
  212.             <td width="17%" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="reply_topic"/>            </td>
  213.             <td width="17%" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="attach_upload"/>            </td>
  214.             <td width="15%" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="attach_download"/>            </td>
  215.             <td width="16%" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="vote"/>            </td>
  216.             <td width="17%" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="search"/>            </td>
  217.           </tr>
  218.           <tr>
  219.             <td height="24" align="center" bgcolor="#F7F7F7">
  220. <%
  221. UserPrivDb upd = new UserPrivDb();
  222. upd = upd.getUserPrivDb(user.getName());
  223. if (upd.getBoolean("add_topic"))
  224. out.print("√");
  225. else
  226. out.print("×");
  227. %> </td>
  228.             <td align="center" bgcolor="#F7F7F7"><%
  229. if (upd.getBoolean("reply_topic"))
  230. out.print("√");
  231. else
  232. out.print("×");
  233. %></td>
  234.             <td align="center" bgcolor="#F7F7F7"><%
  235. if (upd.getBoolean("attach_upload"))
  236. out.print("√");
  237. else
  238. out.print("×");
  239. %></td>
  240.             <td align="center" bgcolor="#F7F7F7"><%
  241. if (upd.getBoolean("attach_download"))
  242. out.print("√");
  243. else
  244. out.print("×");
  245. %></td>
  246.             <td align="center" bgcolor="#F7F7F7"><%
  247. if (upd.getBoolean("vote"))
  248. out.print("√");
  249. else
  250. out.print("×");
  251. %></td>
  252.             <td align="center" bgcolor="#F7F7F7"><%
  253. if (upd.getBoolean("search"))
  254. out.print("√");
  255. else
  256. out.print("×");
  257. %></td>
  258.           </tr>
  259.           <tr>
  260.             <td height="24" align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="attach_day_count"/>            </td>
  261.             <td align="center" bgcolor="#F7F7F7">              <lt:Label res="res.forum.person.UserPrivDb" key="attach_size"/>            </td>
  262.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  263.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  264.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  265.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  266.           </tr>
  267.           <tr>
  268.             <td height="24" align="center" bgcolor="#F7F7F7"><%=upd.getInt("attach_day_count")%></td>
  269.             <td align="center" bgcolor="#F7F7F7"><%=upd.getInt("attach_size")%>(K)</td>
  270.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  271.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  272.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  273.             <td align="center" bgcolor="#F7F7F7">&nbsp;</td>
  274.           </tr>
  275.         </table>
  276.         <br>
  277.         <table width="98%" height="153" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  278.           <tr>
  279.             <td height=20 align="center" class="thead style1"><lt:Label res="res.label.usercenter" key="show_baby"/></td>
  280.           </tr>
  281.           <tr>
  282.             <td height="133" valign="top"><br>
  283.                 <table width="86%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
  284.                   <tr>
  285.                     <td align="right"><div><lt:Label res="res.label.usercenter" key="right_records"/> <b><%=paginator.getTotal() %></b> <lt:Label res="res.label.usercenter" key="per_page"/> <b><%=paginator.getPageSize() %></b> <lt:Label res="res.label.usercenter" key="page"/> <b><%=paginator.getCurrentPage() %>/<%=paginator.getTotalPages() %></b></div></td>
  286.                   </tr>
  287.                 </table>
  288.               <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666"">
  289.                   <tr align="center" bgcolor="#F1EDF3">
  290.                     <td width="41%" height="22"><lt:Label res="res.label.usercenter" key="baby_name"/></td>
  291.                     <td width="26%" height="22"><lt:Label res="res.label.usercenter" key="buy_date"/></td>
  292.                     <td width="18%"><lt:Label res="res.label.usercenter" key="count"/></td>
  293.                     <td width="15%"><%=SkinUtil.LoadString(request,"op")%></td>
  294.                   </tr>
  295.                   <%
  296. Vector v = tu.list(sql, (curpage-1)*pagesize, curpage*pagesize-1);
  297. TreasureMgr tmg = new TreasureMgr();
  298. Iterator ir = v.iterator();
  299. int i = 0;
  300. while (ir.hasNext()) {
  301. tu = (TreasureUserDb)ir.next();
  302. i++;
  303. %>
  304.                   <form id="form<%=i%>" name="form<%=i%>" action="?op=modify" method="post">
  305.                     <tr align="center">
  306.                       <td height="22" bgcolor="#FFFFFF"><%
  307. String treasureCode = tu.getTreasureCode();
  308. TreasureUnit tun = tmg.getTreasureUnit(treasureCode);
  309. out.print(tun.getName());
  310. %>
  311.                       </td>
  312.                       <td height="22" bgcolor="#FFFFFF"><%=DateUtil.format(tu.getBuyDate(), "yy-MM-dd")%> </td>
  313.                       <td bgcolor="#FFFFFF"><%=tu.getAmount()%></td>
  314.                       <td height="22" bgcolor="#FFFFFF"><a href="forum/treasure_show.jsp?code=<%=StrUtil.UrlEncode(tu.getTreasureCode())%>"><lt:Label res="res.label.usercenter" key="view"/></a></td>
  315.                     </tr>
  316.                   </form>
  317.                 <%}%>
  318.               </table>
  319.               <table width="86%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  320.                   <tr>
  321.                     <td height="23"><div align="right">
  322.                         <%
  323. String querystr = "userName=" + StrUtil.UrlEncode(userName);
  324.     out.print(paginator.getCurPageBlock("?"+querystr));
  325. %>
  326.                     </div></td>
  327.                   </tr>
  328.               </table></td>
  329.           </tr>
  330.     </table></td>
  331.   </tr>
  332. </table>
  333. <%@ include file="forum/inc/footer.jsp"%>
  334. </td> </tr>             
  335.       </table>                                        
  336.        </td>                                        
  337.      </tr>                                        
  338.  </table>                                                                      
  339. </body>                                        
  340. </html>                            
  341.