This topic has 13 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #140581
     romanzy
    Participant

    I’m creating with Extended Profile Fields a multiple field select box (checkbox or radiobuttons). But seems that the text input is limited to 150 characters for each offered selection phrase. When you insert more than 150 characters, the characters as from 151 are not displayed. Is there a way to lift or extend this limitation via a snippet in bp-custom.php?

    #140601
     Radu
    Moderator
    #140640
     romanzy
    Participant

    Hi Radu,

    I refer to the WPMU DEV link you provided me above.

    I was using these scripts below:

    COPY CODE
    <script>
    jQuery(document).ready(function($) {
    $('#field_100').attr('maxlength', '500');
    });
    </script>
    <script>
    jQuery(document).ready(function($) {
    $('#field_108').attr('maxlength', '500');
    });
    </script>

    I looked up the field numbers of the fields that I wished to extend, and then added the scripts to the JavaScript code box under Theme Options > General Settings, but it had no effect.

    Any idea why it does not provide a solution? Can I try something else?

    #140845
     romanzy
    Participant

    Is there a chance to help me with a solution?

    #140966
     Radu
    Moderator

    Hi,

    I see, if you have the text from the php code less than 500 this will not work,

    Please remove that js codes and try this solution instead : http://snippetbarn.bp-fr.net/xprofile-field-length-control/

    Let me know

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141012
     romanzy
    Participant

    Thank you Radu.

    Think that the code you provided could be the perfect solution. I was trying to make it work, but I could not. I must change the right field name and/or ID, and I guess I did not patch it right.

    This is the code that was provided:

    COPY CODE
     if ( is_user_logged_in() && bp_is_active( 'xprofile' ) ) :  
            $my_custom_textfield = bp_get_member_profile_data( 'field=Brief Biography&user_id='.bp_get_member_user_id() );  
    
    And this is my field:
    

    <dl class=”dl-horizontal field_142 field_sense-of-humor optional-field visibility-public field_type_radio”>

    So, I should change field=Brief Biography&user_id= with the right field name and ID, but I’m stuck.

    Do you know?

    #141184
     romanzy
    Participant

    Please help so that I can close this issue. Thank you.

    PS: Seems I cannot create a new ticket anymore. I don’t see the “new topic” button. How can be? I extended the Kleo-support a few days ago,

    #141185
     Radu
    Moderator

    Hi,

    Practically you should replace Brief Biography with the name if your field.

    Before continue with the php solutions try to use those instead , follow, read and test this

    https://archived.seventhqueen.com/forums/topic/profile-field-name-length

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141186
     romanzy
    Participant

    I know that I must replace the Brief Biography field, but how exactly with this code from Firebug `<dl class=”dl-horizontal field_142 field_sense-of-humor optional-field visibility-public field_type_radio”>

    If I click on your link Profile Field Name Length, I get the message “You cannot reply to this topic.” and I don’t see anything (empty page)

    #141228
     romanzy
    Participant

    The page Profile Field Name Length is empty for me. The only thing I get is “You cannot reply to this topic.”

    #141283
     romanzy
    Participant

    I solved it myself after 5 days.

    #141432
     Radu
    Moderator

    Ok then

    have a nice week
    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #141814
     romanzy
    Participant

    Solution

    The easiest way to extend the length of an Xprofile field is making changes in the database. BuddyPress has a limitation of 150 characters for the Name-type field. See screen shot.

    You can modify the limitation by changing the database schema. Via phpmyadmin, select the table, go to structure tab, and then click on change link and update the length. For Radio, checkbox and select boxes, the options you set in the new/edit Profile field page are stored as Name (with the actual field set as their parent). So, in fact, the option that you consider value is in fact a Name of the child field and not a value.

    It is not considered a good practice to modify the database schema, but it is the simplest way to change the length of Name field.

    #141932
     Radu
    Moderator

    Hi,

    OK , good to know this, i don’t think it’s a bad practice, but if you update wp or buddypress check if the settings will be changed in db

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 14 posts - 1 through 14 (of 14 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?