Function __global->_helper_install_create_custom_field
Definitions
sources/cns_forum_driver_helper_install.php
- Add the specified custom field to the forum (some forums implemented this using proper Custom Profile Fields, others through adding a new field).
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: bool
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$this_ref | object | required parameter | N/A | N/A | Link to the real forum driver |
$name | string | required parameter | N/A | N/A | The name of the new custom field |
$length | integer | required parameter | N/A | N/A | The length of the new custom field |
$locked | BINARY | 1 | N/A | N/A | Whether the field is locked |
$viewable | BINARY | 0 | N/A | N/A | Whether the field is for viewing |
$settable | BINARY | 0 | N/A | N/A | Whether the field is for setting |
$required | BINARY | 0 | N/A | N/A | Whether the field is required |
$description | string | Blank (empty string) | N/A | N/A | Description |
$type | string | long_text | N/A | N/A | The field type (it's the same as the software field types, although we only expect forum drivers to specifically support short_text/long_text/integer/float and for the rest to be mapped to long_text) |
$encrypted | BINARY | 0 | N/A | N/A | Whether the field is encrypted |
$default | ?string | Null | N/A | N/A | Default field value (null: standard for field type) |
$options | SHORT_TEXT | Blank (empty string) | N/A | N/A | Field options |
$include_in_main_search | BINARY | 0 | N/A | N/A | Whether to include in main keyword search |
$allow_template_search | BINARY | 0 | N/A | N/A | Whether to allow template search |
$icon | ID_TEXT | Blank (empty string) | N/A | N/A | An icon to show the CPF with on the member profiles |
$section | ID_TEXT | Blank (empty string) | N/A | N/A | A section to show with on the member-links part of member profiles |
$tempcode | LONG_TEXT | Blank (empty string) | N/A | N/A | This is Tempcode that is used for displaying the field. See the DESCRIPTION_CPF_CODE language string. |
$autofill_type | ID_TEXT | Blank (empty string) | N/A | N/A | Autofill field name from https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill-field |
$autofill_hint | ID_TEXT | Blank (empty string) | N/A | N/A | Autofill hint: '' or 'shipping' or 'billing' |
Return
- Whether the custom field was created successfully
- Type: boolean
- Set: N/A
- Range: N/A