Check if settings component is active before adding a subnav to it

Use the checked() function to add the checked attributes to the checkbox if the settings id defined.
Illustrate how to use buddypress() instance to transport vars.
Use esc_attr() instead deprecated attribute_escape()