留言板

Not able to upload smiley in Forum portlet

thumbnail
Subhasis Roy,修改在11 年前。

Not able to upload smiley in Forum portlet

Expert 帖子: 275 加入日期: 12-1-20 最近的帖子
I have used Message Boards portlet. But I am not able to upload images in the post. When I try to add images and then publish, images comes as ": grin :" ": bashful :"

I mean code for smiley is showing up in the message board.

can anyone help me on this?
thumbnail
Subhasis Roy,修改在10 年前。

RE: Not able to upload smiley in Forum portlet

Expert 帖子: 275 加入日期: 12-1-20 最近的帖子
Got the solution

Added the following code in view_thread_message.jspf

Code snippet:
<%
String msgBody = BBCodeUtil.getHTML(message);
msgBody = StringUtil.replace(msgBody, "@theme_images_path @/emoticons", themeDisplay.getPathThemeImages() + "/emoticons");
msgBody = StringUtil.replace(msgBody, "<br />", "\n");
msgBody = StringUtil.replace(msgBody, "&nbsp;", " ");
msgBody = StringUtil.replace(msgBody, "&lt;", "<");
msgBody = StringUtil.replace(msgBody, "&gt;", ">");

%>
<%= msgBody %>



This "StringUtil.replace" in the above code snippet is responsible for showing the smiley icon in the message board in liferay. This check the smiley in the specified path from the theme and shows the smiley icon in the message board posting.