summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-07-07 00:14:21 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-07-07 00:23:13 +0200
commit56d2a7f6484ff6a75872371fda6cac21cbe5917c (patch)
tree5b7959737fb7e44cb4a78f4993b5b4ac1f0a8216 /application/controllers
parentd521fec0a274ab5879462d56483a4d496ca365aa (diff)
Display total size uploaded by user on history page
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/file.php11
1 files changed, 11 insertions, 0 deletions
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);