⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 star.java

📁 天乙社区6.0是一套基于JAVA技术的网络虚拟社区
💻 JAVA
字号:
package com.laoer.bbscs.web.action;

import com.laoer.bbscs.web.form.*;
import com.laoer.bbscs.web.servlet.*;
import com.laoer.bbscs.bean.*;
import com.laoer.bbscs.sys.*;
import com.laoer.comm.util.*;
import org.apache.struts.action.*;
import javax.servlet.http.*;

/**
 * <p>Title: TianYi BBS</p>
 * <p>Description: TianYi BBS System</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: LAOER.COM/TIANYISOFT.NET</p>
 * @author laoer
 * @version 6.0
 */

public class Star
    extends BaseAction {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ActionErrors errors = new ActionErrors();
    UserInfoForm form = (UserInfoForm) actionForm;

    UserCheck uc = this.getUserCheck(httpServletRequest, httpServletResponse);
    if (uc.isGuest()) {
      errors.add("error.pleaselogin", new ActionError("error.pleaselogin"));
      saveErrors(httpServletRequest, errors);
      //return actionMapping.findForward("login");
      return SysUtil.getPassLogin(actionMapping);
    }
    if (! (uc.isSuperAdmin() || uc.isUserAdmin())) {
      errors.add("error.purviewerror", new ActionError("error.purviewerror"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }

    UserInfo ui = getUserInfoService().findUserInfoById(new Long(form.getId()));

    if (ui.getHavePic() == 0 || ui.getPicFileName() == null ||
        ui.getPicFileName().length() == 0) {
      errors.add("error.addstar", new ActionError("error.addstar"));
      saveErrors(httpServletRequest, errors);
      return actionMapping.findForward("error");
    }

    StringBuffer sb = new StringBuffer();
    sb.append(
        "<table width=\"100%\"  border=\"0\" cellpadding=\"3\" cellspacing=\"0\">\n");
    sb.append("<tr>\n<td>\n<div align=\"center\">\n");
    sb.append("<a href='");
    sb.append(SysUtil.getUserFileWebPath(ui.getUsername(), ui.getId().longValue()));
    sb.append(ui.getPicFileName());
    sb.append("' target='_blank'><img src='");
    sb.append(SysUtil.getUserFileWebPath(ui.getUsername(), ui.getId().longValue()));
    sb.append(ui.getPicFileName());
    sb.append("' id='upic_");
    sb.append(ui.getId().longValue());
    sb.append("' name='upic_");
    sb.append(ui.getId().longValue());
    sb.append("' border='0' class='PIC1' ");
    sb.append("width='");
    sb.append(SysInfo.getInstance().getFacewith());
    sb.append("' height='");
    sb.append(SysInfo.getInstance().getFacehigh());
    sb.append("'>");

    /*
    sb.append("onload='javascript:if(this.width>");
    sb.append(SysInfo.getInstance().getFacewith());
    sb.append("){this.width=");
    sb.append(SysInfo.getInstance().getFacewith());
    sb.append("}if(this.height>");
    sb.append(SysInfo.getInstance().getFacehigh());
    sb.append("){this.height=");
    sb.append(SysInfo.getInstance().getFacehigh());
    sb.append("}'>");*/
    sb.append("</a>");
    sb.append("</div></td>\n</tr>\n<tr>\n<td>\n");
    sb.append("<div align=\"center\">");
    sb.append("<a href='userInfo" + Constant.FILEPREFIX + "?t=id&id=");
    sb.append(ui.getId().longValue());
    sb.append("'>");
    sb.append(ui.getUsername());
    sb.append("</a></div>\n</td>\n</tr>\n<tr>\n<td>\n");
    sb.append("<div align=\"center\">");
    sb.append("<a href='notedo" + Constant.FILEPREFIX + "?action=new&fname=");
    sb.append(ui.getUsername());
    sb.append("'>#note#");
    sb.append("</a></div>\n</td>\n</tr>\n</table>\n");
    FileIO.writeFile(sb.toString(),
                     SysUtil.getIncludeFilePath() + Constant.STARFILE,
                     Constant.CHARSET);
    ActionForward f = new ActionForward("/in" + Constant.FILEPREFIX, true);
    return f;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -