[eluser]happs74[/eluser]
Hi,
I've hunted about for this and there sure seem to be a lot of pagination queries so apologies for adding to them. A lot of them seemed to be solved by using uri_segment but my problem is trying to step round it. I'm knocking up a simple forum and when a user adds a new post they should go to the last page of the topic to see their post.
In my addmessage controller function after it's done all it's magic is redirects via
Code:
redirect('messageboard/viewboard/viewtopic/'.$topic_id.'/last');
and at the top of my viewtopic function I have
Code:
$topic_id = $this->uri->segment(4,0);
$pageno = $this->uri->segment(5,0);
$total_rows = %this->messages->getMessageCount($topic_id);
if($pageno == 'last')
{
#Get the offset of the last page
$pageno = $total_rows - ($total_rows % $this->config->item('message_per_page'));
}
My problem is that the $config['uri_segment'] = 5 that I pass to the pagination->initialize function pulls in the 'last' string, is there anyway to override it to pass in my calculated page offset.
Cheers in advance.