Avoid PHP notices when building is_new clause in BP_Notifications_Notification::get()

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8171 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Return false friends_add_friend() when the initiator is the same as the friend

It's good to love yourself, but there's no real reason to allow
self-friendships in BuddyPress.

See #5319

Props megainfo, r-a-y

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8172 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix check for existing friendship in friends_add_friend()

The previous logic would always result in this check failing.

Fixes #5319

Props r-a-y

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8173 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Enable Spam admin tools on non-MS users.php Dashboard panel

This change brings non-MS installations of BuddyPress closer to the
functionality that is native to WP Multisite, with respect to the ability to
manage spam/ham users from the Users panel. It also addresses a shortcoming
whereby admins on non-MS sites would have no way at all to spam/unspam users
if the Settings component was disabled, since the front-end Spam tools are in
that optional component.

Fixes #5113

Props imath, r-a-y

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8174 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't allow a user to favorite a single activity item more than once.

Fixes #5478

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8175 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Notifications: Invalidate cache when a notification is updated.

Object caching was added to the notifications component in r7813.
However, the cached item was not invalidated whenever a notification
is updated (either by using one of the marked as read functions or via
using the BP_Notifications_Notification::update() method).

This commit invalidates the cache directly in the update() class
method and adds a unit test.

See #5377

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8176 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Bail from bp_activity_remove_user_favorite() if the user has not previously favorited the item in question

The failure to do this check could result in the incorrect decrementing of the
item's favorite_count.

Fixes #5478

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8177 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
xProfile: re-architecture profile field types and de-duplicate the templating and validation logic to make it easier for core and plugins to add new profile field types.

Until now, it's been pretty hard to add new types of profile field to BuddyPress. There are a couple of plugins that do a good job, but BuddyPress makes it much harder than it should be because, historically, we've hardcoded values and checks in templates throughout the project. For example, profile field templating was duplicated in the registration template, the member/profile/edit template, in parts of the wp-admin xProfile screens, and in the new wp-admin extended profile editor.

This change implements a new approach that creates a class for each profile field type; selectbox, textbox, textarea, and so on. They all share an abstract base class `BP_XProfile_Field_Type` which consolidates a lot of special behaviour that had been added to BuddyPress over the years (e.g. some fields accept null values, some accept multiple default values), and adds true field value validation. Unit tests are included.

We've also implemented a new "Numbers" field type with these changes. It behaves much the same as a regular textbox field does, but it only accepts numbers.

Fixes #5220 and #4694

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8178 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Groups & XProfile: Remove `Georgia` font-family styling from admin area screens.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8179 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
In Profile fields management screens, make sure the cancelled field options are not saved

When editing fields using options such as select boxes, radio boxes, check boxes, etc. when an admin cancelled one or more options, they were still saved. This make sure cancelled options are fully removed before the profile field is edited.

Fixes #5453

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8180 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove `$bp` global from core messages functions. See #5138.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8181 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Replace `$bp` global touches in core component functions with `buddypress()` calls. See #5138.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8182 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove `@` error control operator from `setcookie()` usages.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8183 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Clean up `BP_Signup` class.

* Fix issue with sign-up meta not being populated correctly.
* Remove stray semi-colons.
* Code formatting clean-up.
* See #5374.

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