-
Author
-
October 20, 2016 at 20:26 #140581romanzyParticipant
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?
October 20, 2016 at 22:07 #140601RaduModeratorHi,
Please take a look at this :
https://buddypress.org/support/topic/extended-profile-character-input-limit/
https://premium.wpmudev.org/forums/topic/simple-way-to-limit-the-number-of-characters-in-buddypress-text-boxCheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionOctober 21, 2016 at 10:16 #140640romanzyParticipantHi 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?
October 24, 2016 at 19:08 #140966RaduModeratorHi,
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 solutionOctober 24, 2016 at 22:16 #141012romanzyParticipantThank 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 CODEif ( 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?
October 25, 2016 at 18:22 #141184romanzyParticipantPlease 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,
October 25, 2016 at 18:23 #141185RaduModeratorHi,
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 solutionOctober 25, 2016 at 18:27 #141186romanzyParticipantI 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)
October 25, 2016 at 19:58 #141228romanzyParticipantThe page Profile Field Name Length is empty for me. The only thing I get is “You cannot reply to this topic.”
October 26, 2016 at 16:50 #141432RaduModeratorOk 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 solutionOctober 28, 2016 at 05:52 #141814romanzyParticipantSolution
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.
October 28, 2016 at 19:15 #141932RaduModeratorHi,
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 -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.