when it is more than 3 uri segments passed in the url, selected page of pagination will not be displayed correctly
It will highlight the first item all the time.Pagination is working.But selected page is not diplayed correctly.


Add this line to Pagination.php file which is located at system->libraries->Pagination.php
$this->uri_segment = $CI->uri->total_segments();


Add this line to where I have shown below.

        // Determine the current page number.

$CI =& get_instance();



if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) {

if ($CI->input->get($this->query_string_segment) != 0) {

$this->cur_page = $CI->input->get($this->query_string_segment);



// Prep the current page - no funny business!

$this->cur_page = (int) $this->cur_page;

}

}

else {

$this->uri_segment = $CI->uri->total_segments();

if ($CI->uri->segment($this->uri_segment) != 0) {

$this->cur_page = $CI->uri->segment($this->uri_segment);



// Prep the current page - no funny business!

$this->cur_page = (int) $this->cur_page;

}

}