Browse Source

Fixes

pull/3/head
M@dD3n 5 years ago
parent
commit
602e37454d
  1. 5
      admin/functions/func.admin.common.php
  2. 8
      functions/func.users.php

5
admin/functions/func.admin.common.php

@ -630,7 +630,10 @@
{ {
global $AVE_Template; global $AVE_Template;
$showCache = format_size(get_dir_size($AVE_Template->cache_dir_root)); $showCache[] = format_size(get_dir_size($AVE_Template->compile_dir));
$showCache[] = format_size(get_dir_size($AVE_Template->sql_cache_dir));
$showCache = implode(' / ', $showCache);
echo json_encode(array($showCache, 'accept')); echo json_encode(array($showCache, 'accept'));
} }

8
functions/func.users.php

@ -24,7 +24,7 @@
{ {
global $AVE_DB; global $AVE_DB;
static $result = array(); static $result = [];
if ($id === null) if ($id === null)
$id = $_SESSION['user_id']; $id = $_SESSION['user_id'];
@ -32,13 +32,15 @@
if (! isset($result[$id])) if (! isset($result[$id]))
{ {
$user = get_user_rec_by_id($id); $user = get_user_rec_by_id($id);
$avatar = ABS_PATH . UPLOAD_DIR . '/avatars/' . (($prefix === '') ? '' : $prefix) . md5($user->user_name); $avatar = ABS_PATH . UPLOAD_DIR . '/avatars/' . (($prefix === '') ? '' : $prefix) . md5($user->user_name);
$avatar = (file_exists(BASE_DIR . $avatar . '.jpg') $avatar = (file_exists(BASE_DIR . $avatar . '.jpg')
? $avatar . '.jpg' ? $avatar . '.jpg'
: (file_exists(BASE_DIR . $avatar . '.png') : (file_exists(BASE_DIR . $avatar . '.png')
? $avatar . '.png' ? $avatar . '.png'
: (file_exists(BASE_DIR . $avatar .'.gif') : (file_exists(BASE_DIR . $avatar .'.gif')
? $ava . '.gif' ? $avatar . '.gif'
: ''))); : '')));
$result[$id] = $avatar; $result[$id] = $avatar;
@ -47,7 +49,7 @@
$avatar = $result[$id]; $avatar = $result[$id];
$src = (file_exists(BASE_DIR . $avatar) $src = (file_exists(BASE_DIR . $avatar)
? make_thumbnail(array('link' => $ava,'size' => 'c' . $size . 'x' . $size)) ? make_thumbnail(array('link' => $avatar,'size' => 'c' . $size . 'x' . $size))
: make_thumbnail(array('link' => $AVE_DB->Query("SELECT default_avatar FROM " . PREFIX . "_user_groups WHERE user_group=" . (int)$user->user_group)->GetCell(), 'size' => 'c' . $size . 'x' . $size)) : make_thumbnail(array('link' => $AVE_DB->Query("SELECT default_avatar FROM " . PREFIX . "_user_groups WHERE user_group=" . (int)$user->user_group)->GetCell(), 'size' => 'c' . $size . 'x' . $size))
); );

Loading…
Cancel
Save