diff --git a/application/controllers/upload.php b/application/controllers/upload.php index a5eb174..e02c1b2 100644 --- a/application/controllers/upload.php +++ b/application/controllers/upload.php @@ -23,7 +23,11 @@ class Upload extends CI_Controller { $message = array('type' => 'error', 'status' => $this->upload->display_errors()); } else { $upload = $this->upload->data(); + $hash = md5_file($upload['full_path']); + $width = $upload['image_width']; + $height = $upload['image_height']; + $size = $upload['file_size']; $this->load->model('fileupload'); $duplicate = $this->fileupload->check_duplicate($hash); @@ -33,7 +37,7 @@ class Upload extends CI_Controller { $message = array('type'=>'error', 'status'=>'file already exists:' . $duplicate); } else { - $file_name = $this->fileupload->add_upload($upload['file_ext'], $upload['client_name'],$hash); + $file_name = $this->fileupload->add_upload($upload['file_ext'], $upload['client_name'],$width,$height,$size,$hash); rename($upload['full_path'], $upload['file_path'] . $file_name . $upload['file_ext']); diff --git a/application/controllers/view.php b/application/controllers/view.php index b17a17e..ed23e25 100644 --- a/application/controllers/view.php +++ b/application/controllers/view.php @@ -44,6 +44,10 @@ class View extends CI_Controller { $this->data['original'] = $upload->original_name; $this->data['views'] = $display_views; $this->data['created'] = $upload->created; + $this->data['height'] = $upload->height; + $this->data['width'] = $upload->height; + $this->data['size'] = $upload->size; + $this->template->load('template', 'view', $this->data); } diff --git a/application/models/fileupload.php b/application/models/fileupload.php index 2927b99..3a62367 100644 --- a/application/models/fileupload.php +++ b/application/models/fileupload.php @@ -5,10 +5,13 @@ class Fileupload extends CI_Model { parent::__construct(); } - function add_upload($extension, $original_name, $hash) { + function add_upload($extension, $original_name, $width, $height, $size, $hash) { $data = array( 'extension' => $extension, 'original_name' => $original_name, + 'width' => $width, + 'height' => $height, + 'size' => $size, 'hash' => $hash, ); @@ -22,7 +25,7 @@ class Fileupload extends CI_Model { } function get_upload($id) { - $this->db->select('extension, original_name, views, created')->from('uploads')->where('id',$id); + $this->db->select('extension, original_name, width, height, size, views, created')->from('uploads')->where('id',$id); $query = $this->db->get(); $result = $query->result(); diff --git a/application/views/view.php b/application/views/view.php index 935ae3a..88889c6 100644 --- a/application/views/view.php +++ b/application/views/view.php @@ -30,7 +30,6 @@
- Uploaded on:
- Original name:
- Views:
+ Uploaded on:
Original name:
Views:
Dimensions:
Size:
+

x

kb
\ No newline at end of file diff --git a/css/style.css b/css/style.css index 101b938..6221178 100644 --- a/css/style.css +++ b/css/style.css @@ -262,6 +262,16 @@ h1{ font-weight: bold; } +.label { + display: inline-block; + font-weight: bold; + text-align: right; +} + +.info { + display: inline-block; +} + /*-------------------------