Is it possible to configure this in the admin cp, under custom profile fields? There is a maximum input line, would it be possible to add a minumum input line?
Originally posted by Xenon for 1:
in register.php it will work somehow similar, but i'll show you how to do in member.php
find that:
PHP Code:
$varname="field$profilefield[profilefieldid]";
if ($profilefield[required] and $$varname=="")
{
eval("standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
exit;
}
and change to:
PHP Code:
$varname="field$profilefield[profilefieldid]";
if (($profilefield[required] and $$varname=="") or ($profilefieldid == 2 and $$varname != "" and strlen($$varname)<5))
{
eval("standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
exit;
}
that will disallow all inputs smaller than lenght of 5 except no input
Ok, seems a though I won't have much help in getting this integrated into the admin cp. How about steering me in the right direction so I can call another template if users input less than the required amount of characters.
$varname="field$profilefield[profilefieldid]";
if ($profilefield[required] and $$varname=="")
{
eval("standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
exit;
} else if ($profilefieldid == 2 and $$varname != "" and strlen($$varname)<5) {
eval("standarderror(\"".gettemplate("error_notenoughchars")."\");");
exit;
}
Does the character limit apply to any? So a user could enter something like *#^@! in the locattion field? Is there a way to make it so it has to be actual letters?
$varname="field$profilefield[profilefieldid]";
if ($profilefield[required] and $$varname=="")
{
eval("standarderror(\"".gettemplate("error_requiredfieldmissing")."\");");
exit;
} else if ($profilefieldid == 2 and $$varname != "" and strlen($$varname)<5) {
eval("standarderror(\"".gettemplate("error_notenoughchars")."\");");
exit;
}
now create the new template error_notenoughchars
Maybe it's me, but after I add that code in to member.php and then go to my profile, edit, change my location to only 3 characters, it still allows it.