Allow other columns to be declared before initialisation.
'explain' => "Alleen zichtbaar voor andere leden.",
'filter' => ["\n", '; '],
'size' => 30,
'explain' => "Alleen zichtbaar voor andere leden.",
'filter' => ["\n", '; '],
'size' => 30,
+ 'filename' => 'name.txt',
],
'email' => [
'label' => 'e-mailadres',
'type' => 'email',
'explain' => "Voor contact van of met deze site. Wij zullen dit nooit vrij- of doorgeven.",
'size' => 30,
],
'email' => [
'label' => 'e-mailadres',
'type' => 'email',
'explain' => "Voor contact van of met deze site. Wij zullen dit nooit vrij- of doorgeven.",
'size' => 30,
+ 'filename' => 'email.txt',
],
'avatar' => [
'label' => 'portretfoto',
'type' => 'file',
],
'avatar' => [
'label' => 'portretfoto',
'type' => 'file',
+ 'filename' => 'avatar.jpg',
],
];
foreach ($cols as $col => &$colconf) {
],
];
foreach ($cols as $col => &$colconf) {
+ if (!isset($colconf['filename'])) {
+ continue; # exceptional storage
+ }
$filetype = @$colconf['type'] == 'file' ? 'jpg' : 'txt';
$filetype = @$colconf['type'] == 'file' ? 'jpg' : 'txt';
- $colpath = "{$user['dir']}/$col.$filetype";
+ $colpath = $user['dir'] . '/' . $colconf['filename'];
if (file_exists($colpath)) {
$colconf['value'] = $filetype != 'txt' ? '' :
file_get_contents($colpath);
if (file_exists($colpath)) {
$colconf['value'] = $filetype != 'txt' ? '' :
file_get_contents($colpath);