Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 5,226 through 5,250 (of 5,755 total)
  • Author
    Search Results
  • #55382
    buzz2050
    Participant

    Yup, that is the problem it seems – the old 2-theme structure.

    I am using the premium ‘edu-clean’ home theme coupled with the BP default ‘bpmember’ theme which is no longer in existence after I have upgraded my BP to 1.1.2. I needed to customize my ‘register’ page. Instead of using WPMU wp-signup.php, I wanted my signup page similar to bphome’s.

    To accomplish this, I simply created a page template(register.php) similar to bphome’s. Added a new page with the register slug, associated it with this template and made the user redirect from wp-signup.php to /register.

    My problem is, on my register template I have used <?php bp_core_signup_do_signup() ?> to display the registration form in the left-column widget. Now, from what I understand, this function is deprecated in 1.1.2. Perhaps, this is the reason my profile fields aren’t getting saved? I still am not sure, but in any case, I would like to replace this function with its equivalent function in 1.1.2.

    I want to retain this layout (i.e using edu-clean as the WPMU theme and bpmember as the BP theme) as of now. I still haven’t gotten the hang of the new single-theme architecture, but I’m working on it. Until I get that right, is there any way we can save our site users the trouble of having to save their profile fields twice?

    Please advice!

    -Sib

    #55377
    buzz2050
    Participant

    Well, I would be happy to share the solution, but I don’t really think my way is all that elegant, there’s got to be a better way and I’m waiting for someone to suggest it to me.

    Meanwhile, I am still using the old 2-theme model. I made some customizations in my bpmember theme to achieve this and put in some code in plugins/bp-custom.php as well.

    Firstly, we have a custom profile field called ‘Role’. And we wanted to have separate Role-tabs (as you can see on our site) to list all members for THAT role.

    To achieve this, I completely changed the bpmember/directories/members/index.php code and put in my ‘Role’ tab-structure there. Then, instead of making the members index file call the members-loop, I wrote a modified version of the members-loop, made it as a function and put it in my bp-custom.php. Now I make a call to this function (which is basically the members-loop) from my bpmember/directories/members/index.php page.

    To give you an eg of how we display all companies under the Company tab:

    In my bpmember/directories/members/index.php, under the code section for ‘Company’ tab I make a call like:

    display_members_by_role(‘Company’);

    In my bp-custom.php, I have written a function display_members_by_role($role) which is nothing but a slightly modified version of the members-loop.

    Here, in the ‘while’ for members-loop, I check for the Role field for that user-id. For this eg, if the Role is ‘Company’, print that member in the company-listing, else not.

    This is the code I have put in the members-loop which checks the custom profile field (which is this case is ‘Role’) and it’s value for that user-id:

    ...
    ...
    <?php while ( bp_site_members() ) : bp_the_site_member(); ?>

    <?php
    global $site_members_template ;

    $arr = BP_XProfile_ProfileData::get_value_byfieldname(array('Role'), $site_members_template->member->id) ;

    if( $arr['Role'] == $role) //$role is the role value received by the function, in this eg - Company
    {
    //do whatever
    }
    <?php endwhile; ?>
    ....
    ....

    Same logic is used for all other roles.

    BTW, get_value_byfieldname() can return values for multiple fields too. In case you want to retrieve values of more than one profile fields, its easily possible. Say I want the ‘City’ custom field value too, then I would pass something like –

    $arr = BP_XProfile_ProfileData::get_value_byfieldname(array(‘Role’,’City’)

    and access the ‘City’ value using $arr[‘City’]

    This function is pretty handy.

    While I am able to print the members belonging to that corresponding role using this logic, what I can’t get into place is the pagination part. The pagination still takes into account ‘All’ members since the members-loop technically does retrieve all members.

    All I have done is put a condition in order to just get the members for that role displayed. I was wondering if I should put in a separate pagination module, or if there is any other way of achieving this whole thing.

    -Sib

    #55306
    stwc
    Participant

    For what it’s worth, I ended up disabling Facebook connect as I approach site launch. It’s been characterized quite a few times as bare-bones, and it pretty much is. It works great for signups, but allows people to bypass filling out any profile fields, and accounts created using it cannot be logged-in-to once its been disabled (without a manual password reset by the admin).

    I’d really (really!) love to see a more integrated, fully-featured version (and may end up putting it together myself eventually if nothing appears and I learn more about how the guts of BP work), one that integrates a little better with BP profiles and allows people to login ‘normally’ to accounts created with it if they want — I think it would be a great tool to smooth the already low speedbump to user account creation, but I got scared about what would happen if I start (as I hope) to get a lot of signups and it breaks in future.

    #55130
    jazgold
    Participant

    just buy a bag of buns

    there are quite a few wordpress plugins for extending user profiles…

    i once used cimy extra user fields for a project, and it worked fine for my purposes. it looks like there are a bunch of options nowadays.

    #7266
    buzz2050
    Participant

    Hi,

    This is my first time with BP and my very first post in the BP forums. I have a query related to the members-loop.

    We have grouped our bp members role-wise. They choose a role from a set of four predefined roles while signing up (it’s a custom profile field).

    I have provided 4 tabs for 4 roles on my members page and clicking on a particular tab should only show the members belonging to THAT role. How can this elegantly be achieved with BP 1.1? Is there any template tag available?

    I basically want to collect the members-array that is returned by bp_site_members() and further filter it by ‘role’.

    I suppose I can hack the core, or maybe add my own function in bp-custom.php file to retrieve the members by whatever clause I want or maybe there is already a way in BP of doing this that I’m just not aware of.

    Not sure, if this is much simpler in logic than in my head right now.

    Any help much appreciated

    Thanks,

    Sib

    #7214
    grosbouff
    Participant

    Here’s a piece of code I wrote to sync the

    -name (core field)

    -last name (custom field)

    -first name (custom field)

    from BP with WPMU :

    -BP name becomes WPMU display name

    -BP first name becomes WPMU first name

    -BP last name becomes WPMU last name

    You have to create those 2 fields in the xprofile admin; then set their ids in the functions

    $first_name_field_id=…;

    $name_field_id=…;

    They have to be set in the BASE group of xprofile (group id #1).

    function sync_wp_bp_names() {

    global $bp;

    if (bp_get_current_profile_group_id()!=1) return false;

    require_once( ABSPATH . WPINC . ‘/registration.php’);

    $user = new WP_User($bp->displayed_user->id);

    $first_name_field_id=40;

    $name_field_id=39;

    //DISPLAY NAME == BP NAME

    if ( isset( $_POST[‘field_1’] ))

    $user->display_name = esc_html( trim( $_POST[‘field_1’] ));

    //FIRST NAME

    if ( isset( $_POST[‘field_’.$first_name_field_id] ))

    $user->first_name = esc_html( trim( $_POST[‘field_’.$first_name_field_id] ));

    //LAST NAME

    if ( isset( $_POST[‘field_’.$name_field_id] ))

    $user->last_name = esc_html( trim( $_POST[‘field_’.$name_field_id] ));

    wp_update_user( get_object_vars( $user ) );

    }

    add_action( ‘xprofile_updated_profile’, ‘sync_wp_bp_names’ );

    What do you think of that ?

    I also don’t understand the differences between display name and nicename in WPMU…

    #54933
    grosbouff
    Participant

    Here’s a piece of code to replace the displayed nickname by name+firstname.

    change $first_name_field_id and $name_field_id to match your fields.

    /**

    NAME + FIRSTNAME | START

    */

    function user_name_firstname($fullname,$user_id=false) {

    global $bp;

    global $site_members_template;

    $first_name_field_id=40;

    $name_field_id=39;

    if ( !$user_id ) $user_id=bp_get_the_site_member_user_id();

    if ( function_exists(‘xprofile_install’) ) {

    $first_name= xprofile_get_field_data($first_name_field_id, $user_id );

    $name = xprofile_get_field_data($name_field_id, $user_id );

    if ($name) {

    $fullname = $name;

    if ($first_name) $fullname.=‘ ‘.$first_name;

    }

    wp_cache_set( ‘bp_user_fullname_’ . $user_id, $fullname, ‘bp’ );

    }

    return apply_filters( ‘user_name_firstname’, $fullname );

    }

    add_filter( ‘bp_get_the_site_member_name’, ‘user_name_firstname’,9);

    /**

    NAME + FIRSTNAME | END

    */

    Now I have to find a way to order the directory member results by Name+Firstname… Any idea ?

    #54788
    jantanner
    Participant

    Thanks for the quick help. It works fine with me.

    Any quick idea, how to link it to the members search like usual profile fields do?

    greetings from berlin

    Christoph

    #54743

    In reply to: Profile Field Linking

    Paul Wong-Gibbs
    Keymaster

    It might be a better idea to use the xprofile data template loop https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/ and put some IFs in so it only uses the fields you want to see?

    #7148
    wordpressfan
    Participant

    In the default profile-loop, field data is linked so that you can click on “Chicago” and every member that lists “Chicago” as her location will be listed. However, linking is gone when I use the following to extract data from specific fields:

    echo xprofile_field_data('field#');

    How do I retain the normal field data linking?

    #54734
    wordpressfan
    Participant

    The next step would be to add some code checking first to see whether there is any data for that field. If true, print the data, if not echo ‘(no data found)’.

    #54733
    wordpressfan
    Participant

    @smuda: yes.

    @poolie: thanks! that works.

    #54699
    Paul Wong-Gibbs
    Keymaster
    #54682
    poolie
    Participant

    <?php echo xprofile_get_field_data('2'); ?>

    would work, where 2 is the id of the field.

    #54681
    smuda
    Participant

    @wordpressfan did you wrap <? ?> around it? :)

    @andy that still doesn’t seem to work. <?php echo xprofile_get_field_data($2); ?> gives an error. <?php echo xprofile_get_field_data($name); ?> too. :/

    #54678
    wordpressfan
    Participant

    How do I echo the field’s data?

    The line “echo xprofile_get_field_data( $field_name_or_id [, optional $user_id] );” only displays “echo xprofile_get_field_data( $field_name_or_id [, optional $user_id] );”

    #7140
    wordpressfan
    Participant

    I want to display the data of individual profile fields, rather than printing them all at one time. For instance, I have a “location” field in the base profile area.

    #7075
    mr_adamson
    Participant

    Hello.

    In the wp-admin under “buddyPress” and “Profile Field Setup” i have created two custom fields “Location” and “Favorite Grape”,

    When i user resgisters these fields are shown on the registration page but the data isn’t saved.

    But when the user edits the profile the two boxes appear (but blank) and if the data is entered then it is saved.

    I have noticed that the table “wp_bp_xprofile_data” isn’t storing these details until they edit their profile.

    Does anyone know what i need to do to make it work.

    Thank you

    #54356
    shedmore
    Participant

    Anybody have ideas on the post/question above????

    fubp
    Participant

    *Bump.

    Please anyone?

    fubp
    Participant

    When a user registers and adds the custom profile date information, they cannot be seen on the profile. However if you go into edit profile mode later, and enter the information, it then becomes viewable.

    wp_bp_xprofile_data table does not get filled with the custom profile data. However once user edits the profile, that data is then entered.

    Is this a bug? I am using 1.1.1 of BP and wordpress 2.8.4a

    fubp
    Participant

    I checked the database and all I saw was some arrays in the wp_signups meta info.

    Any clean method of getting that info out ?

    #7018
    danielfelice
    Participant

    Hi Everyone,

    I think this question was asked a while back but I cannot find it in the forums.

    I am wondering how to remove the auto linking in the profile info fields on the member page. I want to remove the link for the members name and replace it with the link the user enters for the URL.

    So the members name in the profile info area links to they specify when signing up.

    Thanks

    Dan

    #7008

    Below is an example of how to add a simple text field to a new users usermeta when they register…

    In a new plugin file, your functions.php, or bp-custom.php put…

    /* Add sign-up field to BuddyPress sign-up array */
    function bp_custom_user_signup_field( $usermeta ) {
    $usermeta['field_name'] = $_POST['name_of_field_in_template'];

    return $usermeta;
    }
    add_filter( 'bp_signup_usermeta', 'bp_custom_user_signup_field' );

    /* Add field_name from sign-up to usermeta on activation */
    function bp_user_activate_field( $signup ) {

    update_usermeta( $signup['user_id'], 'field_name', $signup['meta']['name_of_field_in_template'] );

    return $signup;
    }
    add_filter( 'bp_core_activate_account', 'bp_user_activate_field' );

    Then somewhere in your custom register.php file, put…

    <input type="input" name="name_of_field_in_template" id="name_of_field_in_template" value="" />

    Replace “name_of_field_in_template” and “field_name” with what you need, and rename the functions if you want to, etc… Now when people sign up on your website, you can have custom usermeta that gets entered when they activate their account!

    If you wanted to pump this up a notch, it’s possible to create a function to retain the value and send/receive field formatting errors also, so you can expand this to do something like youtube or twitter id’s on sign-up, outside of tying the fields into xprofile. Obvious uses for this would be to integrate BP with existing plugins that use usermeta already, letting your sign-up process get the headstart on setting up user accounts with the information those plugins want/need.

    Have fun! Happy hacking!

    I might make an example plugin for people to tear apart later if there’s interest.

Viewing 25 results - 5,226 through 5,250 (of 5,755 total)
Skip to toolbar