profile.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 419 行 · 第 1/2 页
JSP
419 行
<%/** * $RCSfile: profile.jsp,v $ * $Revision: 1.7 $ * $Date: 2002/06/10 14:42:01 $ */%><%@ page import="java.util.*, com.jivesoftware.util.*, com.jivesoftware.forum.*, com.jivesoftware.forum.util.*" errorPage="error.jsp"%><%! // Number of recent messages to show on this page. static final int NUM_RECENT_MSG = 10;%><%@ include file="global.jsp" %><% // Put the request URI and query string in the session as an attribute. // This is done so the error.jsp and auth.jsp pages can figure out what // page sent it an error and redirect appropriately. setRedirectURL(request);%><% // Parameters long userID = ParamUtils.getLongParameter(request,"user",-1L); String username = ParamUtils.getParameter(request,"user"); String referrer = ParamUtils.getParameter(request,"referrer"); boolean goback = request.getParameter("goback") != null; boolean prefs = request.getParameter("prefs") != null; if (referrer == null || "".equals(referrer)) { referrer = "index.jsp"; } if (goback) { response.sendRedirect(referrer); return; } // Error parameters boolean errors = false; boolean errorUserID = false; boolean errorUsername = false; // Try to load a user (try by userID first, then try username) UserManager userManager = forumFactory.getUserManager(); User user = null; try { user = userManager.getUser(userID); } catch (UserNotFoundException unfe) { errorUserID = true; try { user = userManager.getUser(username); } catch (UserNotFoundException unfe2) { errorUsername = true; } } if (user != null) { userID = user.getID(); username = user.getUsername(); } if (prefs && user!= null && (user.getID() == pageUser.getID())) { response.sendRedirect("settings.jsp?user=" + user.getID()); return; } // reset the errors variable errors = errorUserID || errorUsername;%><% String title = SkinUtils.getLocalizedString("skin.default.profile.title",locale); %><%@ include file="header.jsp" %><table cellpadding="0" cellspacing="0" border="0" width="100%"><tr> <td width="99%" valign="top"> <font face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>"> <% if (username == null) { %> <b><%= SkinUtils.getLocalizedString("skin.default.profile.user_profile",locale) %></b> <% } else { %> <b><%= SkinUtils.getLocalizedString("skin.default.profile.user_profile_for",locale) %></b> <% } %> </font> <br> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>" color="<%= JiveGlobals.getJiveProperty("skin.default.linkColor") %>"> <b> <a href="<%= JiveGlobals.getJiveProperty("skin.default.homeURL") %>" ><%= SkinUtils.getLocalizedString("skin.default.global.home",locale) %></a> » <a href="index.jsp" title="<%= SkinUtils.getLocalizedString("skin.default.global.go_back_to_forum_list",locale) %>" ><%= SkinUtils.getLocalizedString("skin.default.global.forums",locale) %></a> » <%= SkinUtils.getLocalizedString("skin.default.profile.user_profile",locale) %> </b> </font> </td> <td valign="top" width="1%" align="center"> <%@ include file="loginbox.jsp" %> </td></tr></table><% if (errorUserID || errorUsername) { List userDisplay = new ArrayList(1); if (errorUserID) { userDisplay.add(""+userID); } else { userDisplay.add(username); }%> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><% if (errorUserID) { %> <%= SkinUtils.getLocalizedString("skin.default.profile.error_userid",userDisplay) %><% } else { %> <%= SkinUtils.getLocalizedString("skin.default.profile.error_username",userDisplay) %><% } %> </font><% } %><% if (!errors && user != null) { username = user.getUsername(); boolean nameVisible = user.isNameVisible(); boolean emailVisible = user.isEmailVisible(); String name = user.getName(); String email = user.getEmail(); Date creationDate = user.getCreationDate(); String occupation = user.getProperty("jiveOccupation"); String location = user.getProperty("jiveLocation"); String homepage = user.getProperty("jiveHomepage"); int totalPosts = userManager.userMessageCount(user); if (email != null && !email.equals("")) { email = "<a href=\"mailto:" + email + "\">" + email + "</a>"; } if (homepage != null && !homepage.equals("")) { homepage = StringUtils.escapeHTMLTags(homepage); if (homepage.startsWith("http://")) { homepage = "<a href=\"" + homepage + "\" target=\"_blank\">" + homepage + "</a>"; } else { homepage = "<a href=\"http://" + homepage + "\" target=\"_blank\">" + homepage + "</a>"; } } if (occupation == null) { occupation = " "; } else { occupation = StringUtils.escapeHTMLTags(occupation); } if (location == null) { location = " "; } else { location = StringUtils.escapeHTMLTags(location); } if (homepage == null) { homepage = " "; } // An iterator of their recent messages: Iterator userMessages = userManager.userMessages(user,0,NUM_RECENT_MSG);%><font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"></font><p><table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>" cellpadding="0" cellspacing="0" border="0" width="80%" align="center"><tr><td> <table bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableBorderColor") %>" cellpadding="3" cellspacing="1" border="0" width="100%"> <% if (nameVisible || (pageUser != null && pageUser.getID() == user.getID())) { %> <tr bgcolor="<%= JiveGlobals.getJiveProperty("skin.default.tableRowColor1") %>"> <td width="50%"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"> <%= SkinUtils.getLocalizedString("skin.default.global.name",locale) %> </font> </td> <td width="50%"> <font size="<%= JiveGlobals.getJiveProperty("skin.default.fontSize") %>" face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>"><%= name %> <% if (!nameVisible) { %> <%= SkinUtils.getLocalizedString("skin.default.profile.hidden",locale) %> <% } %> </font> </td> </tr>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?