People who code: we want your input. Take the Survey

The dates need to be formatted properly first to compare them. Something like this: {if {business_expire_date format="%U"} < {current_time format="%U"}}class="expired"{/if} You may need to change the comparison operator < to get desired results.


exp:query would be a fairly painless way to check how many categories (if any) the two entries share. The count(*) could be changed to cp1.cat_id if you'd rather retrieve the category id from the query. {exp:query sql="SELECT count(*) AS count FROM (SELECT cat_id FROM exp_category_posts WHERE entry_id = {first_entry_id}) cp1 INNER JOIN (SELECT cat_id FROM ...


You can try MX Calc {exp:mx_calc expression="{current_time} - 600 "} {if entry_date > {calc_result}} .... {/if} {/exp:mx_calc} but still, this is not good solution because whats happens if user will refresh page many times in accepted timeframe? The perfect solution is made small plugin which will do indication that for current entry message was ...


You're going to run in to parse order issues here I think. Unfortunately the code is not executing in the order you've written it, so certain evaluations won't happen when you're expecting them to. There's a certain point when adding PHP in an EE template that it's best to roll out a custom plugin instead. My general rule when doing something like you're ...

Only top voted, non community-wiki answers of a minimum length are eligible