latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Calling back buddypress data in member list

Home Forums Community Forum Calling back buddypress data in member list

This topic contains 1 reply, has 2 voices. Last updated by  Raam Dev 4 years, 6 months ago.

Topic Author Topic
Posted: Saturday Jun 30th, 2012 at 12:42 pm #17969
Epix Media
Username: epixmedia

Hi all, thanks to the s2Member forum I’m working with a company in California!! I have built my custom searchable members list and am joining data from a buddy press table via my sql query – however when I try to call a field from that table within my foreach its just returning blank.

I’ve checked my query via phpmyadmin and the correct data is returned there, it just won’t write to the page (everything else from the user & usermeta tables comes back fine!).

My query is:
$users = $wpdb->get_results (“SELECT DISTINCT(U.ID) as `ID`
FROM ” . $wpdb->users . ” AS U
inner join ” . $wpdb->usermeta . ” as UM on U.ID = UM.user_id
left join wp_bp_activity as BP on U.ID = BP.user_id
WHERE BP.date_recorded = (
SELECT MAX(date_recorded)
FROM ast_bp_activity
WHERE user_id = BP.user_id
LIMIT 1
)
OR BP.date_recorded IS NULL
OR BP.date_recorded = ”
ORDER BY “.$_SESSION[‘sortby’].””);

and I’m using get_user_field(“date_recorded”, $user_id) to try and call the date_recorded data from bp_actvitiy, perhaps I should be calling it a different way??

Any ideas??

Thank you :D

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Tuesday Jul 3rd, 2012 at 3:25 am #18133
Raam Dev
Username: Raam
Staff Member

Hi Zoe,

Congrats on your new job! :)

The problem you’re having is outside the the scope of s2Member’s support, but if the get_user_field() function is returning empty I suggest starting there: Does that function successfully return other user fields? If not, then is the user_id being passed properly? If other fields work, are you sure the date_recorded data is being stored in the database in the same way that other user fields are being stored?

I hope helps you narrow down the issue! :) If you’re still stuck, I suggest asking your question on the WordPress.org Support Forums or even Stack Overflow.

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.