#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)
#2
@
15 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
@
15 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!) ;)
Milestone 1.0.4 deleted