From 494e7f29ac5a003849329e5b4271a555673c1788 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 16 Jun 2018 21:49:57 +0200 Subject: [PATCH] login/edit: refresh thumbnails on avatar upload --- login/edit.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/login/edit.php b/login/edit.php index cfbc2d7..9611c7d 100644 --- a/login/edit.php +++ b/login/edit.php @@ -85,6 +85,10 @@ if ($_POST) { if (!@move_uploaded_file($val['tmp_name'], $cols[$col]['target'])) { $colwarn[$col] = "Fout bij opslaan."; } + foreach (@glob('thumb/*/') as $thumbres) { + # attempt to remove old derivations + @unlink($thumbres.'/'.$cols[$col]['target']); + } $cols[$col]['value'] = ''; } @@ -115,9 +119,9 @@ foreach ($cols as $col => &$colconf) { print "\t"; printf('
  • ', $col, ucfirst($colconf['label'])); if (@$colconf['type'] == 'file' and isset($colconf['value'])) { - printf('
    ', + printf('
    ', $colconf['target'], - 200, $colconf['target'] + 200, $colconf['target'], filemtime($colconf['target']) ); } print "