Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. <?php
  2. // Drupal 5
  3. // Show block if a node has a specific taxonomy term
  4.  
  5. $show_block = FALSE;
  6. if ( arg(0) == "node" && is_numeric(arg(1)) ) {
  7. $node = node_load(arg(1));
  8. $section_term_id = 1334; // replace this to the corresponding term id
  9. $show_block = ( is_array($node->taxonomy) && in_array($section_term_id, array_keys($node->taxonomy)) );
  10. }
  11. return $show_block;
  12. ?>
Add Comment
Please, Sign In to add comment