uid); $result = db_query("SELECT b.nid AS bid, oga.group_nid AS gnid from {book} b LEFT JOIN {og_ancestry} oga ON b.nid = oga.nid"); while($row = db_fetch_array($result)) { if($row['gnid'] != NULL) { if(!$subs[$row['gnid']]) { unset($form['book']['bid']['#options'][$row['bid']]); } } } } }