开发者

how to change character limit of joomla user profile "About Me" field

开发者 https://www.devze.com 2023-04-10 01:38 出处:网络
I am wondering how can I change the characte开发者_如何学Cr limit of Joomla\'s user component \"About Me\" field.

I am wondering how can I change the characte开发者_如何学Cr limit of Joomla's user component "About Me" field.

To find this field go to Control Panel, User Manager, select a user, and in the right hand side click over the "User Profile" panel and this text area field is towards the bottom of the form

Thank you


OK, so this is about the 'User Profile' plugin, which extends 'com_users'. This plugin ships with core Joomla, but is disabled by default.

You can find the files related to this plugin here: /plugins/user/profile

You probably mean one of two things - either the text box in the form is too small, or the actual character limit is getting in your way. If the text box is too small, you'll find the configuration for this plugins fields here: /plugins/user/profile/profiles/profile.xml. Changing the 'cols' and 'rows' settings in here will have immediate effect.

You'll note from that that there's no explicit character limit set. There is an implicit one however. This plugin stores its data in the core Joomla table jos_user_profiles, which is set up like so:

+---------------+--------------+------+-----+---------+-------+
| Field         | Type         | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+-------+
| user_id       | int(11)      | NO   | PRI | NULL    |       |
| profile_key   | varchar(100) | NO   | PRI | NULL    |       |
| profile_value | varchar(255) | NO   |     | NULL    |       |
| ordering      | int(11)      | NO   |     | 0       |       |
+---------------+--------------+------+-----+---------+-------+

There's no non-hack way to change this - the varchar(255) limit is set in the schema. But you could extend this by running a query similar to this on the database:

ALTER TABLE jos_user_profiles MODIFY COLUMN profile_value TEXT;

This will change the varchar to a TEXT field, which gives you tons of room:

http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

...but it'll change that for ALL rows in that table, so it may reduce the DB performance for that plugin. The plugin will continue to work, as the code doesn't enforce length limits anywhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号