Public
New Commentator

Display Top 5 kudos board in new component

Hi All,

Anyone know how to write code to Display latest Top 5 kudos board in new component ?can refer to my attachment, i am new to lithium api


20170908155052778.png
5 Replies 5
Honored Contributor

@stanley - Do you mean you would like to see the latest Top 5 kudo-ed authors or Top 5 kudo-ed posts?

@stanley : Kindly refer this Document . Hope it will work.

 

If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

Thanks & Regards,
Abhishek Illindra

Hi @srujanayeruvaka, i mean top 5 kudo-ed posts for last month till now

Hi @AbhishekIlindra , this one

SELECT id, subject, view_href FROM messages WHERE kudos.sum(weight) > 0 ORDER BY kudos.sum(weight) DESC LIMIT 5

 quite close to the data i want to retrieve , how to i limit to retrieve the most recent 1 month messages ?

@stanley-

 

This might be helpful https://community.lithium.com/t5/Developer-Discussion/posts-count-of-last-7-days/m-p/315841#M12205.

 

<#assign today = .now?long />

<#assign minus30days= today - (30 * 24 * 60 * 60 * 1000) />

<#assign since30days= minus30days?number_to_datetime?iso('GMT-08:00') />

SELECT id, subject, view_href FROM messages WHERE kudos.sum(weight) > 0 and post_time > ${since30days} ORDER BY kudos.sum(weight) DESC LIMIT 5

 

 

Give kudos if you find my posts helpful or mark solution if it answers your query.
Tariq

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.