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

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="cn.js.fan.web.*"%>
  7. <%@ page import="com.redmoon.forum.person.UserDb"%>
  8. <%@ page import="com.redmoon.blog.*"%>
  9. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  10. <jsp:useBean id="leftprivilege" scope="page" class="com.redmoon.forum.Privilege"/>
  11. <%
  12. String leftprivurl = StrUtil.getUrl(request);
  13. UserConfigDb leftucd = new UserConfigDb();
  14. %>
  15. <table width="100%" border="0" class="blog_left_table">
  16.   <tr>
  17.     <td align="center" valign="top">
  18.       <table width="240" border="0" align="center" cellpadding="0" cellspacing="0">
  19.         <tr>
  20.           <td height="10"></td>
  21.         </tr>
  22.         <tr>
  23.           <td height="25" background="images/button-bg-01.gif" class="line4t" ><div style="PADDING-left:18px;padding-top:3px; "><img src="images/subj.gif" width="16" height="15" align="absmiddle" /> &nbsp;<lt:Label res="res.label.blog.frame" key="user_login"/></div></td>
  24.         </tr>
  25.         <tr>
  26.           <td height="10"></td>
  27.         </tr>
  28.         <%if (!leftprivilege.isUserLogin(request)) {%>
  29.         <tr>
  30.           <td height="13" bgcolor="#FFFFFF" class="line4t" style="padding-top:6px; padding-left:15px; padding-right:15px;"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  31.               <form action="../login.jsp" method="post" name="form1" id="form1">
  32.                 <tr>
  33.                   <td><lt:Label res="res.label.blog.frame" key="name"/></td>
  34.                   <td><input name="name" id="name" size="14" />                  </td>
  35.                 </tr>
  36.                 <tr>
  37.                   <td><lt:Label res="res.label.blog.frame" key="pwd"/></td>
  38.                   <td><input name="pwd" type="password" id="pwd" size="14" />
  39.                       <input type="hidden" name="privurl" value="<%=leftprivurl%>" /></td>
  40.                 </tr>
  41.                 <tr>
  42.                   <td><lt:Label res="res.label.blog.frame" key="test_code"/></td>
  43.                   <td><input name="validateCode" type="text" id="validateCode" size="4" style="width:50" />
  44.                       <img src="../validatecode.jsp" width="58" height="20" align="absmiddle" /></td>
  45.                 </tr>
  46.                 <tr>
  47.                   <td>&nbsp;</td>
  48.                   <td height="28"><input type="button" name="register" value="<lt:Label res="res.label.blog.frame" key="register"/>" onclick="window.location.href='../regist.jsp'"/>
  49.       &nbsp;&nbsp;
  50.                       <input name="login" type="submit" value="<lt:Label res="res.label.blog.frame" key="login"/>"/>
  51.                   &nbsp;</td>
  52.                 </tr>
  53.               </form>
  54.           </table></td>
  55.         </tr>
  56.         <%}else{%>
  57.         <tr>
  58.           <td height="13" bgcolor="#FFFFFF" class="line4t" style="padding-top:6px; padding-left:15px; padding-right:15px;"><%
  59. String userName = leftprivilege.getUser(request);
  60. UserDb me = new UserDb();
  61. me = me.getUser(userName);
  62. String myface = me.getMyface();
  63.   %>
  64.           <jsp:useBean id="Msg" scope="page" class="com.redmoon.forum.message.MessageMgr"/>
  65.           <%
  66. int msgcount = 0;
  67. msgcount = Msg.getNewMsgCount(request);
  68. String welcome_you = SkinUtil.LoadString(request,"res.label.blog.frame", "welcome_you");
  69. welcome_you = StrUtil.format(welcome_you, new Object[] {Global.AppName});
  70.   %>
  71.               <table width="100%" border="0" cellspacing="0" cellpadding="0">
  72.                 <tr>
  73.                   <td height="22"><%=welcome_you%></td>
  74.                 </tr>
  75.                 <tr>
  76.                   <td height="22"><lt:Label res="res.label.blog.frame" key="user"/><%=userName%></td>
  77.                 </tr>
  78.                 <tr>
  79.                   <td height="22"><lt:Label res="res.label.blog.frame" key="before_login"/><%=DateUtil.format(me.getLastTime(), "yyyy-MM-dd")%></td>
  80.                 </tr>
  81.                 <tr>
  82.                   <td height="22"><a href="../usercenter.jsp"><lt:Label res="res.label.blog.frame" key="user_center"/></a> <a href="myblog.jsp?userName=<%=StrUtil.UrlEncode(userName)%>"><lt:Label res="res.label.blog.frame" key="my_blog"/></a></td>
  83.                 </tr>
  84.                 <tr>
  85.                   <td height="22"><a href="../message/message.jsp"><lt:Label res="res.label.blog.frame" key="message"/></a>(<font class="redfont"><%=msgcount%></font>)&nbsp;<a href="../exit.jsp?privurl=<%=leftprivurl%>"><u><lt:Label res="res.label.blog.frame" key="exit_blog"/></u></a></td>
  86.                 </tr>
  87.             </table></td>
  88.         </tr>
  89.     </table>
  90.   <%}%>
  91.   <table width="240" border="0" align="center" cellpadding="0" cellspacing="0">
  92.         <tr>
  93.           <td height="10"></td>
  94.         </tr>
  95.         <tr>
  96.           <td height="25" background="images/button-bg-01.gif" class="line4t" ><div style="PADDING-left:18px;padding-top:3px; "><img src="images/subj.gif" width="16" height="15" align="absmiddle" /> &nbsp;<lt:Label res="res.label.blog.frame" key="blog_star"/></div></td>
  97.         </tr>
  98.         <tr>
  99.           <td height="10"></td>
  100.         </tr>
  101.         <tr>
  102.           <td height="186" valign="top" bgcolor="#FFFFFF" class="line4t"><%
  103. BlogDb bd = new BlogDb();
  104. bd = bd.getBlogDb();
  105. String star = StrUtil.getNullString(bd.getStar());
  106. if (!star.equals("")) {
  107. %>
  108.               <table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  109.                 <tr>
  110.                   <td align="center">&nbsp;</td>
  111.                 </tr>
  112.                 <tr>
  113.                   <td align="center" bgcolor="#F7F7F7"><%
  114.       UserConfigDb leftleftucd = new UserConfigDb();
  115. leftleftucd = leftleftucd.getUserConfigDb(star);
  116. UserDb user = new UserDb();
  117. user = user.getUser(star);
  118. int myfacewidth=120,myfaceheight=150;
  119. String myface = user.getMyface();
  120. myfacewidth = user.getMyfaceWidth();
  121. myfaceheight = user.getMyfaceHeight();
  122. String RealPic = user.getRealPic();  
  123.     if (myface.equals("")) {%>
  124.                       <img src="../forum/images/face/<%=RealPic%>"/>
  125.                       <%}else{%>
  126.                       <img src="../images/myface/<%=myface%>" name="tus" width="<%=myfacewidth%>" height="<%=myfaceheight%>" id="tus" />
  127.                       <%}%>
  128.                   </td>
  129.                 </tr>
  130.                 <tr>
  131.                   <td height="5" bgcolor="#F7F7F7"></td>
  132.                 </tr>
  133.                 <tr>
  134.                   <td bgcolor="#F7F7F7" >&nbsp;<lt:Label res="res.label.blog.frame" key="blog_left"/><a href="myblog.jsp?userName=<%=StrUtil.UrlEncode(star)%>" target="_blank"><%=leftleftucd.getTitle()%></a></td>
  135.                 </tr>
  136.                 <tr>
  137.                   <td bgcolor="#F7F7F7">&nbsp;<lt:Label res="res.label.blog.frame" key="introduction"/><%=leftleftucd.getSubtitle()%></td>
  138.                 </tr>
  139.                 <tr>
  140.                   <td bgcolor="#F7F7F7">&nbsp;<lt:Label res="res.label.blog.frame" key="article"/><%=leftleftucd.getMsgCount()%></td>
  141.                 </tr>
  142.                 <tr>
  143.                   <td bgcolor="#F7F7F7">&nbsp;<lt:Label res="res.label.blog.frame" key="comment"/><%=leftleftucd.getReplyCount()%></td>
  144.                 </tr>
  145.                 <tr>
  146.                   <td bgcolor="#F7F7F7">&nbsp;<lt:Label res="res.label.blog.frame" key="visit"/><%=leftleftucd.getViewCount()%></td>
  147.                 </tr>
  148.               </table>
  149.             <%
  150. }
  151. %>
  152.           </td>
  153.         </tr>
  154.         <tr>
  155.           <td height="8"></td>
  156.         </tr>
  157.       </table>
  158.       <table width="240" border="0" align="center" cellpadding="0" cellspacing="0">
  159.         <tr>
  160.           <td height="10"></td>
  161.         </tr>
  162.         <tr>
  163.           <td height="25" background="images/button-bg-01.gif" class="line4t" ><div style="PADDING-left:18px;padding-top:3px; "><img src="images/subj.gif" width="16" height="15" align="absmiddle" /> &nbsp;<lt:Label res="res.label.blog.frame" key="new_add"/></div></td>
  164.         </tr>
  165.         <tr>
  166.           <td height="10"></td>
  167.         </tr>
  168.         <tr>
  169.           <td height="27" bgcolor="#FFFFFF" class="line4t" style="padding-top:6px; padding-left:15px; padding-right:15px;" valign="top"><div class="test">
  170.               <%
  171. String[] newBlogs = bd.getNewBlogs(9);
  172. int newBlogsLen = newBlogs.length;
  173. for (int i=0; i<newBlogsLen; i++) {
  174. leftucd = leftucd.getUserConfigDb(newBlogs[i]);
  175. %>
  176.               <li><a href="myblog.jsp?userName=<%=StrUtil.UrlEncode(leftucd.getUserName())%>" title="<%=leftucd.getTitle()%>(<%=leftucd.getUserName()%>)"><%=StrUtil.getLeft(leftucd.getTitle(), 20)%></a></li>
  177.             <%}%>
  178.           </div></td>
  179.         </tr>
  180.         <tr>
  181.           <td height="10"></td>
  182.         </tr>
  183.       </table>
  184.       <table width="240" border="0" align="center" cellpadding="0" cellspacing="0">
  185.         <tr>
  186.           <td height="10"></td>
  187.         </tr>
  188.         <tr>
  189.           <td height="25" background="images/button-bg-01.gif" class="line4t" ><div style="PADDING-left:18px;padding-top:3px; "><img src="images/subj.gif" width="16" height="15" align="absmiddle" /> &nbsp;<lt:Label res="res.label.blog.frame" key="web_statistics"/></div></td>
  190.         </tr>
  191.         <tr>
  192.           <td height="10"></td>
  193.         </tr>
  194.         <tr>
  195.           <td height="170" bgcolor="#FFFFFF" class="line4t"><table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
  196.               <tr>
  197.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="blog_left"/><%=bd.getBlogCount()%> </td>
  198.               </tr>
  199.               <tr>
  200.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="log_left"/><%=bd.getTopicCount()%> </td>
  201.               </tr>
  202.               <tr>
  203.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="web_statistics_comment"/><%=bd.getPostCount()-bd.getTopicCount()%> </td>
  204.               </tr>
  205.               <%String newUserName = StrUtil.getNullString(bd.getNewBlogUserName());%>
  206.               <tr>
  207.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="add"/><a href="<%=StrUtil.UrlEncode(newUserName)%>"><%=newUserName%></a> </td>
  208.               </tr>
  209.               <tr>
  210.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="yesterday"/><%=bd.getYestodayCount()%> </td>
  211.               </tr>
  212.               <tr>
  213.                 <td height="25"><img src="images/tu_newgroup.gif" width="15" height="12" align="absmiddle" />&nbsp;<lt:Label res="res.label.blog.frame" key="today"/><%=bd.getTodayCount()%></td>
  214.               </tr>
  215.           </table></td>
  216.         </tr>
  217.         <tr>
  218.           <td height="10"></td>
  219.         </tr>
  220.       </table></td>
  221.   </tr>
  222. </table>