Example #1
1
 function detail($title_none = NULL)
 {
     $cat_news_url = $this->uri->segment(1);
     $cat_news = new Newscatalogue();
     $cat_news->where(array('name_none' => $cat_news_url))->get();
     if (!$cat_news->exists()) {
         show_404();
     }
     $dis['cat_news'] = $cat_news;
     $cat = $this->uri->segment(2);
     $category = new Newscatalogue();
     $category->where(array('name_none' => $cat, 'parentcat_id' => $cat_news->id))->get();
     if (!$category->exists()) {
         show_404();
     }
     $dis['category'] = $category;
     $title_none = geturlfromuri($this->uri->segment(3));
     $news = new Article();
     $news->where(array('title_none' => $title_none, 'newscatalogue_id' => $category->id));
     $news->get();
     if (!$news->exists()) {
         redirect(base_url() . $this->uri->segment(1, '') . '/' . $this->uri->segment(2, ''));
         die;
     }
     $dis['news'] = $news;
     $tag = $news->tag;
     $dis['tag'] = explode(',', $tag);
     $news->view_count = $news->view_count + 1;
     $news->save();
     //related news
     $related_news = new Article();
     $related_news->where('recycle', 0);
     $related_news->where('newscatalogue_id', $news->newscatalogue_id);
     $related_news->where("id !=", $news->id);
     $related_news->order_by('created', 'DESC');
     $related_news->get_paged(0, 15, TRUE);
     $dis['related_news'] = $related_news;
     $arrayCateNewsId = array();
     foreach ($this->guideCate as $row) {
         $arrayCateNewsId[] = $row->id;
     }
     $arrayCateNewsId = array();
     foreach ($this->guideCate as $row) {
         $arrayCateNewsId[] = $row->id;
     }
     // get news view most
     $newViewMost = new Article();
     $newViewMost->where('recycle', 0);
     $newViewMost->where_in('newscatalogue_id', $arrayCateNewsId);
     $newViewMost->order_by('view_count', 'desc');
     $newViewMost->get(5);
     $dis['newViewMost'] = $newViewMost;
     // get news view most
     $newView = new Article();
     $newView->where('recycle', 0);
     $newView->where_in('newscatalogue_id', $arrayCateNewsId);
     $newView->order_by('created', 'desc');
     $newView->get(5);
     $dis['newView'] = $newView;
     $this->page_title = $news->{'title_vietnamese'} . ' | SotayNhadat.vn';
     $this->page_description = $news->short_vietnamese;
     $this->page_keyword = $news->tag;
     $this->url = base_url() . substr($this->uri->uri_string, 1, strlen($this->uri->uri_string));
     $this->isRobotFollow = 1;
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/guides/news_de';
     $this->viewfront($dis);
 }
Example #2
0
 function detail($title_none = NULL)
 {
     $title_none = $this->uri->segment(3);
     $arrTitle = explode('.', $title_none);
     if ($arrTitle[1] == '' || $arrTitle[1] != 'html') {
         redirect('');
     }
     $title_none = $arrTitle[0];
     $news = new Article();
     $news->where('title_none', $title_none);
     $news->get();
     //print_r($this->db->last_query());exit();
     if (!$news->exists()) {
         show_404();
     }
     $dis['news'] = $news;
     //related news
     $related_news = new Article();
     $related_news->where('recycle', 0);
     $related_news->where('newscatalogue_id', $news->newscatalogue_id);
     $related_news->where("id !=", $news->id);
     $related_news->order_by('created', 'DESC');
     $related_news->get_paged(0, 10, TRUE);
     $dis['related_news'] = $related_news;
     $category = new Newscatalogue($news->newscatalogue_id);
     $dis['category'] = $category;
     $this->page_title = $news->{'title_vietnamese'};
     $this->page_description = $news->short_vietnamese;
     $this->page_keyword = $news->tag;
     $dis['base_url'] = base_url();
     $dis['link'] = base_url() . $_SERVER['REQUEST_URI'];
     $dis['view'] = 'front/services/news_de';
     $this->viewfront($dis);
 }
