From a79798223a71874a70981c07e0bcc79b4dcabc28 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 6 Dec 2010 21:23:16 +0100 Subject: add timeout to html page Signed-off-by: Florian Pritz --- system/application/models/file_mod.php | 7 ++++++- system/application/views/file/html_header.php | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php index a41e04b1a..2d3fc8ccf 100644 --- a/system/application/models/file_mod.php +++ b/system/application/models/file_mod.php @@ -50,7 +50,7 @@ class File_mod extends Model { function get_filedata($id) { $sql = ' - SELECT hash,filename,mimetype + SELECT hash,filename,mimetype, date FROM `files` WHERE `id` = ? LIMIT 1'; @@ -202,6 +202,11 @@ class File_mod extends Model { } else { $data['current_highlight'] = $this->mime2extension($type); } + if (filesize($file) > $this->config->item("small_upload_size")) { + $data['timeout'] = date("r", $filedata["date"]+$this->config->item("upload_max_age")); + } else { + $data['timeout'] = "never"; + } echo $this->load->view('file/html_header', $data, true); $this->load->library("MemcacheLibrary"); if (! $cached = $this->memcachelibrary->get($filedata['hash'].'_'.$mode)) { diff --git a/system/application/views/file/html_header.php b/system/application/views/file/html_header.php index ef5b204ff..b7e27315d 100644 --- a/system/application/views/file/html_header.php +++ b/system/application/views/file/html_header.php @@ -10,7 +10,8 @@ New | Raw | Plain | - Currently: + Currently: | + Timeout:
Code | Render Markdown -- cgit v1.2.3-24-g4f1b