Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Exp:stats

November 08, 2012 6:50pm

Subscribe [1]
  • #1 / Nov 08, 2012 6:50pm

    leeaston's avatar

    leeaston

    634 posts

    Latest EE

    Using this code only the contents of the if:else is returned, even when the last_comment_date is greater than last_entry_date. Wonder if you could please try it your end please. Am I doing something wrong?

    {exp:stats}
      {if last_comment_date > last_entry_date}
        {!-- Comment is more recent --}
        Comment 
      {if:else}
        {!-- Entry is more recent --}
        Entry 
      {/if}
    {/exp:stats}

    More confusing is that this code outputs nothing at all.

    {exp:stats}
      {if last_comment_date > last_entry_date}
        {!-- Comment is more recent --}
        Comment
      {/if}
      {if last_entry_date > last_comment_date}
        {!-- Entry is more recent --}
        Entry
      {/if}
    {/exp:stats}

    My test templates had each of these examples on and no other code whatsoever.

     

  • #2 / Nov 12, 2012 11:56am

    Kevin Smith's avatar

    Kevin Smith

    4784 posts

    Hi Lee,

    After digging through the code of the Statistics modules, I see that the date variables for this module (last_entry_date, last_forum_post_date, last_comment_date, last_visitor_date, and most_visitor_date) aren’t available as conditional variables. That would explain why it’s not behaving as you’d expect here. Certainly a good feature request though. Would you like me to move this thread over to Feature Requests so that our devs can see if when they’re combing through that forum?

  • #3 / Nov 12, 2012 12:05pm

    leeaston's avatar

    leeaston

    634 posts

    Thanks Kevin. I’ve added a FR.

  • #4 / Nov 12, 2012 12:46pm

    Kevin Smith's avatar

    Kevin Smith

    4784 posts

    Glad to hear that, Lee. Have a good one!

ExpressionEngine News

#eecms, #events, #releases