Display block only for forums

This code returns TRUE when user views 'forum zone' - i.e. forum, forum/* or a node that is a forum topic. This means, if you use that code, you can display block only on pages that are in forum.
This code can be easily modified to do the opposite - return TRUE only for not-forum pages.

<?php
if (arg(0) == 'forum') {
  return
TRUE;
}
if (
arg(0) == 'node' && ctype_digit(arg(1))) {
 
$node = node_load(arg(1));
  if (
$node->type == 'forum') {
    return
TRUE;
  }   
}
return
FALSE;
?>

 
 

Drupal is a registered trademark of Dries Buytaert.