Forum Discussion

bhupen's avatar
bhupen
Advisor
10 years ago

Is it possible to show only current day posts?

Hi guyz, I got latest reply topic but I want to show the only current day's highest reply post?   Solution in my mind: I got the post date, I want to compare post date with current date.  But iam...
  • bhupen's avatar
    bhupen
    10 years ago

    OlivierSPaoloT  Thanks for your help.  OlivierS specially thanks for your effort. I have achived it other way. Iam posting it here might be help someone else:

     

    <h3>Trending Post</h3> <br />
    <#assign apiVersion = "2.0"/>
    <#assign today = .now>
    <#assign dateToday = today?string("yyyy-MM-dd'T'HH:mm:ss'+00:00'")  />
        <#assign x= rest(apiVersion,"/search?q=" + "SELECT id, subject,post_time,author, view_href, replies.count(*) FROM messages WHERE
        post_time >= ${dateToday} AND board.id = '10031' AND depth=0 ORDER BY replies.count(*) DESC LIMIT 5"?url) />
        
    <#if x.data.items ?? >
        <#list x.data.items as message >
                <p><a href="${message.view_href}">${message.subject}</a></p>
                <span>${message.author.login}</span>
        </#list>
    </#if>    

    Thanks for your help all.

    Cheers!