• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Limit custom title?

Brogan

XenForo moderator
Staff member
#4
You would have to edit the field in the database to change it to varchar(18)

xf_user: custom_title

However, there are probably other changes required in the core files to accompany this so I wouldn't recommend doing that or it will throw an error.
 

Brogan

XenForo moderator
Staff member
#6
Yes, just checked in library/XenForo/DataWriter/User.php and it's set to 50 so you would need to edit line 97:

Code:
=> array('type' => self::TYPE_STRING, 'maxLength' => 50, 'default' => '', 'verification' => array('$this', '_verifyCustomTitle'))
 

DarkVodka

Formerly Wuebit
#7
Yes, just checked in library/XenForo/DataWriter/User.php and it's set to 50 so you would need to edit line 97:

Code:
=> array('type' => self::TYPE_STRING, 'maxLength' => 50, 'default' => '', 'verification' => array('$this', '_verifyCustomTitle'))
Ahh nice find thank's ive changed both anyway^_^
 

DarkVodka

Formerly Wuebit
#9
Another option would be to modify the account_personal_details template.

Find the line:
<input type="text" name="custom_title" value="{$visitor.custom_title}" id="ctrl_custom_title" class="textCtrl" />
and change to:
<input type="text" name="custom_title" value="{$visitor.custom_title}" id="ctrl_custom_title" class="textCtrl" maxlength="18"/>

Then you're just preventing someone from entering more than 18 characters and you don't have to worry about any of the code changes being overwritten when you install your next upgrade. Hard core programmers might know how to get past this but your average user community probably will not.

--Ed
Well sure, if you want to do it the easy way :D
Sod it ive done it all three way's rofl :D
no one will ever hit 19 char's lol