[eluser]rad11[/eluser]
I try do a image gallery with help pagination but have problem with it. My pagination doesnt highlights for a number of page and hill doest work. When I change with ma link
http://localhost/ci/media_ctrl/gallery/galeria1/1 or 2 or 3 images changing but not with pagination
View
Code:
<?php
foreach($query_all->result() as $row){
echo anchor($row->image_url, "<img >image_url' />");
echo form_hidden('images[]', $row->id_image);
}
foreach($query->result() as $row){
echo '<div center;">';
echo "<img >image_url' />";
echo '</div>';
}
echo '<div center;">';
echo $this->pagination->create_links();
echo '</div>'
?>
Controller
Code:
public function gallery($folder_name){
$config['base_url'] = 'http://localhost/ci/media_ctrl/gallery/' . $folder_name . '/';
$config['total_rows'] = $this->db->get('images')->num_rows();
$config['per_page'] = 1;
$config['num_links'] = 5;
$config['full_tag_open'] = '<div class="pagination_articles">';
$config['full_tag_close'] = '</div>';
$uri = $this->uri->segment(4);
$this->pagination->initialize($config);
$data['query_all'] = $this->model_media->show_images_from_folder($folder_name);
$data['query'] = $this->model_media->show_images_from_folder_pag($folder_name, $config['per_page'], $uri);
$this->load->view('media/show_folder_images_view', $data);
}
Model
Code:
public function show_images_from_folder_pag($folder_name, $config, $uri){
$this->db->select('*');
$this->db->from('images i');
$this->db->join('create_folder f', 'i.id_folder = f.id_folder');
$this->db->where('f.folder_name', $folder_name);
$this->db->limit(1, $uri);
$query = $this->db->get();
return $query;
}