Beispiel #1
0
 function tagsDangTin($url)
 {
     $title = geturlfromuri($this->uri->segment(2));
     $tags = explode('-', $title);
     $title = implode(' ', $tags);
     $estates = new Estate();
     $estates->order_by('created', 'desc');
     $estates->group_start();
     $estates->like('tag_search', '%' . $title . '%');
     $estates->group_end();
     $estates->get();
     $dis['estates'] = $estates;
     // seo
     $this->page_title = $title . ' | ' . $this->page_title;
     $this->page_description = "Có " . $estates->result_count() . " kết quả tìm kiếm với từ khóa " . $title . ' | ' . $this->page_description;
     $this->page_keyword = $this->page_keyword;
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/estates/tags';
     $this->viewfront($dis);
 }
Beispiel #2
0
 function tagsDangTin($url)
 {
     $url = $this->uri->segment(2, "");
     $arrUrl = explode('.', $url);
     $title = $arrUrl[0];
     $query_string = explode($arrUrl[0] . '.html&', $this->uri->segment(2, ""));
     parse_str($query_string[1], $_GET);
     $this->load->library('pagination');
     $limit = 20;
     $page = $_GET['per_page'] == "" ? 1 : $_GET['per_page'];
     $offset = ($page - 1) * $limit;
     $tags = explode('-', $title);
     $title = implode(' ', $tags);
     $estates = new Estate();
     $estates->order_by('isVip', 'desc');
     $estates->order_by('created', 'desc');
     $estates->group_start();
     $estates->like('tag_search', '%' . $title . '%');
     $estates->group_end();
     $estates->get_paged($offset, $limit, TRUE);
     $dis['estates'] = $estates;
     $estatesAll = new Estate();
     $estatesAll->order_by('isVip', 'desc');
     $estatesAll->order_by('created', 'desc');
     $estatesAll->group_start();
     $estatesAll->like('tag_search', '%' . $title . '%');
     $estatesAll->group_end();
     $estatesAll->get_iterated();
     $url = base_url() . $this->uri->segment(1) . '/' . $arrUrl[0] . '.html';
     $config['base_url'] = $url;
     $config['total_rows'] = $estatesAll->result_count();
     $config['per_page'] = $limit;
     $config['use_page_numbers'] = TRUE;
     $config['page_query_string'] = TRUE;
     $config['uri_segment'] = 2;
     $config['num_links'] = 2;
     $config['full_tag_open'] = '<div class="news-pagination">';
     $config['full_tag_close'] = "</div>";
     $config['first_link'] = FALSE;
     $config['first_tag_open'] = '';
     $config['first_tag_close'] = '';
     $config['last_link'] = FALSE;
     $config['last_tag_open'] = '';
     $config['last_tag_close'] = '';
     $config['next_link'] = '>';
     $config['next_tag_open'] = '';
     $config['next_tag_close'] = '';
     $config['prev_link'] = '<';
     $config['prev_tag_open'] = '';
     $config['prev_tag_close'] = '';
     $config['num_tag_open'] = '';
     $config['num_tag_close'] = '';
     $config['cur_tag_open'] = '<span class="active">';
     $config['cur_tag_close'] = '</span>';
     $this->pagination->initialize($config);
     // support seo
     $this->page_title = 'Thông tin ' . $title . ' mới nhất';
     $this->page_description = $title . ' với đầy đủ thông tin giá, hình ảnh, hướng, vị trí...cập nhật nhất';
     $keyword = explode(' ', $this->page_title);
     $this->page_keyword = implode(',', $keyword);
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/estates/tags';
     $this->viewfront($dis);
 }