Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
337 views
in Q2A Core by

In the admin users Administration center - Users where you create new fields where it says Extra fields on user pages, add new field when choosing the single line option to appear on the register page it has a limit of 40 characters where do I go to increase that number ?

1 Answer

+1 vote
by

Hello @Methen

First off, back your database up and then check off option 'Take site down for temporary maintenance' under 'Admin' → 'General' page.

After that, run the following SQL query to increase the number the characters allowed for the 'title' field of table 'qa_userprofile' to, for example, 50 characters.

ALTER TABLE `qa_userprofile`
CHANGE `title` `title` VARCHAR(50) NOT NULL;

Also update file 'qa-config.php' by adding this line of code

define('QA_DB_MAX_PROFILE_TITLE_LENGTH', 50);

which overrides the default value of 40

Finally, take your site up.


Tidbits

Administrators can add additional fields to user's profile. The following animation shows the error message the OP is referring to and also depicts how to add a profile field named 'Twitter' for letting users enter their Twitter user handle and how to fill it.

How to add custom profile field

Wait a minute, how do you validate it?

Well, I will leave it as an exercise to the reader Grinning Face with Smiling Eyes People is already yelling at me because my answers are too lengthy anyway. But I can't help but give you a little hint: filter_profile.

But don't fret, here is how to delete it:

How to delete a custom profile field

There are tree types of fields:

  1. Single line of text: for small pieces of information, like field 'Full name'
  2. Multiple lines of text: Which allows users to press 'Enter' key to spread text into several lines; for example, the 'About' field
  3. Linked URL: Like single line of text but will turn the entered URL into a link; the 'Website' field is an example of this type of field

In addition, profile fields have two parts:

  • Field name: A short description of the content of the field. It is set once in the 'Users' administrator page. By default it can be 40 characters long
  • Field content:  It is filled for each user; allowing up to 8,000 characters

The following picture shows the form elements used for these type of profile fields. Note red numbers were added, these numbers identify the type of field in use (see above):

Image showing profile fields when editing user's profile

and this picture how they would look like for other users:

Image showing how profile fields would look like to other users


Now, this answer assumes you are a developer and you have time for going through the process of making it work. Here are a few suggestions just in case you find it difficult to follow:

  • Add a comment below Backhand index pointing down emoji, I (and other community members) can try to help you out
  • Find a developer friend and ask him to implement it for you
  • Get paid consultation from one of the service providers or from me (send me a private message); specially if quick solutions are needed so you do not have to wait 31 days for someone to give you an answer

I hope you find this information useful. Be well!

Cheers! Waving Hand Sign Emoji

...