Last updated June 19, 2010. Created by add1sun on April 7, 2007.
Edited by j. ayen green. Log in to edit this page.
I used this for my blog section and I also used the script that makes the block visible for a certain type of node. This way the block only shows on pages that are blog pages and that have been made by a certain user.
<?php
function view_node($type = 'blog',$username) {
$match = FALSE;
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
if ($type == $node->type && $node->name == $username) {
$match = TRUE;
}
}
return $match;
}
?>