Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 3,326 through 3,350 (of 3,589 total)
  • Author
    Search Results
  • #50230

    In reply to: Gender Specific

    r-a-y
    Keymaster

    You could use BuddyPress’ x-profile fields to create a required, custom radio button for gender.

    The hard part will be hacking the activity feed to show the pronoun differential.

    You’d have to create your own function similar to Buddypress’ bp_your_or_their() function.

    Then apply that function as a filter on bp_activity_content_filter.

    Korhan Ekinci
    Participant
    #50013
    plrk
    Participant

    I’m not sure what you want to do, but with this code, you can get a list of the options and the amount of users who have selected the option. Note: for selectbox and radio fields only.

    $field_id = 1; // this should be the id of the
    // field you want, see your wp_bp_xprofile_fields
    // database table to find it

    global $wpdb;

    $sql = "SELECT value FROM {$wpdb->base_prefix}bp_xprofile_data WHERE field_id = {$field_id} ORDER BY id DESC";
    $result = $wpdb->get_col($wpdb->prepare($sql));
    foreach($result as $row){
    if(strlen($row) > 0){
    $values[$row]++;
    }
    }
    $i = 0;
    foreach($values as $key => $value){
    $i++;
    if($i != 1){
    echo ", ";
    }
    echo $key . "(" . $value . ")";
    }

    #50008
    r-a-y
    Keymaster

    Ahh okay… forget my last post entirely then! haha.

    Not sure if this will work at all…

    $myxprofileFields = new BP_XProfile_ProfileData::get_value_byfieldname('Hair Color');

    echo $myxprofileFields();

    This is where my knowledge of PHP stops here!

    I’m not that great with classes and objects.

    #50006
    r-a-y
    Keymaster

    Hey Chris,

    I’m assuming you’re using one of the prebuilt fields called “State”.

    I didn’t look too closely at the classes or template tags, but check out /buddypress/bp-xprofile/bp-xprofile-classes.php.

    There’s a function called “get_prebuilt_field_data()” that might help you out there.

    You’d have to pass the CSV file to that function, but that might help…

    Another way to output the “State” data would be to parse the actual CSV itself that is used for the data. The CSV can be found in buddypress/bp-xprofile/prebuilt-fields/states.csv.

    Hope that helps somewhat!

    #49929
    peterverkooijen
    Participant

    This plugin attempt doesn’t break anything, but still doesn’t put first_name and last_name in wp_usermeta either:

    `

    <?php

    /*

    Plugin Name: Real Name Synchro

    Plugin URI: http://

    Version: v0.001

    Author: peterverkooijen

    Description: A plugin to store firstname and lastname from the fullname field in Buddypress registration in WPMU usermeta tables.

    */

    function real_name_synchro() {

    global $bp, $wpdb, $bp_user_signup_meta;

    $fields = BP_XProfile_Field::get_signup_fields();

    if ( $fields ) {

    foreach ( $fields as $field ) {

    $value = $_POST[‘field_’ . $field->id];

    }

    }

    $field->id = ‘1’;

    $fullname = $value;

    $space = strpos( $fullname, ‘ ‘ );

    if ( false === $space ) {

    $firstname = $fullname;

    $lastname = ”;

    } else {

    $firstname = substr( $fullname, 0, $space );

    $lastname = trim( substr( $fullname, $space, strlen($fullname) ) );

    }

    update_usermeta( $user_id, ‘nickname’, $fullname );

    update_usermeta( $user_id, ‘first_name’, $firstname );

    update_usermeta( $user_id, ‘last_name’, $lastname );

    $wpdb->query( $wpdb->prepare( “UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d”, $fullname, $user_id ) );

    $wpdb->query( $wpdb->prepare( “UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d”, bp_core_get_user_domain( $user_id ), $user_id ) );

    }

    //Actions

    add_action(‘user_register’, ‘real_name_synchro’);

    //Filters

    ?>`

    Can anyone suggest fixes or am I fundamentally on the wrong track?

    #49884

    In reply to: Username and Name

    Jeff Sayre
    Participant

    Are you using a custom theme? Have you added any required fields via the “BuddyPress > Profile Fields Setup” in WPMU’s backend?

    By default, WPMU with BuddyPress installed is setup to do exactly what you are asking–have one “Username” field and one “Name” field on the signup page.

    #49729
    Paul Wong-Gibbs
    Keymaster

    Look at /bp-xprofile/bp-xprofile-signup.php. I’m not writing your code for you, but from the looks of things, I think you need to remove_action() the xprofile_add_signup_fields() call, and add_action your own version of this function, but obviously removing the avatar form field.

    Best place for the code would probably be /plugins/bp-custom.php and make your add_action have a priority of 11.

    r-a-y
    Keymaster

    Friendly monday morning bump!

    #49020
    3125432
    Inactive

    I just went through this so I am a voice of experience.

    Each additional profile field you add in the profile field setup is added to the xp_bp_xprofile_fields table. By default, there is only one field filled in on the wp_bp_xprofile_data table, which is the “full name.” Once you or someone else begins to add their additional information and hits save, the data table will expand and in a strange albeit normal way. The id of the user, say ‘2’ will be listed repeatedly, as they have multiple pieces of information stored. The id of the table counts sequentially, so you’ll begin to see that number grow exponentially.

    Hope that helps.

    Brian

    #48978
    libationblog
    Participant

    To follow up on this, the table you pointed out only has the default field “full name” not any of the custom fields I created. What am I missing?

    #48731
    Greg
    Participant

    Well, I found a workaround, but I’m really nervous about unintended consequences. I went into the db and changed “is_required” on the “Name” field from “1” to “0”. Now I can register without the extra profile fields.

    It seems that the name field gets set to the username, which is what I need.

    Any thoughts about the unintended consequences of this?

    Thanks.

    #48710
    Greg
    Participant

    Jeff, fantastic, this works.

    Just to make sure I understand *why* it works… by just running the remove_filter() function in bp-custom as I was doing earlier, I guess it was running before the filter was added. What you are doing is delaying the remove_filter() call until all plugins are loaded.

    Do I have that right?

    Thanks very much.

    #48690
    Boone Gorges
    Keymaster

    Hi r-a-y,

    Glad the filter is useful to you!

    I think the answer to your question is yes, John Smith’s profile would come up in that kind of scenario. The links that are created in BP profiles are merely full-text searches on all BP profiles (this is the link behavior out of the box, and my filters do not change this). Even if the name “Smith” in John’s profile doesn’t link to http://[your-buddypress-url]/members/?s=Smith, that search URL will still be live and accessible from the regular BP search box.

    I haven’t looked into the details, but it should be possible to build a plugin that limits search in different ways. You might, for instance, search all profile fields except those that have been tagged as non-searchable (last name, for example). Another strategy: you might only return a hit on (for example) “Smith” if the result appears between anchor tags; in this way, non-linked profile fields would automatically be excluded. The first kind of solution is probably the better one, and I imagine it will be quite easy once field-specific profile search comes along in BP 1.3 https://buddypress.org/about/roadmap/

    #48683
    Jeff Sayre
    Participant

    @Reboot

    Okay, thanks to Burt for waking me up enough in IRC to point out my errors, here’s what you need to place in your bp-custom.php file:

    <?php
    function remove_links(){
    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 2 );
    }
    add_action( 'plugins_loaded', 'remove_links' );
    ?>

    That should work.

    I’m going to get some sleep now.

    #48632
    Greg
    Participant

    Thanks Jeff.

    So to sum up, I have the following line in “plugins/bp-custom.php”

    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 2 );

    But the links still appear on my profile page. I can remove the links by commenting out line 15 in bp-xprofile-filters.php, but I’d love to get this right without the mod to a core file.

    #48624
    Jeff Sayre
    Participant

    I believe that bp-custom.php should actually go in “mu-plugins”

    No. bp-custom.php goes in /plugins/. See line 9 of bp-core.php.

    #48623
    Greg
    Participant

    UPDATE 2: I see that in 1.02 the filter is added to ‘bp_get_the_profile_field_value’, so I changed this in the line above, but still the links hang in there.

    #48616
    Greg
    Participant

    I also wanted to remove the linking in the profile fields, so I added the following line (given above by Fishbowl81) to bp-custom.php, which is in the “plugins” directory.

    remove_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data', 2);

    The profile fields still have the links though. Is there something special I need to do aside from putting the line in bp-custom.php?

    UPDATE: I believe that bp-custom.php should actually go in “mu-plugins”. Also, I did add the php script tags (<?php and ?>) around my code in this file. Still the links appear.

    #48603
    r-a-y
    Keymaster

    Hi mohitkro5,

    It sounds like you’re trying to use WordPress shortcodes in Buddypress fields.

    Where are you trying to embed your videos?

    BuddyPress doesn’t allow WordPress shortcodes to work in profile fields, wire posts and group forum posts.

    bbPress has a few plugins to parse videos.

    #48586
    Jeff Sayre
    Participant

    I tried very hard to get this to work, and I can not get that code to work, even in the default template or even by creating a blank .php with pasting in the code listed above to upload to the mu-plugins directory.

    First of all you should not be placing the code in mu_plugins. Either place it in your bp-custom.php file, create your own plugin that resides in /wp-content/plugins/, or put the code in your member theme’s functions.php file.

    But, in the BP Profiles section, the users can simply change their login username to anything they want. This will obviously lead to database errors and people changing their usernames to cause conflicts.

    Where do you see the option in BuddyPress to change your login username? The only option you have is to change your display name. This is an entirely different piece of datum.

    Yes, when a user registers for a new account, if they choose to enter the exact same datum in the username field as the “Full Name” field, then that is their choice. But, this data is stored and used in different ways. The datum from the “Full Name” field gets placed in two different tables: it populates the display_name field in the wp_users table and it is recorded in the wp_bp_xprofile_data table corresponding to the meta field entitled “Full Name” in the wp_bp_xprofile_fields table.

    When a user decides to edit their “Full Name” field via BuddyPress, the changes to that piece of datum have no affect on the login username field stored in the user_login field of the wp_user WordPress table.

    So, on the same registration page, you have two questions requesting for what their username is going to be. This is quite ridiculous, and so far their is no way to shut that part off. Does anyone have any ideas?

    This is not correct. These fields serve different purposes as detailed above. One field is the user_login, the other is the user’s display name.

    #48581
    Jeff Sayre
    Participant

    The custom field values are found in wp_bp_xprofile_fields table whereas the actual datum for each field is found in wp_bp_xprofile_data table.

    As far as how to output the data, this should give you some ideas: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-profile-data-loop-bp_has_profile/

    #48545
    r-a-y
    Keymaster

    _cK_ is a tried-and-true bbPress plugin developer; not sure if she’ll step into the confines of BuddyPress! But if you don’t ask, you’ll never know!

    It’s probably possible to extend Nicola’s BP-TinyMCE plugin to add a filter for profile fields as well… you’d have to bug Nicola about that.

    Here’s a post which explains how someone added a filter to profile fields:

    https://buddypress.org/forums/topic.php?id=604

    I might write a filter as well regarding this… we’ll see.

    #48541
    gen-superman
    Participant

    Thanks for that information R-A-Y.

    Does anyone have any ideas how to take a BP-PRESS created profile field, and have the information placed within that BP-PRESS field automatically show up in the a posted wire or group forum post/message?

    I think the real issue is that I am looking for something that will not just allow text, but html embedded images too. I mean alot of people that use signatures like to have their signature show their name, then a banner image under it. So, even using a profile field would be limited, because, it probably couldn’t allow embedding of images. I don’t think the BD-DEV’s tinymce works with profile fields in bppress at this time.

    I have posted on BD-DEV’s website to see if Nicola Greco has any thoughts about this. I also posted on _CK_’s area on the bbpress showcase website to see if the plugin author of “BBPRESS Signatures” has any thoughts about converting their plugin to BP-PRESS.

    I consider that the BP-PRESS Signature a very important plugin, and if this plugin ever gets created by someone, then I am positive that many of you will find it very useful for wires or group forum discussions. I mean look at PHPBB or Invision Pro Board, etc. Those forums thrive on signatures in their posts.

    You can follow the current posts that I made:

    On BD-DEV:

    http://bp-dev.org/forums/topic/the-signature-plugin

    and on _CK_’s area in the bbpress showcase website:

    http://bbshowcase.org/forums/topic/bbpress-signature-convert-to-bppress

    I truly hope that we will be able to see something like this type of plugin in the near future.

    Thanks for everyones replys and thoughts.

    Everyone is always very quick to advertise the benefits of a single-sign on service, or a go-between to allow users to sign into your website using any number of different credentials, but there are a few major flaws with this idea, and they are going to become extremely apparent very soon.

    The first MAJOR flaw I see in this design, is that all it takes is one website to put up password stealing/sniffing code, and now you’ve given your twitter password to anyone with access to the sites malicious intentions.

    The second MAJOR flaw I see from a developers standpoint is that you as a site administrator no longer have control over the user data that is using your website. This means tracking down a problem user that creates an account with their facebook, you ban them, their google, you ban them, their open_id, you ban them, etc… That, along with the fact that these user registrations tend to add their own cryptic names into your database fields; now you’re forced to try to know who “fb8288373” really is, when had they registered the normal way, you could see they are “johnjamesjacoby.”

    From a user perspective, I don’t plan on using Facebook for the rest of my life, so when I delete my account in a few years, that means I can no longer use your site without creating a new profile.

    Also, if I’m logged into facebook on my computer, and close facebook, and then my girlfriend walks over to a site and clicks on facebook connect and continue, it logs her in as me because I am still logged into facebook. Now I’ve registered at a website that I didn’t want to register at, and I have no way to delete that account, and who knows what kind of information they’ve decided to store about me by this point…

    Quite frankly, I can’t wait for this trend to die. It’s a headache waiting to turn into a brain tumor in my opinion. :)

Viewing 25 results - 3,326 through 3,350 (of 3,589 total)
Skip to toolbar