I'd like to make a certain block visible to only members of group "Exhibitors." I found a snippet that accomplished this only on group pages. However, I'd like this block to be visible on both group and non-group pages (so, anywhere on the site).

I've set the block to only show if the following php returns true:

//check og module exists
if (module_exists('og')){

//check we've got a group, rights to view the group,
// and of type "group_type" - change this to whichever group you want to restrict the block to
//or remove the condition entirely
if (($group = og_get_group_context()) && node_access('view', $group) && ($group->type == 'Exhibitors') ) {
return TRUE;
}
}

But this only appears on the actual "Exhibitors" group page. I'm assuming that this is because, on all other pages, it's missing an argument and og_get_group_context() is coming up without results. Therefore $group is not set and $group->type is null.

Does anyone know how to remedy this problem?
Thanks