editwatches.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 176 行
JSP
176 行
<%/** * $RCSfile: editWatches.jsp,v $ * $Revision: 1.5 $ * $Date: 2002/08/09 22:45:12 $ */%><%@ page import="java.util.*, java.text.*, java.net.*, java.sql.*, com.jivesoftware.util.*, com.jivesoftware.forum.*, com.jivesoftware.forum.database.*, com.jivesoftware.forum.util.*" errorPage="error.jsp"%><%@ include file="global.jsp" %> <% // Permission check if (!isSystemAdmin) { throw new UnauthorizedException("You don't have admin privileges to perform this operation."); } // get parameters int maxPoints = ParamUtils.getIntParameter(request,"maxPoints",-1); boolean setProp = ParamUtils.getBooleanParameter(request,"setProp"); boolean emailNotify = ParamUtils.getBooleanParameter(request,"emailNotify"); String fromName = ParamUtils.getParameter(request,"fromName",true); String fromEmail = ParamUtils.getParameter(request,"fromEmail",true); String subject = ParamUtils.getParameter(request,"subject",true); String body = ParamUtils.getParameter(request,"body",true); boolean saveEmailProps = ParamUtils.getBooleanParameter(request,"saveEmailProps"); boolean saveEmailSettings = ParamUtils.getBooleanParameter(request,"saveEmailSettings"); // Get the watch manager WatchManager watchManager = forumFactory.getWatchManager(); // save the email settings if requested if (saveEmailSettings) { watchManager.setEmailNotifyEnabled(emailNotify); response.sendRedirect("editWatches.jsp"); return; } if (saveEmailProps) { if (fromName != null) { watchManager.setEmailFromName(fromName); } if (fromEmail != null) { watchManager.setEmailFromEmail(fromEmail); } if (subject != null) { watchManager.setEmailSubject(subject); } if (body != null) { watchManager.setEmailBody(body); } response.sendRedirect("editWatches.jsp"); return; } fromName = watchManager.getEmailFromName(); fromEmail = watchManager.getEmailFromEmail(); subject = watchManager.getEmailSubject(); body = watchManager.getEmailBody(); boolean errors = false; String errorMessage = ""; boolean isEmailNotifyEnabled = watchManager.isEmailNotifyEnabled();%><%@ include file="header.jsp" %><p><% // Title of this page and breadcrumbs String title = "Watch Settings"; String[][] breadcrumbs = { {"Main", "main.jsp"}, {title, "editWatches.jsp"} };%><%@ include file="title.jsp" %><font size="-1">Watches allow users to track the threads that they're interested in followingand can be configured to send email notifications when there are updates.Use the settings below to turn email notifications on or off and to customizethe message that is sent.Note, your email host is configured via the<a href="email.jsp">email settings</a> page.</font><form action="editWatches.jsp" name="f"><input type="hidden" name="saveEmailSettings" value="true"><font size="-1"><b>Email Watch Settings</b></font><ul> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td width="1%"><input type="radio" name="emailNotify" value="true"<%= (isEmailNotifyEnabled?" checked":"") %> id="rb01"></td> <td><font size="-1"><label for="rb01">Email Watch Notification Enabled</label></font></td> </tr> <tr> <td width="1%"><input type="radio" name="emailNotify" value="false"<%= (!isEmailNotifyEnabled?" checked":"") %> id="rb02"></td> <td><font size="-1"><label for="rb02">Email Watch Notification Disabled</label></font></td> </tr> <tr> <td colspan="2"> <br><input type="submit" value="Save Settings"> </td> </tr> </table></ul></form><form action="editWatches.jsp" name="f"><input type="hidden" name="saveEmailProps" value="true"><font size="-1"><b>Email Properties</b></font><ul> <font size="-1"> You can insert the following tokens into the subject or body of the email message and they'll be dynamically replaced with the appropriate values when the email is sent. <br> </font> <font color="#006600"> <tt> {username} {email} {name} {userID} {threadID} {threadName} {threadModifiedDate} {threadCreationDate} {forumID} {forumName} {messageUser} {messageID} {messageSubject} {messageBody} </tt> </font> <p> <table cellpadding="2" cellspacing="0" border="0"> <tr> <td nowrap><font size="-1">From Name:</font></td> <td><input type="text" name="fromName" size="30" value="<%= ((fromName!=null)?fromName:"") %>"></td> </tr> <tr> <td nowrap><font size="-1">From Email:</font></td> <td><input type="text" name="fromEmail" size="30" value="<%= ((fromEmail!=null)?fromEmail:"") %>"></td> </tr> <tr> <td nowrap><font size="-1">Subject:</font></td> <td><input type="text" name="subject" size="40" value="<%= ((subject!=null)?StringUtils.replace(subject,"\"","""):"") %>"></td> </tr> <tr> <td valign="top" nowrap><font size="-1">Body of email:</font></td> <td> <textarea name="body" cols="40" rows="6" wrap="virtual"><%= ((body!=null)?body:"") %></textarea> </td> </tr> <tr> <td> </td> <td><br><input type="submit" value="Save Settings"></td> </tr> </table></ul></form><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?