working visibility function

implemented for viewing friendships on profile.php