mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/15342] Add avatar storage size to acp_main
PHPBB3-15342
This commit is contained in:
parent
a02fa1170b
commit
5a1b4f559d
2 changed files with 13 additions and 9 deletions
|
@ -500,10 +500,12 @@ class acp_main
|
||||||
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
|
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
|
||||||
$files_per_day = sprintf('%.2f', $total_files / $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']);
|
$upload_dir_size = get_formatted_filesize($config['upload_dir_size']);
|
||||||
|
|
||||||
// Couldn't open Avatar dir.
|
$storage_avatar = $phpbb_container->get('storage.avatar');
|
||||||
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
|
$avatar_dir_size = get_formatted_filesize($storage_avatar->get_size());
|
||||||
|
|
||||||
if ($posts_per_day > $total_posts)
|
if ($posts_per_day > $total_posts)
|
||||||
{
|
{
|
||||||
|
|
|
@ -306,18 +306,20 @@ class storage
|
||||||
|
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
$sql = 'UPDATE ' . $this->storage_table . '
|
//$sql = 'UPDATE ' . $this->storage_table . '
|
||||||
SET filesize = filesize + ' . strlen($content) . '
|
// SET filesize = filesize + ' . strlen($content) . '
|
||||||
WHERE ' . $this->db->sql_build_array('SELECT', $sql_ary);
|
// WHERE ' . $this->db->sql_build_array('SELECT', $sql_ary);
|
||||||
$this->db->sql_query($sql);
|
//$this->db->sql_query($sql);
|
||||||
}
|
}
|
||||||
else
|
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);
|
$sql = 'INSERT INTO ' . $this->storage_table . $this->db->sql_build_array('INSERT', $sql_ary);
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -363,8 +365,8 @@ class storage
|
||||||
public function get_size()
|
public function get_size()
|
||||||
{
|
{
|
||||||
$sql = 'SELECT SUM(filesize) AS total
|
$sql = 'SELECT SUM(filesize) AS total
|
||||||
FROM ' . $this->storage_table . '
|
FROM ' . $this->storage_table . "
|
||||||
WHERE storage = ' . $this->get_name();
|
WHERE storage = '" . $this->get_name() . "'";
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$row = $this->db->sql_fetchrow($result);
|
$row = $this->db->sql_fetchrow($result);
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
Loading…
Add table
Reference in a new issue