I want to create some IF-ELSE clause based on a multiple checks, which sets the active class only if:
- topic is not marked as solved OR, topic does not come from a Download subforum (only one of these can be true, no possibility that the topic is marked as solved and comes from Download subforum at the same time),
- topic must have unread posts.
I have created such an IF-ELSE clause:
Code: Select all
<!-- IF searchres.UNREAD_POSTS and (not searchres.DOWNLOAD_SECTION or not searchres.RESOLVED) --> (active class) <!-- ELSE --> (passive class) <!-- ENDIF -->
In the PHP code it should be like this:
Code: Select all
if ($row['unread_posts'] && (!$row['topic_solved'] || !$row['come_from_download']))
{
(active class)
}
else
{
(passive class)
}
EDIT: This code works (sets active class only if the topic has unread posts and does not come from Download section) if I remove the brackets from IF clause:
Code: Select all
<!-- IF searchres.UNREAD_POSTS and not searchres.DOWNLOAD_SECTION --> (active class) <!-- ELSE --> (passive class) <!-- ENDIF -->
Code: Select all
<!-- IF searchres.UNREAD_POSTS and not (searchres.DOWNLOAD_SECTION or searchres.RESOLVED) --> (active class) <!-- ELSE --> (passive class) <!-- ENDIF -->