From 56d2a7f6484ff6a75872371fda6cac21cbe5917c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 7 Jul 2012 00:14:21 +0200 Subject: Display total size uploaded by user on history page Signed-off-by: Florian Pritz --- application/controllers/file.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'application/controllers') diff --git a/application/controllers/file.php b/application/controllers/file.php index a3156eb4b..bb0236123 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -339,9 +339,20 @@ class File extends CI_Controller { } } + $total_size = $this->db->query(" + SELECT sum(filesize) sum + FROM ( + SELECT filesize + FROM files + WHERE user = ? + GROUP BY hash + ) sub + ", array($user))->row_array(); + $this->data["query"] = $query; $this->data["lengths"] = $lengths; $this->data["fields"] = $fields; + $this->data["total_size"] = format_bytes($total_size["sum"]); $cached = ""; $cached .= $this->load->view($this->var->view_dir.'/header', $this->data, true); -- cgit v1.2.3-24-g4f1b