Use the correct function to get notification unread count for buddybar

Fixes #5403

Props lenasterg

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7913 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce metadata pre-fetching for xprofile objects

XProfile objects (groups, fields, and data) are generally fetched in a nested
way, as within the context of a bp_has_profile() loop. Thus, it makes sense to
pre-fetch xprofile metadata within a bp_has_profile() loop in a nested way as
well. This changeset introduces bp_xprofile_update_meta_cache(), which is able
to fetch all uncached metadata for nested meta types with a single database
query.

This changeset also introduces an 'update_meta_cache' parameter to the
bp_has_profile() stack. This param allows developers to disable the pre-
fetching introduced here. Defaults to true.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7914 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't use fetch_default_visibility_levels() method in bp_has_profile() loop

There's no need to do this custom pre-fetching of visibility levels within
the bp_has_profile() loop, because the values are already loaded into the cache
by bp_xprofile_update_meta_cache(). So we use bp_xprofile_get_meta() instead.

See #5398

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7915 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Define add_blog_option() in abstraction file for non-multisite

This prevents fatal errors when using bp_add_option() in non-multisite
environments.

Fixes #5406

Props imath, DJPaul

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7916 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r7916

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7917 cdf35c40-ae34-48e0-9cc9-0c9da1808c22