EllisLab text mark
Advanced Search
     
Exp:stats
Posted: 08 November 2012 06:50 PM
Avatar
Joined: 2006-11-11
635 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.

 

 
Posted: 12 November 2012 11:56 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-31
4780 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?

 
Posted: 12 November 2012 12:05 PM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-11-11
635 posts

Thanks Kevin. I’ve added a FR.

 
Posted: 12 November 2012 12:46 PM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-01-31
4780 posts

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