Updates to `bp_activity_user_can_delete()`:

* Wrap `$can_delete` checks is `is_user_logged_in()` to avoid superfluous processing on activity items when no user is logged in.
* Cast return value to boolean.
* Add some inline documentation.
* Add an `empty()` check on `$activities_template->activity` to avoid using it if the global is not setup yet.
* Add some brackets.


git-svn-id: https://buddypress.svn.wordpress.org/trunk@8697 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Clean up `bp-core-template.php`:

* Add brackets where necessary.
* Wrap array/object references in `empty()` where necessary to avoid debug notices.
* Replace `$bp` global touches with `buddypress()` calls.
* Remove some trailing whitespace.
* Add some inline/phpdoc doc.
* Add filters to commonly used `_is_` functions.
* Clean-up logic in some `_is_` functions.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8698 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
More nit-picky code clean-up to `bp-core-template.php`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8700 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Make `bp_core_number_format()` a bit more forgiving by allowing `$number` to be empty, and change the `empty()` check to `is_numeric()`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8701 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
In `bp_core_time_since()`, move the `$pre_check` into it's own line, and do an explicit comparison against it.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8702 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add brackets and inline doc to `bp_core_record_activity()`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8703 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add brackets to `bp-core-functions.php` and make `bp_core_get_last_activity()` a bit more flexible.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8704 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
i18n: disambiguate nav items' strings.

See #5777, props danbp

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8705 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
i18n: correct some typos made in r8705

Some strings were being returned when they should have been echo'd to the screen.
Props imath, fixes #5777 again

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8706 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Core: Remove untranslatable printf placeholder, introduced in r8704.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8707 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Activity: fix unit tests (broken in r8697) by making sure `BP_Activity_Activity` returns integers for integer DB columns.

r8697 changed a `==` check to a stricter `===` check. When an activity item was fetched by creating a `BP_Activity_Activity` object, properties that were stored in the DB in integer columns were being returned by strings, and this caused the unit tests to fail. This change explicitly casts these properties as integers before the object is returned.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8708 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Make sure autocomplete feature is available in Message compose screen

As the autocomplete javascripts are now registered hooking 'bp_enqueue_scripts' with a priority of 1 since r8559, the function {{{messages_add_autocomplete_js()}}} also needs to be hooked to 'bp_enqueue_scripts' but with a later priority (default one). Previously it was hooked to 'bp_actions' which is too early for the javascripts to be registered.

Fixes #5783

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8709 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
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
A bit more clean up in `bp-activity-functions.php`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8711 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Avoid debug notices in `bp_blogs_activity_comment_permalink()` when `item_id` is not set.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8712 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Clean up `bp_blogs_delete_activity()`

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8713 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove `$bp` global phpdoc description from `bp_blogs_delete_activity()`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8714 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Clean up parameters of `bp_blogs_remove_activity_meta_for_trashed_comments()` and add some sanity checks to prevent debug notices if no comments are passed.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8715 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Column alignment tweaks in `bp_activity_thumbnail_content_images()`.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8716 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
In `bp_get_activity_comment_permalink()`, check that activity comment exists, and fallback on the regular activity permalink if it doesn't. Also pass `$comment_id` into the filter for easier tweaking.

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