Example #3
0
 function detail($url)
 {
     $urlcat = $this->uri->segment(1);
     $category = new Newscatalogue();
     $category->where(array('recycle' => 0, 'name_none' => $urlcat))->get();
     if (!$category->exists()) {
         show_404();
     }
     $dis['category'] = $category;
     $url = geturlfromuri($this->uri->segment(2));
     $news = new Article();
     $news->where(array('title_none' => $url, 'recycle' => 0));
     $news->get();
     if (!$news->exists()) {
         show_404();
     }
     $dis['news'] = $news;
     $this->page_title = $news->title_vietnamese;
     $this->page_description = $news->short_vietnamese;
     $this->page_keyword = $news->tag;
     //related news
     $related_news = new Article();
     $related_news->where('recycle', 0);
     $related_news->where('newscatalogue_id', $news->newscatalogue_id);
     $related_news->where("id !=", $news->id);
     $related_news->order_by('created', 'DESC');
     $related_news->get_paged(0, 10, TRUE);
     $dis['related_news'] = $related_news;
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/newsother/news_de';
     $this->viewfront($dis);
 }
Example #4
0
 function detail($title_none = NULL)
 {
     //echo 'lien minh';exit;
     $news = new Article();
     $news->where('title_none', $title_none);
     $news->get();
     //print_r($this->db->last_query());exit();
     if (!$news->exists()) {
         show_404();
     }
     $dis['news'] = $news;
     //related news
     $related_news = new Article();
     $related_news->where('recycle', 0);
     $related_news->where('newscatalogue_id', $news->newscatalogue_id);
     $related_news->where("id !=", $news->id);
     $related_news->order_by('created', 'DESC');
     $related_news->get_paged(0, 10, TRUE);
     $dis['related_news'] = $related_news;
     $category = new Newscatalogue();
     $category->where(array('id' => $news->newscatalogue_id))->get();
     if ($category->name_none == "khuyen-mai") {
         $this->menu_active = "khuyen-mai";
     }
     $this->page_title = $news->{'title_vietnamese'};
     $this->page_description = $news->short_vietnamese;
     $this->page_keyword = $news->tag;
     $dis['base_url'] = base_url();
     $dis['link'] = gen_seo_url($this->lang->line('news')) . '/';
     $dis['view'] = 'front/recruit/recruit_de';
     $this->viewfront($dis);
 }
Example #5
0
 function tags($url)
 {
     $title = $this->uri->segment(2);
     $level = 2;
     $page = $this->uri->segment($level + 1, "") == "" ? 1 : $this->uri->segment($level + 1);
     $dis['page'] = $page;
     $limit = 15;
     $offset = ($page - 1) * $limit;
     $tags = explode('-', $title);
     $title = implode(' ', $tags);
     $news = new Article();
     $news->order_by('created', 'desc');
     $news->group_start();
     $news->like('tag_search', '%' . $title . '%');
     $news->where(array('recycle' => 0));
     $news->where_not_in('newscatalogue_id', array(90));
     $news->group_end();
     $news->get_paged($offset, $limit, TRUE);
     $dis['news'] = $news;
     $newsAll = new Article();
     $newsAll->order_by('created', 'desc');
     $newsAll->group_start();
     $newsAll->like('tag_search', '%' . $title . '%');
     $newsAll->where(array('recycle' => 0));
     $newsAll->where_not_in('newscatalogue_id', array(90));
     $newsAll->group_end();
     $newsAll->get();
     $total = $newsAll->result_count();
     /*Begin pagination for product*/
     $url = $this->uri->segment(1) . '/' . $this->uri->segment(2);
     $config['base_url'] = site_url($url);
     $config['total_rows'] = $total;
     $config['per_page'] = $limit;
     $config['use_page_numbers'] = TRUE;
     $config['uri_segment'] = 3;
     $config['num_links'] = 3;
     $config['full_tag_open'] = '<div class="news-pagination" style="padding-top: 10px;">';
     $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);
     /*End pagination for product*/
     $arrayCateNewsId = array();
     foreach ($this->newsCate as $row) {
         $arrayCateNewsId[] = $row->id;
     }
     // get news view most
     $newViewMost = new Article();
     $newViewMost->where('recycle', 0);
     $newViewMost->where_in('newscatalogue_id', $arrayCateNewsId);
     $newViewMost->order_by('view_count', 'desc');
     $newViewMost->get(5);
     $dis['newViewMost'] = $newViewMost;
     $newNews = new Article();
     $newNews->where('recycle', 0);
     $newNews->where_in('newscatalogue_id', $arrayCateNewsId);
     $newNews->order_by('created', 'desc');
     $newNews->get(5);
     $dis['newNews'] = $newNews;
     // seo
     $this->page_title = 'Thông tin ' . $title . ' đầy đủ, cập nhật nhất';
     $this->page_description = $title . ' với đầy đủ thông tin, cập nhật liên tục...';
     $keyword = explode(' ', $this->page_title);
     $this->page_keyword = implode(',', $keyword);
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/tags';
     $this->viewfront($dis);
 }
