From e132b09af14eccc54ba913b9ec93c8c3a875752f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9E=A5=EC=84=A0=EA=B7=BC?= Date: Tue, 13 Aug 2019 15:19:41 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wheeparam/application/controllers/Board.php | 2 +- .../application/controllers/admin/Board.php | 2 +- .../controllers/admin/Download.php | 25 +++++++++++++++++++ wheeparam/views/themes/admin/board/posts.php | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 wheeparam/application/controllers/admin/Download.php diff --git a/wheeparam/application/controllers/Board.php b/wheeparam/application/controllers/Board.php index 343649e..5046ad5 100644 --- a/wheeparam/application/controllers/Board.php +++ b/wheeparam/application/controllers/Board.php @@ -171,7 +171,7 @@ class Board extends WB_Controller { $post = $this->boardlib->get_post($brd_key, $post_idx, TRUE); - $this->point_process('brd_point_download', "POST_ATTACH_DOWNLOAD", "첨부파일 다운로드", $post_idx, ($post['reg_user'] == $this->member->info('idx')) ); + $this->boardlib->point_process('brd_point_download', "POST_ATTACH_DOWNLOAD", "첨부파일 다운로드", $post_idx, ($post['reg_user'] == $this->member->info('idx')) ); $this->db->where('att_idx', $att['att_idx'])->set('att_downloads', 'att_downloads + 1', FALSE)->update('attach'); diff --git a/wheeparam/application/controllers/admin/Board.php b/wheeparam/application/controllers/admin/Board.php index 69f1b0a..667aa96 100644 --- a/wheeparam/application/controllers/admin/Board.php +++ b/wheeparam/application/controllers/admin/Board.php @@ -218,7 +218,7 @@ class Board extends WB_Controller $this->data['list'] = $this->boardlib->post_list($this->data['board'], $this->param); $paging['page'] = $this->param['page']; - $paging['page_rows'] = 20; + $paging['page_rows'] = $this->data['board']['brd_page_rows']; $paging['total_rows'] = $this->data['list']['total_count']; $this->load->library('paging', $paging); $this->data['pagination'] = $this->paging->create(); diff --git a/wheeparam/application/controllers/admin/Download.php b/wheeparam/application/controllers/admin/Download.php new file mode 100644 index 0000000..abca1dc --- /dev/null +++ b/wheeparam/application/controllers/admin/Download.php @@ -0,0 +1,25 @@ +db->where('att_idx', $att_idx)->get('attach')->row_array()) + { + alert('잘못된 접근입니다.'); + exit; + } + + $this->db->where('att_idx', $att['att_idx'])->set('att_downloads', 'att_downloads + 1', FALSE)->update('attach'); + + $this->load->helper('download'); + $data = file_get_contents(FCPATH.$att['att_filepath']); + $name = urlencode($att['att_origin']); + force_download($name, $data); + } +} \ No newline at end of file diff --git a/wheeparam/views/themes/admin/board/posts.php b/wheeparam/views/themes/admin/board/posts.php index 03cb6c8..3278954 100644 --- a/wheeparam/views/themes/admin/board/posts.php +++ b/wheeparam/views/themes/admin/board/posts.php @@ -82,6 +82,7 @@ +