Restrict block visibilty based on menu
if (arg(0) == 'node' &amp;&amp; is_numeric(arg(1))) {
  $active_trail = menu_get_active_trail();
  end($active_trail);
  $nid = 1; // change to nid of parent node you want to check
  if ($active_trail[1] &amp;&amp; $active_trail[1]['link_path'] == 'node/'.$nid) {
    return true;
  } else {
    return false;
  }
}  


You can use the above code to achieve it in Drupal 7.