Skip to:
Content

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#866 closed defect (bug) (fixed)

bp_has_activities() & "Friends" type pagination bug

Reported by: r-a-y Owned by:
Milestone: 1.1 Priority: minor
Severity: Version:
Component: Keywords:
Cc:

Description

If you use a bp_has_activites() loop with custom parameters of

bp_has_activites('type=friends&per_page=5&max=15&user_id='.$current_user->ID)

Pagination count and links show up correctly, but the bp_activites() loop shows all 15 entries on one page at once, and not 5 as noted in the "per_page" parameter.

---

Removing the parameter "type" and "user_id" parameter from the above example shows pagination correctly, but for sitewide activity only.

Tested on BP 1.0.2, not on BP 1.0.3.

Change History (5)

#1 @apeatling
10 years ago

  • Milestone changed from 1.0.4 to 1.1

Milestone 1.0.4 deleted

#2 @apeatling
10 years ago

  • Resolution set to fixed
  • Status changed from new to closed

I've just tested this in trunk and it is working correctly. Instead of using $current_user->ID and having to global $current_user, you can use:

bp_displayed_user_id() or bp_loggedin_user_id()

#3 @r-a-y
10 years ago

Hey Andy,

The reason why I'm using the global variable is because BP doesn't seem to have a "username" function to return.

BP seems to have everything but that! (ID, display name)

So since I needed the global $current_user for the username on a particular page, I decided to use it for the ID as well.

I guess I could use:

$user_info = get_userdata(1);

$theUsername = $user_info->user_login;
$theUserID = $user_info->ID;

Would using get_userdata() be more beneficial than using global $current_user?

Unless I'm overlooking a very, simple function to return the username (I probably am!) ;)

#4 @r-a-y
10 years ago

Just jotting down my thoughts!

I could also use this:

global $user_ID, $user_login;
get_currentuserinfo();

I think this is the best method... but I'm not entirely sure.

#5 @r-a-y
10 years ago

Actually get_currentuserinfo() also calls on the global $current_user... it might be best to have it the way I have it now.

Unless there's a better way!

Note: See TracTickets for help on using tickets.