Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 5,076 through 5,100 (of 5,698 total)
  • Author
    Search Results
  • #59885
    Boris
    Participant

    @Bowe

    setting up different group types is fairly easy. You just have to attach some groupmeta to the group, that basically let you add as many types as you’d like. Then you just check the metadata to figure out what type of group you’re in. Using the groups API you can then add different functionality for different groups.

    I’ve written a types-plugin for one of my sites. It doesn’t have an interface, though. The 3 types I needed are hardcoded into it, so it’s really not suited for a release at the moment. There’s also a lot of more stuff, like a shopping cart, part of that plugin. So, I’ve stripped the functions needed for group types out (hopefully al of them).

    First we need to add the addtional fields to our registration form:

    function sv_add_registration_group_types()
    {
    ?>
    <div id="account-type" class="register-section">
    <h3 class="transform"><?php _e( 'Choose your account type (required)', 'group-types' ) ?></h3>

    <script type="text/javascript" defer="defer">
    jQuery(document).ready(function(){
    jQuery("#account-type-normal_user").attr("checked", true);
    jQuery("#group-details").hide();
    jQuery("#account-type-type_one,#account-type-type_two,#account-type-type_three").click(function(){
    if (jQuery(this).is(":checked")) {
    jQuery("#group-details").slideDown("slow");
    } else {
    jQuery("#group-details").slideUp("slow");
    }
    });
    jQuery("#account-type-normal_user").click(function(){
    if (jQuery(this).is(":checked")) {
    jQuery("#group-details").slideUp("slow");
    } else {
    jQuery("#group-details").slideDown("slow");
    }
    });
    });
    </script>

    <?php do_action( 'bp_account_type_errors' ) ?>
    <label><input type="radio" name="account_type" id="account-type-normal_user" value="normal_user" checked="checked" /><?php _e( 'User', 'group-types' ) ?></label>
    <label><input type="radio" name="account_type" id="account-type-type_one" value="type_one" /><?php _e( 'Type 1', 'group-types' ) ?></label>
    <label><input type="radio" name="account_type" id="account-type-type_two" value="type_two" /><?php _e( 'Type 2', 'group-types' ) ?></label>
    <label><input type="radio" name="account_type" id="account-type-type_three" value="type_three" /><?php _e( 'Type 3', 'group-types' ) ?></label>

    <div id="group-details">
    <p><?php _e( 'We will automatically create a group for your business or organization. This group will be tailored to your needs! You can change the description and the news later in the admin section of your group.', 'group-types' ); ?></p>

    <?php do_action( 'bp_group_name_errors' ) ?>
    <label for="group_name"><?php _e( 'Group Name', 'scuba' ) ?> <?php _e( '(required)', 'buddypress' ) ?></label>
    <input type="text" name="group_name" id="group_name" value="" />
    <br /><small><?php _e( 'We suggest you use the name of your business or organization', 'group-types' ) ?></small>

    <label for="group_desc"><?php _e( 'Group Description', 'scuba' ) ?></label>
    <textarea rows="5" cols="40" name="group_desc" id="group_desc"></textarea>
    <br /><small><?php _e( 'This description will be visible on your group profile, so it could be used to present your mission statement for example.', 'group-types' ) ?></small>

    <label for="group_news"><?php _e( 'Group News', 'scuba' ) ?></label>
    <textarea rows="5" cols="40" name="group_news" id="group_news"></textarea>
    <br /><small><?php _e( 'Enter any news that you want potential members to see.', 'group-types' ) ?></small>
    </div>
    </div>
    <?php
    }
    add_action( 'bp_before_registration_submit_buttons', 'sv_add_registration_group_types' );

    Then we have to validate things and add some usermeta when a regitration happens:

    /**
    * Add custom userdata from register.php
    * @since 1.0
    */
    function sv_add_to_signup( $usermeta )
    {
    $usermeta['account_type'] = $_POST['account_type'];

    if( isset( $_POST['group_name'] ) )
    $usermeta['group_name'] = $_POST['group_name'];

    if( isset( $_POST['group_desc'] ) )
    $usermeta['group_desc'] = $_POST['group_desc'];

    if( isset( $_POST['group_news'] ) )
    $usermeta['group_news'] = $_POST['group_news'];

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

    /**
    * Update usermeta with custom registration data
    * @since 1.0
    */
    function sv_user_activate_fields( $user )
    {
    update_usermeta( $user['user_id'], 'account_type', $user['meta']['account_type'] );

    if( isset( $user['meta']['group_name'] ) )
    update_usermeta( $user['user_id'], 'group_name', $user['meta']['group_name'] );

    if( isset( $user['meta']['group_desc'] ) )
    update_usermeta( $user['user_id'], 'group_desc', $user['meta']['group_desc'] );

    if( isset( $user['meta']['group_news'] ) )
    update_usermeta( $user['user_id'], 'group_news', $user['meta']['group_news'] );

    return $user;
    }
    add_filter( 'bp_core_activate_account', 'sv_user_activate_fields' );

    /**
    * Perform checks for custom registration data
    * @since 1.0
    */
    function sv_check_additional_signup()
    {
    global $bp;

    if( empty( $_POST['account_type'] ) )
    $bp->signup->errors['account_type'] = __( 'You need to choose your account type', 'group-types' );

    if( empty( $_POST['group_name'] ) && $_POST['account_type'] != 'normal_user' )
    $bp->signup->errors['group_name'] = __( 'You need to pick a group name', 'group-types' );

    if( ! empty( $_POST['group_name'] ) && $_POST['account_type'] != 'normal_user' )
    {
    $slug = sanitize_title_with_dashes( $_POST['group_name'] );
    $exist = groups_check_group_exists( $slug );
    if( $exist )
    $bp->signup->errors['group_name'] = __( 'This name is not available. If you feel this is a mistake, please <a href="/contact">contact us</a>.', 'group-types' );
    }
    }
    add_action( 'bp_signup_validate', 'sv_check_additional_signup' );

    And then we set up the group for the user (there are some constants in this function, so you’ll need to change that):

    /**
    * Create custom groups for skools, biz and org accounts
    * @since 1.0
    */
    function sv_init_special_groups( $user )
    {
    global $bp;

    // get account type
    $type = get_usermeta( $user['user_id'], 'account_type' );

    if( $type == 'normal_user' )
    {
    // Do nothing
    }
    elseif( $type == 'type_one' || $type == 'type_two' || $type == 'type_three' )
    {
    // get some more data from sign up
    $group_name = get_usermeta( $user['user_id'], 'group_name' );
    $group_desc = get_usermeta( $user['user_id'], 'group_desc' );
    $group_news = get_usermeta( $user['user_id'], 'group_news' );

    $slug = sanitize_title_with_dashes( $group_name );

    // create dive skool group
    $group_id = groups_create_group( array(
    'creator_id' => $user['user_id'],
    'name' => $group_name,
    'slug' => $slug,
    'description' => $group_desc,
    'news' => $group_news,
    'status' => 'public',
    'enable_wire' => true,
    'enable_forum' => true,
    'date_created' => gmdate('Y-m-d H:i:s')
    )
    );
    // add the type to our group
    groups_update_groupmeta( $group_id, 'group_type', $type );

    // delete now useless data
    delete_usermeta( $user['user_id'], 'group_name' );
    delete_usermeta( $user['user_id'], 'group_desc' );
    delete_usermeta( $user['user_id'], 'group_news' );

    // include PHPMailer
    require_once( SV_MAILER . 'class.phpmailer.php' );

    $mail = new PHPMailer();
    $mail->IsSMTP();
    $mail->Host = SV_SMTP;

    $auth = get_userdata( $user['user_id'] );
    $profile_link = $bp->root_domain . '/' . $bp->groups->slug . '/' . $slug . '/admin';

    $message = sprintf( __( 'Hello %s,

    we have created a group for your business or organization. To get more out of your presence on Yoursitenamehere please take some time to set it up properly.

    Please follow this link to fill in the rest of your profile: %s

    We wish you all the best. Should you have any questions regarding your new group, please contact us at support@yoursitenamehere.com.

    Your Yoursitenamehere Team', 'group-types' ), $auth->display_name, $profile_link );

    $mail->SetFrom("support@yoursitenamehere.com","Yoursitenamehere");
    $mail->AddAddress( $auth->user_email );

    $mail->Subject = __( 'Your new group pages on Yoursitenamehere', 'group-types' );
    $mail->Body = $message;
    $mail->WordWrap = 75;
    $mail->Send();
    }
    }
    add_action( 'bp_core_account_activated', 'sv_init_special_groups' );

    When you write a group extension we’ll have to swap the activation call with a function like the one below to be able to check for group types.

    /**
    * Replacement activation function for group extension classes
    */
    function activate_type_one()
    {
    global $bp;
    $type = groups_get_groupmeta( $bp->groups->current_group->id, 'group_type' );
    if( $type == 'type_one' )
    {
    $extension = new Group_Type_One;
    add_action( "wp", array( &$extension, "_register" ), 2 );
    }
    }
    add_action( 'plugins_loaded', 'activate_type_one' );

    The last thing we need to do is add our group type names to group and directory pages:

    /**
    * Modify the group type status
    */
    function sv_get_group_type( $type, $group = false )
    {
    global $groups_template;

    if( ! $group )
    $group =& $groups_template->group;

    $gtype = groups_get_groupmeta( $group->id, 'group_type' );
    if( $gtype == 'type_one' )
    $name = __( 'Type 1', 'group-types' );

    elseif( $gtype == 'type_two' )
    $name = __( 'Type 2', 'group-types' );

    elseif( $gtype == 'type_three' )
    $name = __( 'Type 3', 'group-types' );

    else
    $name = __( 'User Group', 'group-types' );

    if( 'public' == $group->status )
    {
    $type = sprintf( __( "%s (public)", "group-types" ), $name );
    }
    elseif( 'hidden' == $group->status )
    {
    $type = sprintf( __( "%s (hidden)", "group-types" ), $name );
    }
    elseif( 'private' == $group->status )
    {
    $type = sprintf( __( "%s (private)", "group-types" ), $name );
    }
    else
    {
    $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' );
    }

    return $type;
    }
    add_filter( 'bp_get_group_type', 'sv_get_group_type' );

    /**
    * Modify the group type status on directory pages
    */
    function sv_get_the_site_group_type()
    {
    global $site_groups_template;

    return sv_get_group_type( '', $site_groups_template->group );
    }
    add_filter( 'bp_get_the_site_group_type', 'sv_get_the_site_group_type' );

    It’s quite a bit of code, but it should get you started. This hasn’t been tested with 1.2 btw.

    #8144
    gregfielding
    Participant

    http://housingstorm.com

    I’m using Boone’s Custom Profile Fields Plugin.

    A no-follow tag is automatically inserted when there is an external hyperlink in a profile field.

    Any ideas how to remove them?

    Thanks, Greg

    #59761
    Boris
    Participant

    Basically, you could extend the registration form by using one of the many hooks provided there. The data your user inputs there can then be saved as usermeta and it won’t show on their profile. Something like this:

    /**
    * Add xtra input field to registration form
    * @since 4.0
    */
    function tj_add_to_registration()
    {
    ?>
    <div id="tos" class="register-section">
    <h3 class="transform"><?php _e( 'Don\'t forget...', 'traveljunkie' ) ?></h3>

    <?php do_action( 'bp_accept_tos_errors' ) ?>
    <label><input type="checkbox" name="accept_tos" id="accept_tos" value="agreed" /> <?php _e( 'Check this box to accept our <a href="/terms-of-service" target="_blank">Terms Of Service</a> (required)', 'traveljunkie' ) ?></label>
    </div>
    <?php
    }
    add_action( 'bp_before_registration_submit_buttons', 'tj_add_to_registration' );

    /**
    * Add custom userdata from register.php
    * @since 4.0
    */
    function tj_add_to_signup( $usermeta )
    {
    $usermeta['accept_tos'] = $_POST['accept_tos'];

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

    /**
    * Update usermeta with custom registration data
    * @since 4.0
    */
    function tj_user_activate_fields( $user )
    {
    update_usermeta( $user['user_id'], 'accept_tos', $user['meta']['accept_tos'] );

    return $user;
    }
    add_filter( 'bp_core_activate_account', 'tj_user_activate_fields' );

    /**
    * Perform checks for custom registration data
    * @since 4.0
    */
    function tj_check_additional_signup()
    {
    global $bp;

    if( $_POST['accept_tos'] != 'agreed' )
    $bp->signup->errors['accept_tos'] = __( 'Please make sure to read our Terms of Service and then check this box!', 'traveljunkie' );

    }
    add_action( 'bp_signup_validate', 'tj_check_additional_signup' );

    I haven’t tested the above code much so there might be some bugs…

    #8137
    lukabernardi
    Participant

    When you sign I need to prompt the user for sensitive information like his phone or his address, but I do not want to be then displayed on their profile for obvious reasons of privacy.

    How can I do?

    #59730
    Paul Wong-Gibbs
    Keymaster
    #8133
    gregfielding
    Participant

    I set up a “text” profile field for members of my community to put their website addresses.

    My community is http://housingstorm.com

    For example, if you go to member Julie and click on her link, if takes you to this address:

    http://housingstorm.com/members/?s=www.JuliaOdom.com

    Instead of this one: http://www.juliaodom.com

    The e-mail address in the text field below it doesn’t work either.

    What is programed into my code that would make these links not work and how can I fix it?

    Is there a better way to do this?

    Thanks!

    #59558
    Suzanne Ahjira
    Participant

    Are you asking whether a realtor community, storing and fetching realtor information is possible with BP? Or are you asking whether you could have that layout with additional member field data?

    I agree with Peter in that, the data displayed here is coming out of a complex realty system. But the layout is nothing special. You could do that with BP. You’d just add the extra fields to the member directory layout (user meta) and the members themselves would have to supply that data in their profiles.

    #59527
    Kate
    Participant

    I’d like to use this on a current project I have, but being a BP/WPMU newbie, I’m a little lost about setting it up. I have it installed, I’m just not sure about what goes in the following fields:

    “Which group contains the location information?”

    “Which field represents each user’s location?”

    “Which field represents a description for each user (i.e. ‘About Me’)?”

    Any chance any one else has used this and could give me a quick breakdown of what they’re for, and how I’d go about setting them up. I would’ve posted on the BraveNewCode forums, but I guess those are down for a while. Also, I can’t find any documentation on the site for it.

    I’m now using another 3rd party plugin for membership to the site (WP eMember). While it has its own table, it also creates a matching WP user for each of the members it creates. I was thinking of adding some code to add users to a group on creation of their profile, and then using this group as the group that “contains the location information”. Am I on the right track?

    Thanks in advance for any help!

    #59523
    Bowe
    Participant

    @Teebes: you can already do what you want with auto group join: http://brentandmary.net/2009/10/24/bn-auto-join-group-plugin/

    I’m planning to do the same for my site. Based on certain profile fields they are put in different groups after signup!

    #59522
    teebes
    Participant

    I love the idea of as an admin, creating a relationship between profile fields (not necessarily required ones) and groups. In fact, I was scouring around my new 1.2 install hoping this feature was already live :) I see it as a good way to get folks involved in their specific demographic while always having the ability to leave the group if they want.

    I see this as an option when defining a group, keeping the current public/private options intact, just adding another criteria or ‘group profile rule’.

    #59481
    sclough
    Participant

    I never could get this to work right. I had to instead create a plugin that hooked into actions to save the data and then hooks into the template to add the edit fields on the group profile page.

    #59405

    In reply to: Enterprise Buddypress

    peterverkooijen
    Participant

    The name field was previously split into “First Name / Last Name” fields, but this is an issue for internationalization. In future versions it may be possible to apply rules to profile fields that will determine the content allowed.

    That is such a silly argument. 90 percent of the civilized world uses firstname + lastname. Why make life difficult for the rest of us just because theoretically a few places in the world use only one name or three names or whatever? Why not let them hack a workaround it?

    My issue with this is also not just about that field, but more about what it says about Buddypress’ priorities. If you want to register members in your company or sports club with name, address, phone number, etc. there is no easy way to do it, you’ll have to hack core files and later you’ll have to use custom functions to retrieve the data from several different tables in the database.

    Also, BuddyPress will automatically synchronize profile fields with the WP profile fields. Check the function xprofile_sync_wp_profile()

    No it doesn’t. Version 1.0 only added first name and last name to wp_usermeta if a user updated his account data after signup. You couldn’t count on the data to be there for every member. I had to write a custom function, based on xprofile_sync_wp_profile, to force that synchronization to happen upon registration.

    #59401

    In reply to: Enterprise Buddypress

    Andy Peatling
    Keymaster

    Also, BuddyPress will automatically synchronize profile fields with the WP profile fields. Check the function xprofile_sync_wp_profile()

    #59400

    In reply to: Enterprise Buddypress

    Andy Peatling
    Keymaster

    The name field was previously split into “First Name / Last Name” fields, but this is an issue for internationalization. In future versions it may be possible to apply rules to profile fields that will determine the content allowed.

    #59396

    In reply to: Enterprise Buddypress

    peterverkooijen
    Participant

    To me the biggest barrier to more professional use of Buddypress is the lousy member/user management. Everything is based on username/password. There isn’t even a built-in way to get people to sign up with their real name, first name + last name. There is a required custom field for “Name”, but with the way the sign-up form is structured new users are almost encouraged to enter a garbage name – lowercase, one word anonymous nickname bs.

    After lots of painful hacking in core files I now have a form with one Real name field on top. My custom code in the back splits the real name and stores it in various places in the database, so at least I have synchronized data in wp_usermeta etc. Buddypress does none of this out of the box and in general BP developers don’t seem to see this as a problem. But the one field for real name still doesn’t really force new users to enter a full two-part name.

    In a previous version of my site I did have separate first name and last name fields. I NEVER had people sign up with cutesy one name names. Sure, you can create custom fields in xprofile, but synchronizing the input with all the other username, nickname, name etc. fields in the datebase and integrating them with other member management scripts businesses will have on their server requires serious database and php programming skills.

    #59282
    Andy Peatling
    Keymaster

    Just add the profile fields in the backend.

    #58828
    Boris
    Participant

    No worries. Glad I could help :)

    #58826
    Kate
    Participant

    Okay, great. Thanks for clearing it up for me. Really appreciate the help!

    #58823
    Boris
    Participant

    Not exactly what I meant. There are BP profile fields (added through the backend) and then there are usermeta (which you will have to code yourself and is WP core). Stuff that’s in your profile will be displayed publicly on your profile. Usermeta can be displayed, but doesn’t have to necessarilly.

    #58737
    Kate
    Participant

    Thanks so much for the reply Travel-Junkie. So, basically option 3: a custom profile field added to the registration form? I added a couple of these for other purposes and saw how the data is stored. Again, may be a stupid question, but I’m a WPMU/BP newbie! My only concern was that I assume the data would be erased if the drop-down itself were somehow removed by my client.

    BTW: Users can only create accounts for the main blog. They don’t have blogging privileges themselves.

    Thanks again!

    #58728
    Boris
    Participant

    I’d give them the choice during registration, then store that value as usermeta and check for each bp-component for that value and then either display the contents of that component or a nice little reminder with a link to upgrade their account.

    Not sure how well roles would work as you can have different roles in different blogs.

    #7981
    Kate
    Participant

    This is my third post recently, and it may very well be another one that makes you seasoned WPMU developers scratch your head and say “Is she for real?” Truth is, I don’t just pop in and ask questions. Believe me, it’s preceded by scouring through Google and reading countless posts. So, maybe I’m just that dense. :) Or, maybe I’m not fully understanding the use of each of these… I don’t know. But, I’m hoping I can get some input on this.

    I’m creating a site that will have three types of users: Paid Subscribers, Free Subscribers, and Trial Subscribers. The features available to each will depend on which category they fall into. I’ll need to refer back to their user type both for payment tracking, as well as what features they do or don’t see. Would it be easier to do this via:

    1) assigning each to a group (they don’t have control over changing this). Or, is this misuse of groups?

    2) creating a custom role for each of these three types, with capabilities that differ for each one.

    3) Just adding a three option drop-down at registration that lets them select which they want to be. Then, that value would be stored in their profile. (My only concern is how easily could that value be destroyed? eg: If the drop down somehow got deleted?)

    4) Custom fields

    5) Or, maybe there’s a plugin that accomplishes what I want? I came across several, but wasn’t sure if they were what I needed.

    Thanks for your input. I really appreciate it!

    dwpers
    Participant

    I have a sports networking site, and instead of having a users profile link to all members who have a favorite sports team chosen in their profile, I would like to customize it, so as to display their choice but instead of linking to members/?s=CHOICE – link it to a custom php team page I have created for each team (ex: /sports/football/nygiants.php )

    Is this possible? Thanks

    #58569

    rfauster has the right idea.

    #58566
    Roland Fauster
    Participant

    I wanted to do the same thing as h4x3d and tried his dirty trick which works..

    Anyhow here is how I did it (dunno if this is less dirty)

    $platforms = xprofile_get_field_data('Plattformen');
    $data = xprofile_format_profile_field('checkbox', $platforms);
    echo $data;

Viewing 25 results - 5,076 through 5,100 (of 5,698 total)
Skip to toolbar