Canonical URL detection should be sensitive to page_on_front

When a BP directory is set to page_on_front, it should no longer be accessible
at the regular directory URL (to avoid duplicate URLs for the same content).

A special exception is required for the Register page. Because BP blocks access
to Register for logged-in users, the canonical redirect for Register when
viewed by a logged-in user must be something other than the front page. As in
bp_core_screen_signup(), we use the Members directory in this case (a page we
can be reasonably sure will always be present).

Fixes #5199

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7437 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't allow logged-in users to access Activate page.

This behavior better parallels the behavior of the Register page.

Fixes #5042

Props henrywright

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7438 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improved plural i18n for pagination links

Cases where there is only one page of results will now read, eg, "...of 1
member" instead of "...of 1 members".

Where the pagination links are put through apply_filters(), this changeset
also adds the passing of the $from_num, $to_num, and $total values to the
filter.

Fixes #5107

Props imath

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7439 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add redirect_to URL param support to groups_screen_group_invites()

This allows custom redirects after the acceptance/rejection of a group
invitation, for increased flexibility when generating Accept/Reject links
throughout BuddyPress.

See #5032

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7440 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
BP_Groups_Member::check_is_banned() should be marked static

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7441 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve UX flow around overlapping group invites and requests

This changeset introduces a number of improvements to the flow surrounding
invitations and membership requests to private groups:

- When a user has previously requested membership in a group, add a note to
  that effect when the user is being invited to the group via the Send Invites
  interface.
- When a user has previously requested membership in a group, automatically
  accept that invitation and add the user to the group when an invitation is
  sent by an existing group member.
- When a user has previously been invited to a group, buttons in the group
  directory and in the group header should read Accept Invitation instead of
  Request Membership

The end result is a more logical user experience with regard to joining private
groups.

Fixes #5032

Props Mike_Cowobo

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7442 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
JS: Replace String.trim() method with jQuery's trim() function.

When using IE8 and when attempting to post an activity update, IE8
will throw an error and not post the update because of the usage of
String.trim(), which does not exist in IE8.

To fix this bug, we replace String.trim() with jQuery's version of
trim().

Props tomdxw for reporting the bug.

Fixes #5205.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7443 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7444 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7445 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7446 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Blogs: Modify recorded post permalink to use shortlink.

Previously, when BuddyPress recorded the post permalink in the
activity stream, it would use the current permalink structure of the blog.

The problem with this is if the blog changed its permalink structure,
the post permalink in the activity post would not resolve properly
because of the change.

This commit alters the recorded post permalink to use the shortlink
(domain/?p=POST_ID).  Because WP's rewrite rules will pick up the
'p' query parameter and redirect to the proper post permalink, this
will ensure that the post permalink for future activity blog posts
will work as intended.

Fixes #4367.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7447 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Pass the parent activity object to the 'bp_activity_comment_posted'
hook.

This will ensure that plugins can reference the parent activity item
when an activity comment is posted.

See #5130.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7448 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7449 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce BuddyPress Login Widget

This sidebar widget shows a set of login fields to logged-out users, along with
a link to the Register page (if registration is enabled). Logged-in users will
see their avatar, a link to their profile, and a Log Out link (as in the old
bp-default sidebar). This is particularly important now that BP can be used
with any theme, even themes that do not have obvious login mechanisms on the
front end.

Borrowed in part from bbPress, and in part from the BuddyPress Default theme.

Props modemlooper for an initial patch.

Fixes #1474

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7450 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7451 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improve inline docs in bp-core. See #5022

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7452 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix logic error introduced into group template setup in r7442

Template variables were getting overwritten because of incorrect placement
in the loop.

See #5032

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7453 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add a fourth parameter to the BP_Component::start() method.

This parameter is an array that allows extended classes to define some
properties that need to be set early one for BP_Component to be able
to work its magic.

Currently accepts 'adminbar_myaccount_order', which sets a custom
position for the component menu generated under the WP Toolbar's
"My Account" menu.  If this value isn't set, we set the value to 90,
which will generate the menu before the Settings menu is added.

Fixes #3769.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7454 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add checks for member and activity components on the welcome page.

On certain setups, the default components (members and activity) can be
deactivated programatically.  Since we were not explicitly checking if
these components were active or not, a fatal error occurred.

This commit adds checks for the default components and adds a fallback
message if these components are not active on the welcome page.

Fixes #5181.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@7455 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Fix trailing 'members' slug when non-admins view a spammer's profile.

If we're on a spammer's profile page, only users with the 'bp_moderate'
cap can view subpages on the spammer's profile.

Users without the cap trying to access a spammer's subnav page should be
redirected to the root of the spammer's profile page.

This commit does this by removing the component in the canonical stack
when a user without the 'bp_moderate' cap is on a spammer's profile page.

Fixes #5207.

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