Quote:
Originally Posted by KirbyDE
For every Datamanager there is a name_start Hook where you can add custom fields.
Example for the User Datamanager :
Hook: userdata_start
Code:
PHP Code:
$this->validfields[] = array('myfield', TYPE_STR, REQ_NO, 'if ($data != 'notallowed') { return true; } else {return false; }'));
This adds a new field myfield which is not required and will accept strings other then 'notallowed'.
|
Actually, this doesn't work. I had to change it to this ;
Code:
$this->validfields['myfield'] = array(TYPE_STR, REQ_NO[high], 'if ($data != 'notallowed') { return true; } else {return false; }')[/high]);
With the highlighted bit being optional (and not used by me).