Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get User Field Function


  • John
    Member

    @jpmizell

    I’m looking for a function that will allow me to pull data from the user field and ultimately leverage that field to control a user directory inclusive of specific fields.

    John

Viewing 3 replies - 1 through 3 (of 3 total)

  • John
    Member

    @jpmizell

    I’m looking at something under the

    like
    `<?php
    $var=bp_member_profile_data(‘field=Field’);
    if $var==”string” { ?>`
    followed by the member loop code with added fields.

    – Put into Practice –
    When I put this into practice using a radio field called Publish with Yes & No options

    `<?php
    $publish_var = bp_member_profile_data( ‘field=Publish’ );
    if ($publish_var == “Yes”) { ?>`

    my directory displays a two yes’ (the correct number of yes’ in the DB) and ends.

    When I edit the code for the opposite
    `<?php
    $publish_var = bp_member_profile_data( ‘field=Publish’ );
    if ($publish_var != “Yes”) { ?>`
    The output is the normal member directory with the field “Publish” displayed atop each member.


    John
    Member

    @jpmizell

    Was able to track down the Buddy Press Function list which defines a function that may function for me.
    http://phpxref.ftwr.co.uk/buddypress/nav.html?_functions/index.html – line 264.

    `bp_has_members( $args = ” )` & the ‘meta_value’ argument


    John
    Member

    @jpmizell

    Easy solution I didn’t really understand at first.. but not it’s quite obvious.

    I created a profile field check-box (“Publish”) to let users control their visibility within the directory.
    After the while loop I inserted the code:

    `
    `

    Then, following
    `<a href="”>`
    I added my profile fields, one by one:
    `Experience Type: `

    Refinements I’d like.
    Access to Group Fields in bulk, or at least being able to distinguish between group A, field 1 and group B, field 1 if field 1 is named the same within each group. i.e. Family Group, Name, Friend Group, Name.. etc.

    In the mean time, with some appropriate styling, this should give me a good looking member profile page, allowing members to elect to participate in the directory.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get User Field Function’ is closed to new replies.
Skip to toolbar