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.

Conditionals not working still!

September 01, 2012 7:12am

Subscribe [3]
  • #16 / Sep 12, 2012 6:44am

    leeaston

    634 posts

    Hi Kevin, getting Parse error: syntax error, unexpected T_STRING in /data/sites/web/www/system/expressionengine/libraries/Functions.php(680) : eval()‘d code on line 242. Caused by {if "{recent_comment_date format='%Y %m %d'}” == “{current_time format='%Y %m %d'}”} {recent_comment_date format='%g:%i %A'} {/if}

    {exp:query limit="200" paginate="bottom" sql="SELECT title, url_title, comment_total, view_count_one, recent_comment_date, allow_comments, name, exp_channel_titles.channel_id FROM exp_channel_titles LEFT JOIN exp_comments ON exp_comments.comment_date = exp_channel_titles.recent_comment_date  WHERE exp_channel_titles.channel_id = '{pre_channel_id}' AND exp_comments.channel_id = '{pre_channel_id}' AND comment_total > '0' AND sticky = 'n' AND exp_channel_titles.status = 'open' ORDER BY recent_comment_date DESC"}
      {if count == 1}
       <div class="entry">
        <strong>Updated</strong>
        <table class="table">
         <tbody>
      {/if}
          <tr>
           <td><a href="http://{path=title={title}">{title} ({comment_total})</a> {if allow_comments == "n"}<span class="text-success"><small>Answered</small></span>{/if}</td>
           <td>{comment_total} {if count == "1"}replies{/if}</td>
           <td>{view_count_one} {if count == "1"}views{/if}</td>
           <td>{name}</td>
           <td>
            {if "{recent_comment_date format='%Y %m %d'}" == "{current_time format='%Y %m %d'}"} {recent_comment_date format='%g:%i %A'} {/if}
           </td>
          </tr>
      {if count == total_results}
         </tbody>
        </table>
       </div>
      {/if}
      {paginate}
       <div class="navigation">
        {if next_page}<a href="http://{auto_path}class=next">Next Page</a>{/if}
       </div>
      {/paginate}
     {/exp:query}

    FIY, {if "{recent_comment_date format='%Y %m %d'}” == “{current_time format='%Y %m %d'}”} {recent_comment_date format='%g:%i %A'} {/if} works in exp:channel:entries. If I remove it from the exp:query above the query executes OK.

  • #17 / Sep 12, 2012 6:24pm

    Kevin Smith

    4784 posts

    Hey Lee,

    Alright, thanks for the feedback. Working on it, and we’ll have something for you this week.

  • #18 / Sep 17, 2012 12:30pm

    Kevin Smith

    4784 posts

    Hey Lee,

    I think we’ve got the fix here, so try this for me. Open up /system/expressionengine/libraries/Template.php and go to line 3929. You should see a line that looks like this:

    if (preg_match_all("/".LD."([^".RD."]*?)\s+format=[\"'](.*?)[\"']".RD."/s", $str, $matches, PREG_SET_ORDER))

    Replace that line with this:

    if (preg_match_all("/".LD."([\w+]*)\s+format=[\"'](.*?)[\"']".RD."/", $str, $matches, PREG_SET_ORDER))

    How does that do for you? Do you notice any ill effects otherwise?

  • #19 / Sep 17, 2012 2:44pm

    leeaston

    634 posts

    Hi Kevin, looking good! Working as expected - I’ll let you know if I run into a glitch.

    Please pass on my thanks to the devs - and - my apologies for my previous ill temper.

  • #20 / Sep 17, 2012 2:58pm

    Kevin Smith

    4784 posts

    No worries, Lee. I completely understand! It can be frustrating to be in such a bind. I’ll certainly pass along your thanks.

    We do pre-release testing with select add-on developers, but nothing is available yet for a wider audience. You’ll be sure to hear about it if that’s something we decide to start doing!

    Alright with you if I close this thread up?

  • #21 / Sep 17, 2012 3:02pm

    leeaston

    634 posts

    Yes.

  • #22 / Sep 17, 2012 3:02pm

    Kevin Smith

    4784 posts

    Awesome, thanks Lee!

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

ExpressionEngine News!

#eecms, #events, #releases