ExpressionEngine CMS
Open, Free, Amazing

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.

help with very complicated conditional

July 13, 2012 6:07am

Subscribe [1]
  • #1 / Jul 13, 2012 6:07am

    Alli

    158 posts

    I have a site where each entry is rated by a number of things. I would like to show a list of those entries that have been given a 5 star rating. However, one of these stars includes a check to see whether the entry author has recently logged in.

    So far I have this code:

    {if member_photo AND short_description AND member_gallery AND more_looking_for_details}

    But I also need to incorporate something that checks the last vist date. This is what have for the rating:

    {exp:user:stats}
    <!--if visited in last 30 days-->
    <?php
    $start = new DateTime('{last_visit format="%Y-%m-%d"}');
    $today = new DateTime();
    $days = round(abs($today->format('U') - $start->format('U')) / (60*60*24));
    if ($days <= 30)
    echo '/images/permanent/star.png'; 
    ?>
    {/exp:user:stats}

    Can anyone suggest how I can create a conditional that will meld them all into a useable conditional?
    Thanks

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases