diff options
-rw-r--r-- | system/application/models/file_mod.php | 7 | ||||
-rw-r--r-- | 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 @@ <a class="raw_link no" href="<?php echo $new_link; ?>">New</a> | <a class="raw_link no" href="<?php echo $raw_link; ?>">Raw</a> | <a class="raw_link no" href="<?php echo $plain_link; ?>">Plain</a> | - Currently: <?php echo $current_highlight; ?> + Currently: <?php echo $current_highlight; ?> | + Timeout: <?php echo $timeout; ?> <div style="float:right;"> <a class="raw_link no" href="<?php echo $auto_link; ?>">Code</a> | <a class="raw_link no" href="<?php echo $rmd_link; ?>">Render Markdown</a> |