Adds default avatar image

main
Yasen Pramatarov 2024-09-08 14:15:08 +03:00
parent f0f7d5b2d3
commit d2f4850d28
4 changed files with 8 additions and 1 deletions

View File

@ -26,6 +26,10 @@ return [
// default is ../app/jilo-web.db
'sqlite_file' => '../app/jilo-web.db',
],
// avatars path
'avatars_path' => 'uploads/avatars/',
// default avatar
'default_avatar' => 'static/default_avatar.png',
// system info
'version' => '0.2',
// development has verbose error messages, production has not

View File

@ -30,6 +30,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// no form submitted, show the templates
} else {
$userDetails = $userObject->getUserDetails($user);
$avatar = !empty($userDetails['avatar']) ? 'uploads/avatars/'.$userDetails['avatar'] : $config['default_avatar'];
switch ($action) {

View File

@ -8,7 +8,9 @@
<div class="row">
<div class="col-md-4">
<div class="border" style="width:200px; height: 200px;"><img src="" alt="avatar" /></div>
<div class="border" style="width:200px; height: 200px;">
<img src="<?= $app_root . htmlspecialchars($avatar) ?>" width="200" height="200" alt="avatar" />
</div>
</div>
<div class="col-md-8">

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB