By max.dk on
How does "Show block only for specific content type" this section of code use in Drupal5.0?
Show block only for specific content type:
$match = FALSE;
$types = array('story' => 1, 'page' => 1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
$type = $node->type;
if (isset($types[$type])) {
$match = TRUE;
}
}
return $match;
Waits for your reply,Thanks!