From 5841670adb2e95bfca584b30c1923849d71d1264 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Mon, 14 Nov 2011 09:30:09 -0500 Subject: [PATCH] GET parameters can be handled via function params instead of retrieving from the URI simplifying code. --- application/controllers/gallery.php | 9 ++------- application/controllers/view.php | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/application/controllers/gallery.php b/application/controllers/gallery.php index 87dc8da..c5f05f5 100644 --- a/application/controllers/gallery.php +++ b/application/controllers/gallery.php @@ -1,16 +1,11 @@ load->model('fileupload'); $this->load->library('pagination'); - $page_count = 20; - $start = $this->uri->segment($this->uri->total_segments(), 1); - - if($start == 'index') $start = 1; - - + $page_count = 20; $config = array( 'base_url' => base_url('/gallery/index/'), diff --git a/application/controllers/view.php b/application/controllers/view.php index cbb24ea..653f46e 100644 --- a/application/controllers/view.php +++ b/application/controllers/view.php @@ -12,10 +12,9 @@ class View extends CI_Controller { } - public function specific() { + public function specific($id = 'latest') { $this->load->model('fileupload'); - $id = $this->uri->segment($this->uri->total_segments()); $total_uploads = $this->fileupload->count_uploads(); if($id == 'latest') {