Skip to content

Instantly share code, notes, and snippets.

@farmerbradllc
Last active August 2, 2016 20:42
Show Gist options
  • Save farmerbradllc/b9add565c55e9709d4dbd8d387c51ee2 to your computer and use it in GitHub Desktop.
Save farmerbradllc/b9add565c55e9709d4dbd8d387c51ee2 to your computer and use it in GitHub Desktop.
<#assign aui = taglibLiferayHash["/WEB-INF/tld/aui.tld"] />
<#assign liferay_portlet = taglibLiferayHash["/WEB-INF/tld/liferay-portlet.tld"] />
<#assign liferay_ui = taglibLiferayHash["/WEB-INF/tld/liferay-ui.tld"] />
<#assign MBCategoryLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBCategoryLocalService")>
<#assign MBMessageLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBMessageLocalService")>
<#assign MBStatsUserLocalService = serviceLocator.findService("com.liferay.portlet.messageboards.service.MBStatsUserLocalService")>
<#assign userLocalService = serviceLocator.findService("com.liferay.portal.service.UserLocalService")>
<#assign paramUtil = staticUtil["com.liferay.portal.kernel.util.ParamUtil"]/>
<#assign messageId = paramUtil.getString(themeDisplay.getRequest(),"messageId", "")/>
<#if messageId!= "">
<#assign messageId = getterUtil.getLong(messageId)/>
<#assign MBMessage = MBMessageLocalService.getMessage(messageId)/>
<#assign MBUserId = MBMessage.userId />
<#assign selectedUser = userLocalService.getUser(MBUserId)/>
<#assign UserPortraitUrl = selectedUser.getPortraitURL(themeDisplay)/>
<#assign UserEmailAddress = selectedUser.emailAddress/>
<#assign screenName = userLocalService.getUser(MBUserId).screenName/>
<#assign MBMessageId = MBMessage.messageId/>
<#assign MBMessageCategoryId = MBMessage.categoryId/>
<#assign MBMessageCategoryName = MBCategoryLocalService.getCategory(MBMessageCategoryId).name/>
<#assign MBMessageSubject = MBMessage.subject/>
<#assign MBMessageBody = MBMessage.body/>
<div class="messageboards details">
<ul>
<li>
<div class="avatar">
<div class="avatar-img">
<a href="profile?accountname=${screenName}" title="a link to ${UserEmailAddress}'s Profile Page" ><img src="${UserPortraitUrl}"></a>
</div>
</div>
</li>
<li class="email"><a href="profile?accountname=${screenName}" title="a link to ${UserEmailAddress}'s Profile Page" >${UserEmailAddress}</a></li>
<li class="category">${MBMessageCategoryName}</a></li>
<li class="date">${MBMessage.modifiedDate?string("MMM dd,yyy")}</li>
</ul>
<h1>${MBMessageSubject}</h1>
<p class="text">${MBMessageBody}</p>
</div>
</#if>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment