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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="java.util.*,
  3.  java.text.*,
  4.  com.redmoon.blog.*,
  5.  com.redmoon.forum.person.*,
  6.  cn.js.fan.db.*,
  7.  cn.js.fan.util.*,
  8.  cn.js.fan.module.cms.*,
  9.  cn.js.fan.web.*,
  10.  cn.js.fan.module.pvg.*"
  11. %>
  12. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  13. <HTML><HEAD><TITLE><lt:Label res="res.label.blog.admin.home" key="title"/></TITLE>
  14. <META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK 
  15. href="images/default.css" type=text/css rel=stylesheet>
  16. <META content="MSHTML 6.00.3790.259" name=GENERATOR>
  17. <style type="text/css">
  18. <!--
  19. .style1 { font-size: 14px;
  20. font-weight: bold;
  21. }
  22. -->
  23. </style>
  24. </HEAD>
  25. <BODY text=#000000 bgColor=#eeeeee leftMargin=0 topMargin=0>
  26. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  27. <%
  28. if (!privilege.isMasterLogin(request))
  29. {
  30. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  31. return;
  32. }
  33. BlogDb bd = new BlogDb();
  34. bd = bd.getBlogDb();
  35. String op = ParamUtil.get(request, "op");
  36. if (op.equals("star")) {
  37. String star = ParamUtil.get(request, "star");
  38. if (star.equals("")) {
  39. }
  40. else {
  41. UserDb ud = new UserDb();
  42. ud = ud.getUser(star);
  43. if (ud!=null && ud.isLoaded()) {
  44. UserConfigDb ucd = new UserConfigDb();
  45. ucd = ucd.getUserConfigDb(star);
  46. if (ucd!=null && ucd.isLoaded()) {
  47. bd.setStar(star);
  48. bd.save();
  49. }
  50. else {
  51. String str = SkinUtil.LoadString(request,"res.label.blog.admin.home", "user_blog_not_open");
  52. str = StrUtil.format(str, new Object[] {star});
  53. out.print(StrUtil.Alert(str));
  54. }
  55. }
  56. else{
  57.     String str = SkinUtil.LoadString(request,"res.label.blog.admin.home", "user_not_have");
  58. str = StrUtil.format(str, new Object[] {star});
  59. out.print(StrUtil.Alert(str));
  60. }
  61. }
  62. }
  63. if (op.equals("setHomeClass")) {
  64. String homeClasses = ParamUtil.get(request, "homeClasses");
  65. bd.setHomeClasses(homeClasses);
  66. if (bd.save())
  67. ;
  68. else
  69. out.print(SkinUtil.LoadString(request,"res.common", "info_op_fail"));
  70. }
  71. if (op.equals("setRecommandBlogs")) {
  72. String recommandBlogs = ParamUtil.get(request, "recommandBlogs");
  73. bd.setRecommandBlogs(recommandBlogs);
  74. if (bd.save())
  75. ;
  76. else
  77. out.print(SkinUtil.LoadString(request,"res.common", "info_op_fail"));
  78. }
  79. if (op.equals("refreshHome")) {
  80. BlogCache bc = new BlogCache();
  81. bc.refreshHomePage();
  82. }
  83. %>
  84. <TABLE cellSpacing=0 cellPadding=0 width="100%">
  85.   <TBODY>
  86.   <TR>
  87.     <TD class=head><lt:Label res="res.label.blog.admin.home" key="blog_first_page_manage"/>&nbsp;&nbsp;&nbsp;<a href="?op=refreshHome"><lt:Label res="res.label.blog.admin.home" key="reflash_first_page"/></a></TD>
  88.   </TR></TBODY></TABLE>
  89. <br>
  90. <table width="46%" border='0' align="center" cellpadding='5' cellspacing='0' class="tableframe_gray">
  91.   <tr>
  92.     <td height=20 align="center" class="thead style1"><lt:Label res="res.label.blog.admin.home" key="blog_star"/></td>
  93.   </tr>
  94.   <tr>
  95.     <td valign="top">
  96. <%
  97. String star = StrUtil.getNullString(bd.getStar());
  98. if (!star.equals("")) {
  99. %>
  100. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  101.       <tr>
  102.         <td><font color="#FF0000">
  103.         <%
  104. UserConfigDb ucd = new UserConfigDb();
  105. ucd = ucd.getUserConfigDb(star);
  106. UserDb user = new UserDb();
  107. user = user.getUser(star);
  108. int myfacewidth=120,myfaceheight=150;
  109. String myface = user.getMyface();
  110. myfacewidth = user.getMyfaceWidth();
  111. myfaceheight = user.getMyfaceHeight();
  112. String RealPic = user.getRealPic();  
  113.   if (myface.equals("")) {%>
  114.           <img src="../../forum/images/face/<%=RealPic%>"/>
  115.           <%}else{%>
  116.           <img src="../../images/myface/<%=myface%>" name="tus" width="<%=myfacewidth%>" height="<%=myfaceheight%>" id="tus" />
  117.           <%}%>
  118.         </font></td>
  119.         </tr>
  120.       <tr>
  121.         <td><a href="../myblog.jsp?userName=<%=StrUtil.UrlEncode(star)%>" target="_blank"><%=ucd.getTitle()%></a></td>
  122.       </tr>
  123.       <tr>
  124.         <td><%=ucd.getSubtitle()%></td>
  125.       </tr>
  126.     </table>
  127. <%
  128. }
  129. %>
  130. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  131. <form action="?op=star" method="post">
  132.       <tr>
  133.         <td><input type="text" name="star" value="<%=star%>"><input type="submit" value="<lt:Label res="res.label.blog.admin.home" key="set_blog_star"/>"></td>
  134.       </tr>
  135.  </form>
  136.     </table></td>
  137.   </tr>
  138. </table>
  139. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  140.   <tr>
  141.     <td>&nbsp;</td>
  142.   </tr>
  143. </table>
  144. <table width="46%" height="175" border='0' align="center" cellpadding='5' cellspacing='0' class="tableframe_gray">
  145.   <tr>
  146.     <td height=20 align="center" class="thead style1"><lt:Label res="res.label.blog.admin.home" key="set_first_page_class"/></td>
  147.   </tr>
  148.   <tr>
  149.     <td height="145" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  150.       <form action="?op=setHomeClass" method="post">
  151.         <tr>
  152.           <td><input name="homeClasses" type="text" value="<%=StrUtil.getNullString(bd.getHomeClasses())%>" size="50">
  153.               <input name="submit" type="submit" value="<lt:Label res="res.label.blog.admin.home" key="set_class"/>">
  154.               <br>
  155.             <lt:Label res="res.label.blog.admin.home" key="class_description"/></td>
  156.         </tr>
  157.         <tr>
  158.           <td>
  159.   <%
  160. Vector v = bd.getAllHomeClasses();
  161. int nsize = v.size();
  162. if (nsize==0)
  163. out.print(SkinUtil.LoadString(request,"res.label.blog.admin.home", "not_class"));
  164. else {
  165. Iterator ir = v.iterator();
  166. while (ir.hasNext()) {
  167. com.redmoon.blog.Leaf lf = (com.redmoon.blog.Leaf)ir.next();
  168. %>
  169. <table width="100%">
  170. <tr>
  171. <td><li><%=lf.getName()%></li></td>
  172. <td>
  173. <%
  174. if (ir.hasNext()) {
  175. lf = (com.redmoon.blog.Leaf)ir.next();
  176. %>
  177. <li><%=lf.getName()%></li>
  178. <%}%>
  179. </td>
  180. </tr></table>
  181. <%
  182. }
  183. }
  184.   %>
  185.   </td>
  186.         </tr>
  187.       </form>
  188.     </table></td>
  189.   </tr>
  190. </table>
  191. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  192.   <tr>
  193.     <td>&nbsp;</td>
  194.   </tr>
  195. </table>
  196. <table width="46%" height="135" border='0' align="center" cellpadding='5' cellspacing='0' class="tableframe_gray">
  197.   <tr>
  198.     <td height=20 align="center" class="thead style1"><lt:Label res="res.label.blog.admin.home" key="commend_blog"/></td>
  199.   </tr>
  200.   <tr>
  201.     <td height="105" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  202.       <form action="?op=setRecommandBlogs" method="post">
  203.         <tr>
  204.           <td><input name="recommandBlogs" type="text" value="<%=StrUtil.getNullString(bd.getRecommandBlogs())%>" size="50">
  205.                 <input name="submit2" type="submit" value="<lt:Label res="res.label.blog.admin.home" key="commend"/>">
  206.                 <br>
  207.             <lt:Label res="res.label.blog.admin.home" key="comment_description"/></td>
  208.         </tr>
  209.         <tr>
  210.           <td><%
  211. v = bd.getAllRecommandBlogs();
  212. nsize = v.size();
  213. if (nsize==0)
  214. out.print(SkinUtil.LoadString(request,"res.label.blog.admin.home", "not_commend_blog"));
  215. else {
  216. Iterator ir = v.iterator();
  217. while (ir.hasNext()) {
  218. UserConfigDb ucd = (UserConfigDb)ir.next();
  219. %>
  220.                 <table width="100%">
  221.                   <tr>
  222.                     <td><li><a href="../myblog.jsp?userName=<%=StrUtil.UrlEncode(ucd.getUserName())%>" target="_blank"><%=ucd.getUserName()%></a></li></td>
  223.                   </tr>
  224.                 </table>
  225.             <%
  226. }
  227. }
  228.   %>
  229.           </td>
  230.         </tr>
  231.       </form>
  232.     </table></td>
  233.   </tr>
  234. </table>
  235. <br>
  236. </BODY></HTML>