- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
if ($url=='/news/index.html')
{
$data = $this->dbf->execute('select * from news where status=1 order by date_add desc,id desc limit 10');
$object->smarty->assign('news_body',$data);
$object->smarty->assign('title','Новости');
} elseif(preg_match('@/news/([0-9]+?)/@i',$url,$out)){
$data = $this->dbf->execute('select * from news where status=1 and id='.intval($out[1]).' order by date_add desc limit 1');
$object->smarty->assign('news_body',$data);
$object->smarty->assign('title','Новости');
} elseif($url=='/search/') {
$data = array();
if ($_POST['search']!='' && strlen($_POST['search'])>6)
{
$data = $this->dbf->execute('select * from pages where content like "%'.mysql_real_escape_string($_POST['search'],$this->dbh->conn).'%" limit 10');
}
$object->smarty->assign('search',$data);
$object->smarty->assign('title','Поиск');
$object->smarty->assign('news',$this->dbh->execute('select * from news where status=1 order by date_add desc limit 3'));
} else {
$data = $this->dbf->execute('select * from pages where link="'.mysql_real_escape_string($url,$this->dbh->conn).'"');
$this->data = $data[0];
$object->smarty->assign('title',$this->data['title']);
$object->smarty->assign('news',$this->dbh->execute('select * from news where status=1 order by date_add desc limit 3'));
}
guest 29.11.2011 20:45 # −11
bugmenot 29.11.2011 20:56 # −11
guest 29.11.2011 23:38 # 0
bugmenot 29.11.2011 23:42 # 0
guest8 09.04.2019 12:15 # −999