Clean up code formatting in `bp-activity-functions.php`.

* Brackets
* Indentation
* Fix incorrect phpdoc
* Add inline doc
* Move some variable assignments outside of comparisons
* Remove some trailing whitespace
* Use `bp_parse_args()`
* Remove some one-time use variables
* Replace `$bp` global usages with `buddypress()` calls

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