The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to force users to insert at least X characters into a given custom profile filed?
Does anybody knows how to force users to insert at least X characters into a given custom profile filed?
In the user's custom profile field 'Location' (city), I would like to force users to, at least, insert 3 (three) characters. I've already searched through hacks here in vb.org, but found none... How to do it? Thank you! :up: |
#2
|
|||
|
|||
You can create a plugin using hook location register_addmember_process and code like this:
Code:
if (!empty($vbulletin->GPC['userfield']['field2']) AND strlen($vbulletin->GPC['userfield']['field2']) < 3) { $userdata->error('phrasename'); } Then you also need to create a phrase with the error message you want (set Phrase Type to "Error Message"), and replace 'phrasename' with the name of your phrase. |
#3
|
||||
|
||||
Can't you use the regex field and enter something like:
.{3,} |
#4
|
|||
|
|||
You can - I don't think I ever noticed that before. And it works, the only thing is that it only tells you that the value is "missing or invalid". But if you also edit the description to say that it has to be 3 or more chars, that works pretty well, with no plugins.
|
Благодарность от: | ||
Lynne |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|