[eluser]aquary[/eluser]
Just put the code in to your view. From the query, I'm assuming you are selecting 1 content. You have to change the result part and use row() instead.
Code:
$data['pages'] = $this->db->select('ID_Page, datPublicationDate, strTitle, strPageName, strMetatags, strKeywords, strContent, strPageUrl, strContentIntro, temTemplate')->where('strPageUrl', $id)->get('tblpage')->row();
Now the controller
Code:
$data['page_number']=$page_number; // assume this is the pagenumber
$data['pages']=$this->model->get_pages($id); // assume this is your model
if(empty($data['pages']))
echo 'page not found'; // a fallback if no data.
else
{
// you would need a total_rows for pagination somewhere,
$total_rows=substr_count('[PAGEBREAK]', $data['pages']->strContent)+1;
// now use it to initialize the pagination
// The load the view
}
The View, no need to use foreach now, since you will have 1 object, or none.
Code:
<div id="viewtext">
<?php
$pages->strContent=explode('[PAGEBREAK]', $pages->strContent;
// Assume you send the page number into the view already
if(!empty($pages->strContent[$page_number])) // Just some error proof
{
echo $pages->strContent[$page_number];
}
// OR use foreach on the $pages->strContent to echo all pages, and do something fancy as needed.
?>
<?php endforeach ?>
<?php echo $this->pagination->create_links();?>
</div>
Should be only this...