Example #6
0
	<div class="title">
		<div class="f_hotline txt fl">Tin tức</div>
		<div class="f_accessories txt fl">Sản phẩm</div>
		<div class="txt fl">liên kết</div>
		<div class="clr"></div>
	</div>
	
	<div class="footer_links">
		<div class="f_hotline f_height fl">
            <?php 
$footerNews = new Article();
$footerNews->where('recycle', 0);
$footerNews->where('active', 1);
$footerNews->where('newscatalogue_id', 58);
$footerNews->order_by('created', 'DESC');
$footerNews->get_paged(0, 5, TRUE);
?>
            <?php 
foreach ($footerNews as $row) {
    ?>
            <div style="height: 21px;width: 185px;overflow: hidden;float:left;clear:both;"><a href="<?php 
    echo $base_url . "tin-tuc/d/" . $row->{'title_none'};
    ?>
" title="<?php 
    echo $row->title_vietnamese;
    ?>
">&raquo; <?php 
    echo $row->title_vietnamese;
    ?>
</a></div>
            <span style="color: #fff;">...</span>
Example #7
0
 function detail($title_none = NULL)
 {
     $cat_news_url = $this->uri->segment(1);
     $cat_news = new Newscatalogue();
     $cat_news->where(array('name_none' => $cat_news_url, 'parentcat_id' => NULL))->get();
     if (!$cat_news->exists()) {
         show_404();
     }
     $dis['cat_news'] = $cat_news;
     $cat = $this->uri->segment(2);
     $category = new Newscatalogue();
     $category->where(array('name_none' => $cat, 'parentcat_id' => $cat_news->id))->get();
     if (!$category->exists()) {
         show_404();
     }
     $dis['category'] = $category;
     $title_none = geturlfromuri($this->uri->segment(3));
     $news = new Article();
     $news->where(array('title_none' => $title_none, 'newscatalogue_id' => $category->id));
     $news->get();
     if (!$news->exists()) {
         show_404();
     }
     $dis['news'] = $news;
     $tag = $news->tag;
     $dis['tag'] = explode(',', $tag);
     $news->view_count = $news->view_count++;
     $news->save();
     //related news
     $related_news = new Article();
     $related_news->where('recycle', 0);
     $related_news->where('newscatalogue_id', $news->newscatalogue_id);
     $related_news->where("id !=", $news->id);
     $related_news->order_by('created', 'DESC');
     $related_news->get_paged(0, 10, TRUE);
     $dis['related_news'] = $related_news;
     $this->page_title = $news->{'title_vietnamese'} . ' | Dự án ' . $category->name_vietnamese . ' ' . $news->{'title_vietnamese'} . ' | SotayNhadat.vn';
     $this->page_description = $news->short_vietnamese;
     $this->page_keyword = $news->tag;
     $this->isRobotFollow = 1;
     $dis['base_url'] = base_url();
     $dis['view'] = 'front/project/news_de';
     $this->viewfront($dis);
 }