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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8"%>
  2. <%@ page import="com.redmoon.blog.UserBlog"%>
  3. <%@ page import="com.redmoon.blog.UserDirDb"%>
  4. <%@ page import="java.util.*"%>
  5. <%@ page import="cn.js.fan.util.*"%>
  6. <%@ page import="com.redmoon.forum.person.UserDb"%>
  7. <%@ page import="com.redmoon.forum.MsgDb"%>
  8. <%@ page import="com.redmoon.forum.ThreadBlockIterator "%>
  9. <%@ page import="com.redmoon.forum.ForumDb "%>
  10. <%@ page import="com.redmoon.forum.* "%>
  11. <%@ page import="com.redmoon.forum.plugin.DefaultRender "%>
  12. <%@ page import="cn.js.fan.module.nav.*"%>
  13. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  14. <%
  15. // 取得显示的年月 
  16. int leftyear,leftmonth;
  17. try {
  18. leftyear = ParamUtil.getInt(request, "year");
  19. leftmonth = ParamUtil.getInt(request, "month");
  20. }
  21. catch (Exception e) {
  22.     Calendar cal = Calendar.getInstance();
  23.     leftyear = cal.get(cal.YEAR);
  24.     leftmonth = cal.get(cal.MONTH) + 1;
  25. }
  26. if (leftmonth>12)
  27. leftmonth = 12;
  28. if (leftmonth<1)
  29. leftmonth = 1;
  30. UserDb leftUser = new UserDb();
  31. leftUser = leftUser.getUser(userName);
  32. %>
  33. <style type="text/css">
  34. <!--
  35. .STYLE2 {color: #FFFFFF}
  36. -->
  37. </style>
  38. <table width="100%" border="0" class="blog_left_table">
  39.   <tr>
  40.     <td height="32" align="center">
  41. <table width="100%" border="0">
  42.       <tr>
  43.         <td height="5"></td>
  44.       </tr>
  45.     </table>
  46. <a class="blog_link_username" href="../userinfo.jsp?username=<%=StrUtil.UrlEncode(userName)%>"><%=ucd.getPenName()%></a> </td>
  47.   </tr>
  48.   <tr>
  49.     <td align="center"><font color="#FF0000">
  50.       <%
  51. int myfacewidth=120,myfaceheight=150;
  52. String myface = leftUser.getMyface();
  53. myfacewidth = leftUser.getMyfaceWidth();
  54. myfaceheight = leftUser.getMyfaceHeight();
  55. String RealPic = leftUser.getRealPic();  
  56.   if (myface.equals("")) {%>
  57.       <img src="../forum/images/face/<%=RealPic%>"/>
  58.       <%}else{%>
  59.       <img src="../images/myface/<%=myface%>" name="tus" width="<%=myfacewidth%>" height="<%=myfaceheight%>" id="tus" />
  60.       <%}%>
  61.     </font></td>
  62.   </tr>
  63.   <tr>
  64.     <td align="center" height="10"></td>
  65.   </tr>
  66.   <tr>
  67.     <td align="center">
  68. <div id=div_cal></div>
  69.   <script>
  70.   var userName = "<%=StrUtil.UrlEncode(userName)%>";
  71.   </script>   
  72.   <script src="inc/calendar.js">
  73.   </script>
  74.   <script>
  75.   newCalendar("div_cal", <%=leftyear%>, <%=leftmonth%>);
  76.   </script>
  77.   <%
  78.   // 取得year-month这个月中的所有日志,遍历后对日历初始化
  79.   UserBlog bu = new UserBlog(userName);
  80.   int[] dayCountAry = bu.getBlogDayCount(leftyear, leftmonth);
  81.   int dayLen = dayCountAry.length;
  82.   %>
  83.   <script>
  84.   <%
  85.   Calendar cal = Calendar.getInstance();
  86.   // int dayOfMonth = cal.get(cal.DAY_OF_MONTH);   
  87.   for (int n=1; n<dayLen; n++) {
  88.    if (dayCountAry[n]>0) {
  89. String totle_log = SkinUtil.LoadString(request,"res.label.blog.left", "totle_log");
  90. totle_log = StrUtil.format(totle_log, new Object[] {"" + dayCountAry[n]});
  91.   %>
  92. // alert(day<%=n%>.innerHTML);
  93. day<%=n%>.innerHTML = "<table width=100% cellSpacing=0 cellPadding=1 class=table_day><tr><td align=center><a href='listdayblog.jsp?userName=<%=StrUtil.UrlEncode(userName)%>&y=<%=leftyear%>&m=<%=leftmonth%>&d=<%=n%>' title='<%=totle_log%>'>" + <%=n%> +"</a></td></tr></table>";
  94.   <% }
  95.   }%>
  96.   </script> </td>
  97.   </tr>
  98.   
  99.   <tr>
  100.     <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  101.         
  102.         <tr>
  103.           <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  104.             <tr>
  105.               <td class="blog_td_spacer_up"></td>
  106.             </tr>
  107.             <tr>
  108.               <td class="blog_td_title"><li class="titleBar">&nbsp;&nbsp;&nbsp;<lt:Label res="res.label.blog.left" key="my_column"/></li></td>
  109.             </tr>
  110.             <tr>
  111.               <td class="blog_td_spacer_down"></td>
  112.             </tr>
  113.           </table>
  114.             <table width="100%"  border="0" align="center" cellpadding="3" cellspacing="0">
  115.               <tr align="center">
  116.                 <td>&nbsp;</td>
  117.                 <td height="22" align="left"><a href="<%=rootpath%>/blog/myblog.jsp?blogUserDir=<%=UserDirDb.DEFAULT%>&userName=<%=StrUtil.UrlEncode(userName)%>"><%=UserDirDb.getDefaultName()%></a></td>
  118.               </tr>            
  119.             <%
  120. UserDirDb sb1 = new UserDirDb();
  121. Vector leftv = sb1.list(userName);
  122. Iterator leftir = leftv.iterator();
  123. while (leftir.hasNext()) {
  124. UserDirDb as = (UserDirDb)leftir.next();
  125. %>
  126.               <tr align="center">
  127.                 <td width="14%">&nbsp;</td>
  128.                 <td width="86%" height="22" align="left"><a href="<%=rootpath%>/blog/myblog.jsp?userName=<%=StrUtil.UrlEncode(userName)%>&blogUserDir=<%=StrUtil.UrlEncode(as.getCode())%>"><%=as.getDirName()%></a></td>
  129.               </tr>
  130.             <%}%>
  131.           </table></td>
  132.         </tr>
  133.       </table></td>
  134.   </tr>
  135.   <tr>
  136.     <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  137.         <tr>
  138.           <td class="blog_td_spacer_up"></td>
  139.         </tr>
  140.         <tr>
  141.           <td class="blog_td_title"><li class="titleBar">&nbsp;&nbsp;&nbsp;<lt:Label res="res.label.blog.left" key="new_article"/></li> </td>
  142.         </tr>
  143.         <tr>
  144.           <td class="blog_td_spacer_down"></td>
  145.         </tr>
  146.       </table>
  147.   <%
  148. MsgDb leftMsgDb = new MsgDb();
  149. String leftsql = SQLBuilder.getNewMsgOfBlog(userName);
  150.         ThreadBlockIterator leftirmsg = leftMsgDb.getThreads(leftsql, leftMsgDb.getVirtualBoardcodeOfBlogUser(userName, ""), 0, 10);
  151. while (leftirmsg.hasNext()) {
  152. leftMsgDb = (MsgDb) leftirmsg.next();%>
  153. <table width="100%" border="0">
  154.       <tr>
  155.         <td width="14%">&nbsp;</td>
  156.         <td><a href="../forum/showblog.jsp?rootid=<%=leftMsgDb.getId()%>" title="<%=leftMsgDb.getTitle()%>"><%=StrUtil.getLeft(leftMsgDb.getTitle(), 26)%></a></td>
  157.       </tr>
  158.     </table>
  159. <%}
  160. %> </td>
  161.   </tr>
  162.   <tr>
  163.     <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  164.         <tr>
  165.           <td class="blog_td_spacer_up"></td>
  166.         </tr>
  167.         <tr>
  168.           <td class="blog_td_title"><li class="titleBar">&nbsp;&nbsp;&nbsp;<lt:Label res="res.label.blog.left" key="new_comment"/></li> </td>
  169.         </tr>
  170.         <tr>
  171.           <td class="blog_td_spacer_down"></td>
  172.         </tr>
  173.       </table>
  174. <%
  175. leftsql = SQLBuilder.getNewReplySqlOfBlog(userName);  // "select id from sq_message where isBlog=1 and replyRootName=" + StrUtil.sqlstr(userName) + " order by lydate desc";
  176. ListResult leftlr = leftMsgDb.list(leftsql, 1, 10);
  177. DefaultRender leftRender = new DefaultRender();
  178. if (leftlr!=null) {
  179. leftv = leftlr.getResult();
  180. leftir = leftv.iterator();
  181. while (leftir.hasNext()) {
  182. leftMsgDb = (MsgDb)leftir.next();
  183. if (leftMsgDb.getMsgDb(leftMsgDb.getRootid()).getCheckStatus()==MsgDb.CHECK_STATUS_PASS) {
  184. %>
  185. <table width="100%" border="0">
  186.               <tr>
  187.                 <td width="14%">&nbsp;</td>
  188.                 <td><a href="../userinfo.jsp?username=<%=leftMsgDb.getName()%>">[<%=um.getUser(leftMsgDb.getName()).getNick()%>]</a>&nbsp;&nbsp;&nbsp;<a href="../forum/showblog.jsp?rootid=<%=leftMsgDb.getRootid()%>&amp;op=allcomm#<%=leftMsgDb.getId()%>"><%=leftMsgDb.getTitle()%></a></td>
  189.               </tr>
  190.             </table>
  191. <% }
  192. }
  193. }
  194. %> <table width="100%" border="0" cellpadding="0" cellspacing="0">
  195.           <tr>
  196.             <td class="blog_td_spacer_up"></td>
  197.           </tr>
  198.           <tr>
  199.             <td class="blog_td_title"><li class="titleBar">&nbsp;&nbsp;&nbsp;<lt:Label res="res.label.blog.left" key="blog_statistics"/></li></td>
  200.           </tr>
  201.           <tr>
  202.             <td class="blog_td_spacer_down"></td>
  203.           </tr>
  204.           <tr>
  205.             <td><table width="100%" border="0">
  206.               <tr>
  207.                 <td width="14%">&nbsp;</td>
  208.                 <td><lt:Label res="res.label.blog.left" key="article"/><%=ucd.getMsgCount()%></td>
  209.               </tr>
  210.               <tr>
  211.                 <td>&nbsp;</td>
  212.                 <td><lt:Label res="res.label.blog.left" key="comment"/><%=ucd.getReplyCount()%></td>
  213.               </tr>
  214.               <tr>
  215.                 <td>&nbsp;</td>
  216.                 <td><lt:Label res="res.label.blog.left" key="visit"/><%=ucd.getViewCount()%></td>
  217.               </tr>
  218.             </table></td>
  219.           </tr>
  220.         </table></td>
  221.   </tr>
  222.   <tr>
  223.     <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
  224.         <tr>
  225.           <td class="blog_td_spacer_up"></td>
  226.         </tr>
  227.         <tr>
  228.           <td class="blog_td_title"><li class="titleBar">&nbsp;&nbsp;&nbsp;<lt:Label res="res.label.blog.left" key="link"/></li> </td>
  229.         </tr>
  230.         <tr>
  231.           <td class="blog_td_spacer_down"></td>
  232.         </tr>
  233.       </table>
  234.   <%
  235. LinkDb leftld = new LinkDb();
  236. String listsql = "select id from " + leftld.getTableName() + " where userName=" + StrUtil.sqlstr(userName) + " and kind=" + StrUtil.sqlstr(leftld.KIND_USER_BLOG) + " order by sort";
  237. Iterator leftirlink = leftld.list(listsql).iterator();
  238. while (leftirlink.hasNext())
  239. {
  240. leftld = (LinkDb) leftirlink.next();
  241. %>
  242.       <table width="100%" border="0" cellspacing="0" cellpadding="0" class="p9">
  243.         <tr>
  244.           <td width="14%" height="20">&nbsp;</td>
  245.           <td>&nbsp;<span class="dirItem">
  246.   <a target="_blank" href="<%=leftld.getUrl()%>" title="<%=leftld.getTitle()%>">
  247. <%if (leftld.getImage()!=null && !leftld.getImage().equals("")) {%>
  248. <img src="../<%=leftld.getImage()%>" border=0>
  249. <%}else{%>
  250. <%=leftld.getTitle()%>
  251. <%}%>
  252.   </a>
  253.   </span></td>
  254.         </tr>
  255.       </table>
  256.     <%}%></td>
  257.   </tr>
  258. </table>