logo
Published on Technical articles on: Windows servers, Apache Web Server, MySQL, PHP, IIS (http://www.sitebuddy.com)

Block Visibilty: Hide block in forums and admin section

By chris
Created 16 Sep 2006 - 9:42pm

In the block under "Show block on specific pages:":
Select --> Show if the following PHP code returns TRUE (PHP-mode, experts only).
Enter the PHP code:

<?php
$match = TRUE;
if (arg(0) == 'forum') { $match = FALSE;}
if (arg(0) == 'node' && ctype_digit(arg(1))) {
$node = node_load(arg(1));
if ($node->type == 'forum') { $match = FALSE; }
}
if (substr($_SERVER["REQUEST_URI"], 0, 6) == '/admin') { $match = FALSE;}
return $match;
?>

More: http://drupal.org/node/64135


Source URL:
http://www.sitebuddy.com/drupal/snippets/block_visibility_hide_block_forums_admin_sections