Welcome Guest, Not a member yet? Register   Sign In
Template parser warning message combine with pagination
#1

[eluser]alfisahr[/eluser]
Hi everybody,

Please help about my problem.

I get warning message in my program output. Here this,

A PHP Error was encountered

Severity: Warning

Message: preg_match() [function.preg-match]: Compilation failed: nothing to repeat at offset 2

Filename: libraries/Parser.php

Line Number: 161

I think, this problem caused with my combination template parser class & pagination. Here this my controller file

............
var $limit = 2;
function get_news($offset = 0) {
$query_setting = $this->Index_model->web_setting()->result();
foreach($query_setting as $row)
{
$web_title = $row->web_title;
$favicon = $row->favicon;
$footer = $row->footer;
$web_theme = $row->web_theme;
}
$uri_segment = 4;
$offset = $this->uri->segment($uri_segment);

$query_news = $this->Konten_model->get_news($this->limit,$offset)->result_array();
$Nquery = $this->db->query('select * from news');
$num_rows = $Nquery->num_rows();

$config['base_url'] = site_url().'/id/konten/get_news';
$config['total_rows'] = $num_rows;
$config['per_page'] = $this->limit;
$config['uri_segment'] = $uri_segment;
$this->pagination->initialize($config);
$pagination = $this->pagination->create_links();

foreach($query_news as $row_news)
{
$tmpbagberita = array();
$tmp = explode(" ",$row_news['isi']);
for($j=0;$j<=15;$j++)
{
$tmpbagberita[$j] = $tmp[$j];
}
$bagberita = implode(" ",$tmpbagberita);
$news[] = array('title_news' => $row_news['judul'],'wktnews' => $row_news['wktkirim'],'isi_news' => $bagberita . '... Selengkapnya',array('class' => 'newsdetail'));
}
$data = array('pagination' => $pagination, 'news' => $news);

$this->parser->parse($web_theme.'/theme03',$data);

}
............


And this my content model file

......
function get_news($limit, $offset) {
$this->db->select('wktkirim,judul,isi');
$this->db->from('news');
$this->db->where('publish','1');
$this->db->order_by('news_id','desc');
$this->db->limit($limit,$offset);
return $this->db->get();
}
.........


And this is my view file

<div id="news">News</div><br>
{news}
<div id="title_news">{title_news}</div>
<div id="wktnews">{wktnews}</div>
<div id="isi_news">{isi_news}</div>
{/news}<br>
{pagination}

Dou you know about this problem ?? Please help me

thanks before
Rgrds




Theme © iAndrew 2016 - Forum software by © MyBB