Welcome Guest, Not a member yet? Register   Sign In
simple codeignier pagination problem
#3

[eluser]alectrash[/eluser]
thankyou dr dan just what the doctor (you maybe) ordered, lol!

I added

Code:
$config['uri_segment'] = '4';

function in my controller now looks like this:

Code:
function tags()
{
    $data['menuitem'] = $this->uri->segment(1);
    $data['tag'] = $this->uri->segment(3);
    $data['itemnumber'] = $this->uri->segment(4);
    
    //get query for all digital art like tag received
    $data['query'] = $this->db->like('dbtags', $data['tag'])->order_by("dbdate", "desc")->where('dbstatus', 'published')->get('tblmedia');
  
    $item_count = count($data['query']->result());
  
    if($item_count < 1)
    {
      redirect('gallery');
    }
    
    $config['base_url'] = '/gallery/tags/' . $data['tag'];
    $config['total_rows'] = $item_count;
    $config['uri_segment'] = '4';
    $config['per_page'] = '5';
    
    $data['per_page'] = $config['per_page'];
    
    $this->pagination->initialize($config);
    if($item_count > $config['per_page'])
    {
     $this->pagination->create_links();  
    }
    
    $this->load->view('gallery_tag_view', $data);
    
}

hope this helps somebody out one day!


Messages In This Thread
simple codeignier pagination problem - by El Forum - 10-13-2008, 11:13 AM
simple codeignier pagination problem - by El Forum - 10-13-2008, 11:48 PM
simple codeignier pagination problem - by El Forum - 10-14-2008, 02:38 AM
simple codeignier pagination problem - by El Forum - 10-28-2008, 06:45 PM
simple codeignier pagination problem - by El Forum - 10-29-2008, 03:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB