Improve variable naming in bp_get_member_profile_data()

The overuse of the $user_id variable, combined with the ill-advised use of
explode(), was resulting in situations where it was impossible to pass a custom
value of $user_id to the function.

See #5334

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8081 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve behavior or bp_member_profile_data() when used outside of members loop

Our documentation suggests the use of bp_member_profile_data() to pull up
miscellaneous pieces of user profile data anywhere in a template. Technically,
this works, but the internals of the function made a few assumptions that it
would only be used in the context of a bp_has_members() loop. This would result
in needless PHP notices when using the function outside of a loop context.

This changeset introduces checks to ensure that the $members_template global
is only manipulated if it exists, making the function safe to use anywhere.

Fixes #5334

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