Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 4,801 through 4,825 (of 5,698 total)
  • Author
    Search Results
  • #73487
    snails07
    Participant

    That works to display the Category field beneath each members profile on the members page, but what I am wanting to do is to set up a separate page that just contains links to the categories. And once these categories are clicked, then the user is taken to the page that will display all of the members in the chosen category.

    I’m guessing it would be something like

    <?php bp_get_the_profile_field_name( ‘field=Category’ ); ?>

    Any ideas?

    #73480
    danbpfr
    Participant

    open bp-themes/bp-default/members/members-loop.php

    instructions for what you need are line 42

    mgpix
    Participant

    Ok, I eventually found a workaround.

    The below code will update firstname and lastname fields in the BP member profile upon user registration :


    add_action('user_register', 'my_user_register');
    function my_user_register($user_id)
    {
    if ( function_exists( 'xprofile_set_field_data' ) ) {
    $firstname = get_usermeta( $user_id, 'first_name' );
    $lastname = get_usermeta( $user_id, 'last_name' );
    xprofile_set_field_data( 'firstname', $user_id, $firstname );
    xprofile_set_field_data( 'lastname', $user_id, $lastname );
    }
    }

    #73473
    snails07
    Participant

    I’m just thinking that the categories that I set will be stored in a database so to display these categories I will have to reference the database or something?

    #10625
    snails07
    Participant

    I am setting up a business type directory using BP. When a user signs up, they are required to choose which category their business falls under by using a drop-down select box.

    So say that I have 5 categories, I want these 5 categories displayed as links on the directory homepage so that when a user clicks on a category, they are taken to a page that displays only the members of that category.

    I’m very new to BP but have been using and modifying WP for a while so I am comfortable going in to change the code. Just don’t know what I need to change.

    Cheers

    #73453
    3sixty
    Participant

    This is now officially a “Potential Future BuddyPress Feature” for BP 1.4+ (ie, after BP 1.3, which looks to be essentially the WP 3.0 compatibility release). Here is the short list:

    A quick blog post form via the theme. (try plugin: BuddyPress QuickPress)

    Privacy controls (try plugin: bp-authz)

    Global content tagging

    Inappropriate content flagging

    Bulk accept/reject friendship requests

    Grouping of similar activity stream items

    Ability to block all communication from a user

    Option to receive forum post notifications via email

    Message file attachments

    Structured profile fields (templates for address / phone number)

    Profile field specific searching (try plugin: BP Member Filter)

    AJAX live updating of site wide activity stream

    Gene53
    Participant

    Oops, spoke too soon, if I edit anything in group 1 (where Username is hidden), I get “Please make sure you fill in all required fields in this profile field group before saving” even though everything has been filled.

    Oh well, back to the drawing board. Maybe the code wasn’t inserted in the right place and/or I have to add HTML but I haven’t a clue as to what I should add.

    Gene53
    Participant

    @jivany Wow, thanks, I simply added:

    <?php if ( 'Username' == bp_get_the_profile_field_name() ) : ?>

    <?php else : ?>

    under:

    <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>

    inserted a endif where you indicated, didn’t do any HTML formatting and the Username field is now hidden.

    Thanks again!

    Gene

    jivany
    Participant

    Well, yes, you should be able to make the username field non-editable. I would assume the username field is a “textbox” type. In edit.php, you should be able to just filter out the username field and not create a form “textbox” HTML element. So, in member/single/profile/edit.php around line 21, add in a check something like:

    <?php if ( 'username' == bp_get_the_profile_field_name() ) : ?>
    // Just display the Username with bp_the_profile_field_name() and add HTML to style how you want.
    <?php else : ?>
    // Do the existing <label... code on line 23 and 24
    <?php endif; ?>

    Now, a creative user might still be able to circumvent your little hack and submit their change directly to the form. I see a nonce being used though in the form so that might not be too much of a concern after all.

    #73429
    stwc
    Participant

    Great thread, Mr Maz.

    For my part, I am very very leery of the phrase of the moment, ‘social networking’. It’s a buzzphrase, and even when it’s used specifically and accurately, it makes me want to punch throats, a little bit, because it doesn’t mean much when you dig right into it, and to me, it evokes cheesy cheap-suited salesman making currency of faux friendship.

    But I’m kinda old skool that way. ;-)

    For those of us — most, probably — who’ve been working or at least dabbling in the data for decades, we’ve seen dozens of bandwagons boarded and polluted and just as quickly disembarked and abandoned when the next thing came along. The avalanche of ‘social networking gurus’ and all the rest will fade in time, too.

    For me, the real thing at the highest handwavy level is ‘community’ and more specifically, community on the web. Tools and toolsets and platforms and apps and APIs and all the loosely- and tightly-coupled stuff that enables people who share some set of interests, no matter how specific or broad, to get together and interact and form communities, with all the real-world parallels but also all the special because-it’s-on-the-internet factors rolled in.

    This means a couple of things, and again, talking at a much higher level than the technical here — it means that the platform itself disappears for the user after they become accustomed to it. That it’s designed in terms of interface and functionality to not only provide the features users want, even if they don’t know it, but also to be as invisible as possible as they use it.

    It also means that the platform has to have a robust set of tools for the administrator and moderators of the community (because these things are necessary, to some extent, in community on the web) to use a light hand in keeping the community on an even keel.

    I think web community, more perhaps for people who are not so much of the disposable, in-the-moment, ritalin-riddled, post-it-and-forget it generation, needs to have feet solidly planted in not only the ongoing ephemeral stream of conversation, but also in a more long-term, permanent ‘space’ of shared history, shared interactions that are performed in public and can be gone back to, interactions that more than any set of xprofile fields or avatars build a mutual understanding between users based on personality and past discussion. Build, in other words, community.

    This last is why I keep mentioning how important I believe the forum component of Buddypress to be, and why I’ve spent the bulk of my time on my current not-yet-launched BP site for an existing community trying to beef it up (with the help of some of the excellent plugins that people have been releasing).

    ‘Social networking’ doesn’t excite me. Communities of people from all over the place, communities that can only exist because they are on the internet, that’s what excites me. Buddypress, to me, is a toolset for building communities on the web. It may be a distinction without a difference for many, but I think it’s an important one.

    OK, enough handwaving.

    #73417
    Boone Gorges
    Keymaster

    @Erich73 – I can understand your point of view, but my feeling is that the Send Invites feature is essentially independent of groups. The way I’ve built it, it’s really an extension of an individual’s profile. Because of the way that a user’s sent invites are tracked, it makes more sense to organize things that way. At some point in the future it might be possible to include email fields directly on the group creation invite screen, but for now my plan is to leave it as it is, because it will complicate things quite a bit to handle both regular group invitations and email invitations in the same form submit.

    @hnla – I think you’re right that a large part of the issue has to do with the language around the group creation process. If you examine the underlying mechanisms, you’ll see that a group is actually fully created after step 2 (the settings page), and the avatar and send invites screens are really just setup screens after the group is created. That speaks to @roydeanjr ‘s point, which is that it is possible in theory to deactivate the Send Invites page altogether during group setup, and to find another way to encourage group admins to invite people to groups.

    @roydeanjr – I don’t think that the current method is causing groups not to be created in the db (because of the point I mention in the previous paragraph) but it certainly does sometimes cause some confusion with people using back buttons during the process, etc. What’d be nice is a message on each page to the effect of “Forget a step? Once you’ve finished the initial setup, you can reconfigure the group on the Group Admin tab” or something like that.

    Gene53
    Participant

    Thanks guys, I’ll drop the idea being that it’s way too complicated for what it’s worth.

    My reason for having the mandatory name field only (which I renamed Username) in group 1 is that the site I’m working on is username only and thanks to Brajesh Singh’s modifications in edit.php, group 1 can’t be edited by the users.

    So, my only alternative is to restore the original edit.php file, move the group 2 fields to group 1 so they may be filled out during registration but I wonder if there would be a simple way to hide or “gray out” the name field in edit.php so the user can’t change it.

    Paul Wong-Gibbs
    Keymaster

    So, yes, by default, the register page only shows group 1 (the “base” group). You only retrieve one group via the profile_group_id= parameter in the bp_has_profile() call.

    So, by default, this happens:

    What I’m trying to accomplish is to hide groups 3 and 4 on the registration page not to overwhelm the user with a bunch of fields to fill out during sign-up, those fields can be filled out once the user has activated her/his account via “edit profile”.

    There have been other threads on the forum regarding showing more than one profile group on the registration page; I found several, but take a look at https://buddypress.org/forums/topic/all-fields-for-registration. It’s probably going to be really difficult to implement unless you have a decent understanding of PHP.

    jivany
    Participant

    Nope, I don’t think so. I was thinking you could remove the ‘profile_group_id=1’ arg from bp_has_profile but that doesn’t seem to allow the registration page to show more groups. I guess it appears that the only “required” fields for registration are the required ones in the Base group.

    Might be worth opening a ticket on this one to see if that is the expect behaviour. Alternatively, ping R-a-y or DJPaul and see if they know.

    Gene53
    Participant

    Nope, only getting group 1. I wonder if:

    <?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    can be modified to fetch group 2 also.

    LOL, this is driving me nuts…

    jivany
    Participant

    No worries. The code I gave should display everything except group 3 & 4. Sorry, I think I said it backwards in the previous post.

    That said, even without the code, I’m only getting group 1 showing up on the registration page so I’m not really sure what’s going on in register.php now. ;)

    Gene53
    Participant

    Darn, you’re right, I restored an original version of register.php and only group 1 shows. I’ll go and try your code to see if I can get group 2 to load.

    Sorry about that…

    #73218
    jivany
    Participant

    Well, you should be able to create pretty much everything you need in your theme’s functions.php file.

    First you need to decide at what point you want to populate the fields. Find a hook in the code to attach to by looking for do_action(‘some_action_hook_name’) calls. In your functions.php file, make a new function and call something like:

    add_action('some_action_hook_name','my_nifty_auto_pop_function');

    Then create your nifty_auto_pop_function that fills in the xprofile fields you want to populate.

    Look in the bp-xprofile directory for all of the different files/functions to help fill in and read profile fields.

    jivany
    Participant

    OK, now I’m scratching my head.

    When I create a second group, even if I tag the fields in the second group as “required”, they don’t show up on the register page (the bp-default version). The second group only shows up on the user’s profile page where they can edit the fields. They are tagged as “required” but nothing seems to force the user to fill them out.

    I’m confused now as to what you’re seeing and/or trying to do.

    #73216
    jfcarter
    Participant

    After registration. These are not required fields.

    Gene53
    Participant

    Oops,sorry, I think there was a misunderstanding, bp-register loads all groups by default, what I’m trying to accomplish is to hide (or not load) groups 3 and 4 so the user can fill those optional field groups once they’ve activated their accounts..

    jivany
    Participant

    OK. I’m thinking you can do something like this. Find this part of the file in register.php:

    <?php /***** Extra Profile Details ******/ ?>

    <?php if ( bp_is_active( 'xprofile' ) ) : ?>
    <div class="register-section" id="profile-details-section">

    <h4><?php _e( 'Profile Details', 'buddypress' ) ?></h4>

    <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
    <?php if ( function_exists( 'bp_has_profile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>

    At this point, add in a line like:

    if( (bp_the_profile_group != "3") || (bp_the_profile_group != "4") ) :

    Then go down to this part of the file:

    <?php endwhile; ?>

    <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids() ?>" />

    <?php endwhile; endif; endif; ?>

    </div><!-- #profile-details-section -->

    Before the first endwhile line, insert this:

    <?php endif; ?>

    I *think* that should spit out groups 3 & 4 (assuming you have groups 3 & 4 defined in your profile groups). You might need to add in group “1” also to get the Base. The only part I’m not sure about right now is if the number need to be in double quotes or just bare. So it might be:

    if( (bp_the_profile_group != 3) || (bp_the_profile_group != 4) ) :

    I think. ;)

    Gene53
    Participant

    @jivany, I’ve been playing around with this all afternoon but to no avail (learning PHP as I go along), either group no. 2 shows up but group 1 (name) doesn’t, or group 1 and only 1 field out of 6 from group 2 or neither groups 1 and 2.

    I give up, LOL

    Thanks,

    Gene

    newbie999
    Participant

    Hello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:

    I added the code below in wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php, to display additional profile fields in the member directory and to display the member’s role (either ‘Subscriber’ or ‘Provider’). In the code below, I specifically checked for the user’s role to determine whether I need to display ‘Subscriber’ or ‘Provider’.

    Questions:

    – is there a way to check for the capability instead – i.e., if the user can ‘edit posts’ then I will display ‘Subscriber’, otherwise I will display ‘Provider’? If so, can you please let me know how to do that as I have not been able to figure it out.

    – is there a way to display a newline so that ‘Subscriber’ or ‘Provider’ will display on the next line, below the member’s title and company name. I tried to echo “n” but it’s not outputting a newline and I have no idea why.

    Thank you for the help.

    <?php

    /***

    * If you want to show specific profile fields here you can,

    * but it’ll add an extra query for each member in the loop

    * (only one regadless of the number of fields you show):

    *

    * bp_member_profile_data( ‘field=the field name’ );

    */

    if( bp_get_member_profile_data ( ‘field=Title’ ) )

    echo bp_member_profile_data( ‘field=Title’ ), ‘ (‘, bp_member_profile_data( ‘field=Company’ ), ‘)’, ‘ – ‘;

    $user = new WP_User( bp_get_member_user_id() );

    if ( $user->roles[0] == ‘subscriber’ )

    echo ‘Subscriber’;

    else

    echo ‘Provider’;

    ?>

    newbie999
    Participant

    Hello again. I posted this question on a new topic, no responses. I’ll try asking the question here since I have received responses on this thread. Thank you. Here goes:

    I added the code below in wp-content/plugins/buddypress/bp-themes/bp-default/members/members-loop.php, to display additional profile fields in the member directory and to display the member’s role (either ‘Subscriber’ or ‘Provider’). In the code below, I specifically checked for the user’s role to determine whether I need to display ‘Subscriber’ or ‘Provider’.

    Questions:

    – is there a way to check for the capability instead – i.e., if the user can ‘edit posts’ then I will display ‘Subscriber’, otherwise I will display ‘Provider’? If so, can you please let me know how to do that as I have not been able to figure it out.

    – is there a way to display a newline so that ‘Subscriber’ or ‘Provider’ will display on the next line, below the member’s title and company name. I tried to echo “n” but it’s not outputting a newline and I have no idea why.

    Thank you for the help.

    <?php

    /***

    * If you want to show specific profile fields here you can,

    * but it’ll add an extra query for each member in the loop

    * (only one regadless of the number of fields you show):

    *

    * bp_member_profile_data( ‘field=the field name’ );

    */

    if( bp_get_member_profile_data ( ‘field=Title’ ) )

    echo bp_member_profile_data( ‘field=Title’ ), ‘ (‘, bp_member_profile_data( ‘field=Company’ ), ‘)’, ‘ – ‘;

    $user = new WP_User( bp_get_member_user_id() );

    if ( $user->roles[0] == ‘subscriber’ )

    echo ‘Subscriber’;

    else

    echo ‘Provider’;

    ?>

Viewing 25 results - 4,801 through 4,825 (of 5,698 total)
Skip to toolbar