Показывать/не показывать блок для терминов



Показывать блок для терминов 1, 2, 6:

<?php
$desired_terms
= array(1, 2, 6);
if (
arg(0) == 'node' and is_numeric(arg(1)) ) {
   
$node = node_load(arg(1));
   foreach (
$node->taxonomy as $term) {
        if (
in_array($term->tid, $desired_terms)) {
            return
TRUE;
        }
    }
}
return
FALSE;
?>

Не показывать блок для терминов 1, 2, 6:

<?php
$desired_terms
= array(1, 2, 6);
if (
arg(0) == 'node' and is_numeric(arg(1)) ) {
   
$node = node_load(arg(1));
   foreach (
$node->taxonomy as $term) {
        if (
in_array($term->tid, $desired_terms)) {
            return
FALSE;
        }
    }
}
return
TRUE;
?>

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.