ContributionsMost RecentMost LikesSolutionsRe: Show Icon on thread resonse or created by specific roleHi @bhupen, such posts are helpful for other developers, please mark the appropriate reply as the solution so other people can get to know which post was the solution. Might help someone in someways.Re: Need to display Icon next to specific thread title for specific role using FTLFTL executes on the server, where you can only handle your custom components, js/ jQuery executes on the client side.Re: Show Icon on thread resonse or created by specific role Hi bhupen - The icon which you are referring to is the user role icon, and by default, it shows up along with the user name, i.e. in the Author row. I checked and noted that these default icons are hidden via CSS in PlayStation Community, using display:none; CSS to be used to display them back again: .messageAuthorColumn .UserName.lia-user-name img.lia-user-rank-icon-left { display: block; margin-left: -81px !important; } Now, as you want to display this only for 2 roles, i.e. "DigitalPlatforms Support" or - "Administrator", so this can be done via jQuery: ForDigitalPlatforms Support: <img class="lia-user-rank-icon-left" title="DigitalPlatforms Support" alt="DigitalPlatforms Support" id="display_9" src="http://community.us.playstation.com/t5/image/serverpage/image-id/213315i52E5BF6439205975/image-size/large/is-moderation-mode/true?v=mpbl-1&px=600"> For SMSCS: <img class="lia-user-rank-icon-left" title="Administrator" alt="Administrator" id="display_7" src="http://community.us.playstation.com/t5/image/serverpage/image-id/213313i3C90E5E52BF684C6/image-size/large/is-moderation-mode/true?v=mpbl-1&px=600"> So, you get to this node using jQuery, and the read the title attribute using .attr, and hide the icons which are not one of these 2. <script> $(".thread-list .lia-list-row .messageAuthorColumn").each(function(){ var getRole = $(this).find('.lia-user-rank-icon-left').attr('title'); if(getRole != "PlayStation MVP" || getRole !="Administrator"){ $(this).find('.lia-user-rank-left-icon').hide(); } }); </script> I hope this helps. Permission Denied in requesting labels from groups and its messages I enabled groups on our community and have encountered an issue, where in I am getting pemission denied when making a rest call for labels. e.g. These 2 calls, one the top level group and 2nd one is the group message, which gives permission denied. http://lidemo.lithium.com/restapi/vc/groups/id/091312_Disco_Fans/labels http://lidemo.lithium.com/restapi/vc/messages/id/3839/labels/labels This returns labels, this is a normal message. http://lidemo.lithium.com/restapi/vc/messages/id/4815/labels/labels Re: Mismatch in view_friendly_time and the post_time in API result HaidongG - Thanks, this is a good workaround, but the problem with this is, using friendly_dates.format.under_day = %h% 'h ago' the Output is 14 h ago, but i want it 14h ago, i.e. without a space b/w 14 and h, If I use, friendly_dates.format.under_day = %h%'h ago' Output - 14'h ago If I use, friendly_dates.format.under_day = %h% h ago It doesn't print anything, any suggestions how can I encounter this? Re: Mismatch in view_friendly_time and the post_time in API result HaidongG - Could you please elaborate a bit more, where do I need to make this change? Mismatch in view_friendly_time and the post_time in API result I am working on a customization wherein we are parsing the time to be displayed in a friendly manner, i.e. 2h ago, 3w ago etc. I know there is already a way of doing it by using ?restapi.response_style=view and then reading the view_friendly_date attribute as in below example: <response status="success"> <value type="date_time" view_date="06-20-2014" view_time="03:37 AM" view_friendly_date="12 hours ago">2014-06-19T22:07:33+00:00</value> </response> but our client has a requirement of showing ‘h’ instead of ‘hours’ and ‘w’ instead of ‘weeks’ etc., so I made a function which is working fine, but when I compared it to what Lithium API is returning, the results are different. Below is my code which I changed so that you can run on your instance just to test. First line is hard coded to use the time returned in above response. Second line is the current time <#assign time = "2014-06-19T22:07:33+00:00"> <#assign timeNow = "2014-06-20T16:07:33+00:00"> <#assign postTimeObject = time?datetime("yyyy-MM-dd'T'hh:mm:ss") /> <#assign postTimeObjectNow = timeNow?datetime("yyyy-MM-dd'T'hh:mm:ss") /> <#assign postTimeString = relativeTime(postTimeObject ) /> <#assign current_time = postTimeObjectNow?long> <#assign timeNew = postTimeObject?long> Posted Date - ${postTimeObject}<br><br> ----Converting to 'long' starts----<br> Long posted - ${timeNew}<br> Long current - ${current_time }<br> ----Converting to 'long' ends ----<br><br> <b>Friendly Output - ${postTimeString}</b><br> <#function relativeTime time> <#-- this is working in ms, so bear in mind the extra 000 --> <#assign current_time = postTimeObjectNow?long> <#assign action_time = time?long> <#assign diff = current_time - action_time> <#if diff == 0> <#return 'now'> <#elseif (diff > 0)> <#assign day_diff = diff / 86400000> <#assign day_diff = day_diff?floor> here ${day_diff} <#if (day_diff == 0)> <#if (diff < 60000)> <#return 'just now'> </#if> <#if (diff < 120000)> <#return '1m ago'> </#if> <#if (diff < 3600000)> <#assign sixty_min = diff / 60000> <#return sixty_min?floor + 'm ago'> </#if> <#if (diff < 7200000)> <#return '1h ago'> </#if> <#if (diff < 86400000)> <#assign hours = diff / 3600000> <#return hours?floor + 'h ago'> </#if> </#if> <#if (day_diff == 1)> here 1 ${day_diff} <#return 'Yesterday'> </#if> <#if (day_diff < 7)> here2 ${day_diff} <#return day_diff + 'd ago'> </#if> <#if (day_diff < 31)> here 3 ${day_diff} <#assign weeks = (day_diff / 7)?ceiling> <#if (weeks == 1)> <#return 'Last week.'> </#if> <#return weeks + 'w ago'> </#if> <#if (day_diff < 60)> <#return 'last month'> </#if> </#if> <#return time?string("MM-dd-yy")> </#function> At the time of posting this query, the output is: Posted Date - 19-Jun-2014 22:07:33 ----Converting to 'long' starts---- Long posted - 1,403,240,853,000 Long current - 1,403,305,653,000 ----Converting to 'long' ends ---- Friendly Output - 18h ago But the restapi is returning 12 hours ago? any mistake in my code or is it an issue with the API? Sorry for such a long post. SolvedRe: link to private messagesI don't see any errors here apart from one, you need to pass the user id, it should fetch you the value. to print the number, you need to use ${userinfo}Re: link to private messagesUse .value instead of .messageRe: link to private messages kbulens you can simply use this link to users inbox <a href="/t5/notes/privatenotespage">Messages</a> and to get the messages count, use this REST call: /users/id/[id]/mailbox/notes/inbox/unread/count