% /** * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ %>
|
"><%= HtmlUtil.escape(message.getSubject()) %>
<%
/*String msgBody = message.getBody();
String codeStart = " ";
msgBody = StringUtil.replace(msgBody, quoteEnd, "[/quote]");
String urlStart = "http://forums.liferay.com/index.php";
while (true) {
int x = msgBody.indexOf(urlStart);
if (x == -1) {
break;
}
int spacePos = msgBody.indexOf(" ", x);
int singleQuotePos = msgBody.indexOf("'", x);
int doubleQuotePos = msgBody.indexOf("\"", x);
int lessThanPos = msgBody.indexOf("<", x);
int y = -1;
if (spacePos != -1) {
y = spacePos;
}
if ((y == -1) || ((singleQuotePos != -1) && (y > singleQuotePos))) {
y = singleQuotePos;
}
if ((y == -1) || ((doubleQuotePos != -1) && (y > doubleQuotePos))) {
y = doubleQuotePos;
}
if ((y == -1) || ((lessThanPos != -1) && (y > lessThanPos))) {
y = lessThanPos;
}
if (y == -1) {
break;
}
String url = msgBody.substring(x, y);
String entryStart = "entry";
int entryIdPos = url.indexOf(entryStart);
if (entryIdPos != -1) {
long messageId = GetterUtil.getLong(url.substring(entryIdPos + entryStart.length(), url.length()));
url = "http://www.liferay.com/web/guest/devzone/forums/message_boards/message/" + messageId;
}
else {
String topicId = HttpUtil.getParameter(url, "showtopic", false);
if (Validator.isNotNull(topicId)) {
url = "http://www.liferay.com/web/guest/devzone/forums/message_boards/topic/" + topicId;
}
else {
break;
}
}
msgBody = msgBody.substring(0, x) + url + msgBody.substring(y, msgBody.length());
}
msgBody = StringUtil.replace(msgBody, "style_emoticons/<#EMO_DIR#>", "@theme_images_path@/emoticons");
String emoticonsPath = "@theme_images_path@/emoticons";
int x = 0;
x = msgBody.indexOf(emoticonsPath, x);
while (x != -1) {
int y = msgBody.indexOf(".gif", x);
String emotionImage = msgBody.substring(x + emoticonsPath.length() + 1, y) + ".gif";
x = msgBody.indexOf(emoticonsPath, x + 1);
}*/
String msgBody = BBCodeUtil.getHTML(message);
msgBody = StringUtil.replace(msgBody, "@theme_images_path@/emoticons", themeDisplay.getPathThemeImages() + "/emoticons");
%>
<%= msgBody %>
CODE ";
String codeEnd = " ";
while (true) {
int x = msgBody.indexOf(codeStart);
int y = msgBody.indexOf(codeEnd, x);
if ((x == -1) || (y == -1)) {
break;
}
String code = msgBody.substring(x + codeStart.length(), y);
code = StringUtil.replace(code, "", "\n"); code = StringUtil.replace(code, " ", " "); code = StringUtil.replace(code, "<", "<"); code = StringUtil.replace(code, ">", ">"); msgBody = msgBody.substring(0, x) + "[code]" + code + "[/code]" + msgBody.substring(y + codeEnd.length(), msgBody.length()); } String quoteBegin1 = ""; while (true) { int x = msgBody.indexOf(quoteBegin1); int y = msgBody.indexOf(quoteBegin2, x); if ((x == -1) || (y == -1)) { break; } String replace = msgBody.substring(x, y + quoteBegin2.length()); msgBody = StringUtil.replace(msgBody, replace, "[quote]"); } quoteBegin1 = ""; while (true) { int x = msgBody.indexOf(quoteBegin1); int y = msgBody.indexOf(quoteBegin2, x); if ((x == -1) || (y == -1)) { break; } String replace = msgBody.substring(x, y + quoteBegin2.length()); msgBody = StringUtil.replace(msgBody, replace, "[quote]"); } String quoteEnd = " <% } } %>
|
||
|