I would like to combine these two php codes to display a block only on nodes of a special node-type and when the current logged in user is the author of the node. Any help very much appreciated!
$types = array('middle_content' => 1);
if ($node = menu_get_object()) {
if (isset($types[$node->type])) {
return TRUE;
}
}
as found on Block on specific pages and node types
global $user;
if (arg(0) == 'node' && is_numeric(arg(1))) {
// Get the nid
$nid = arg(1);
// Load the node if you need to
$node = node_load($nid);
}
if($node->uid == $user->uid){
return TRUE;
} else {
return FALSE;
}
as found on How can I check if the author of the current node is the current logged in user?