1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-25 18:13:28 +01:00

[ticket/15342] Add avatar storage size to acp_main

PHPBB3-15342
This commit is contained in:
Rubén Calvo 2018-02-11 13:22:18 +01:00
parent a02fa1170b
commit 5a1b4f559d
2 changed files with 13 additions and 9 deletions

View File

@ -500,10 +500,12 @@ class acp_main
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
$files_per_day = sprintf('%.2f', $total_files / $boarddays);
//$storage_attachment = $phpbb_container->get('storage.attachments');
//$upload_dir_size = get_formatted_filesize($storage_attachment->get_size());
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
// Couldn't open Avatar dir.
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
$storage_avatar = $phpbb_container->get('storage.avatar');
$avatar_dir_size = get_formatted_filesize($storage_avatar->get_size());
if ($posts_per_day > $total_posts)
{

View File

@ -306,18 +306,20 @@ class storage
if ($row)
{
$sql = 'UPDATE ' . $this->storage_table . '
SET filesize = filesize + ' . strlen($content) . '
WHERE ' . $this->db->sql_build_array('SELECT', $sql_ary);
$this->db->sql_query($sql);
//$sql = 'UPDATE ' . $this->storage_table . '
// SET filesize = filesize + ' . strlen($content) . '
// WHERE ' . $this->db->sql_build_array('SELECT', $sql_ary);
//$this->db->sql_query($sql);
}
else
{
$sql_ary['filesize'] = strlen($content);
//$sql_ary['filesize'] = strlen($content);
$sql_ary['filesize'] = 0;
$sql = 'INSERT INTO ' . $this->storage_table . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
}
}
else
{
@ -363,8 +365,8 @@ class storage
public function get_size()
{
$sql = 'SELECT SUM(filesize) AS total
FROM ' . $this->storage_table . '
WHERE storage = ' . $this->get_name();
FROM ' . $this->storage_table . "
WHERE storage = '" . $this->get_name() . "'";
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);