bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

simple bbdb query?

(3 posts)
  • Started 8 months ago by djquinn
  • Latest reply from sambauers
  • This topic is not resolved
  1. I've been looking all over the forums for this -

    I'm trying to separate the profile data that gets spewed out by the bb_profile_data function. I managed to get website + last online, but how do I separate the other values (such as location/occupation)? Does anyone know a simple bbdb query I can make to grab meta_value field values directly from the database? Can I call the query in a template file (like the Profile page?)

    Posted 8 months ago #
  2. Seems like this works for pulling the Location value (on the Profile page):

    global $bbdb;
    $userid = $user->ID;
    $profiledata = $bbdb->get_var( "SELECT meta_value FROM $bbdb->usermeta WHERE meta_key = 'from' AND user_id = $userid");
    echo $profiledata;

    Posted 8 months ago #
  3. It's a lot safer to use the API calls.

    bb_get_user($user_id) will return an object filled with the users data and meta data.

    Posted 8 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.