1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-27 10:14:47 +02: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

@@ -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);