Example #1
0
 function index($offset = 0, $limit = 15)
 {
     if (empty($offset)) {
         $offset = $this->uri->segment(2);
     }
     $arrayCateNewsId = array();
     foreach ($this->guideCate as $row) {
         $arrayCateNewsId[] = $row->id;
     }
     // get news hot
     $newHot = new Article();
     $newHot->where('recycle', 0);
     $newHot->where('hot', 1);
     $newHot->where_in('newscatalogue_id', $arrayCateNewsId);
     $newHot->order_by('created', 'desc');
     $newHot->get(4);
     $dis['newHot'] = $newHot;
     $dis['newHotFirst'] = $newHot->limit(1);
     // 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 new
     $newNews = new Article();
     $newNews->where('recycle', 0);
     $newNews->where_in('newscatalogue_id', $arrayCateNewsId);
     $newNews->order_by('created', 'desc');
     $newNews->get_paged($offset, $limit, TRUE);
     $dis['newNews'] = $newNews;
     setPaginationVb('cam-nang/', $newNews->paged->total_rows, $limit, 2);
     //seo
     $category = new Newscatalogue(76);
     $this->page_title = $category->title_bar;
     $this->page_description = $category->slogan;
     $this->page_keyword = $category->keyword;
     $this->isRobotFollow = 1;
     $dis['base_url'] = base_url();
     $dis['link'] = gen_seo_url($this->lang->line('news')) . '/';
     $dis['view'] = 'front/guides/news';
     $this->viewfront($dis);
 }
Example #2
0
                    </div>
                </div>
                <?php 
    }
}
?>
            </div>
            <!-- end cotphainoibat-->
        </div>
        <?php 
foreach ($this->newsCate as $row) {
    $news = new Article();
    $news->where(array('recycle' => 0, 'newscatalogue_id' => $row->id));
    $news->order_by('id', 'desc');
    $news->get(5);
    $newsFirst = $news->limit(1);
    ?>
            <!--tin con 1 -->
            <div class="tinthitruong">
                <p style="font-size:16px; font-weight:bold; color:#FFFFFF; margin-left:12px; margin-top:8px;">
                    <a style="color: #FFF;" href="<?php 
    echo $base_url . 'tin-tuc/' . $row->name_none;
    ?>
">
                        <?php 
    echo $row->name_vietnamese;
    ?>
                    </a>
                </p>
            </div>
            <div class="sreencacmuccon">
Example #3
0
 function MY_Controller()
 {
     parent::Controller();
     $this->load->library('enum');
     $this->load->config('fireignition');
     $this->load->helper('language');
     $this->lang->load('site');
     $this->load->library('hit_counter');
     $this->load->library('FirePHP');
     if ($this->config->item('fireignition_enabled')) {
         if (floor(phpversion()) < 5) {
             log_message('error', 'PHP 5 is required to run fireignition');
         } else {
             $this->load->library('FirePHP');
         }
     } else {
         $this->load->library('Firephp_fake');
         $this->firephp =& $this->firephp_fake;
     }
     //redirect from old website
     $this->redirectList();
     $cauhinh = new cauhinh();
     $cauhinh->get();
     $this->cauhinh = $cauhinh;
     if ($this->uri->segment(1, "") == "admin") {
         $this->logged_in_user = $this->_get_user();
         $this->admin = $this->config->item('admin');
         $this->admin_url = $this->config->item('admin_url');
         $this->admin_images = base_url() . "images/admin/";
         //LOAD HELPER
         $this->load_admin_resource();
         //check maintenance admin , only webmaster can login
         $this->resetNewsViewMost();
     } else {
         //check login user
         //$this->flogged_in_user=$this->_fget_user();
         $this->isCache = true;
         $this->userLoginFlag = 0;
         $userLogin = $this->session->userdata('userLogin');
         $userToken = $this->session->userdata('userToken');
         $customer = new Customer();
         $customer->get_by_username($userLogin);
         if ($customer->exists() && md5($customer->id) == trim($userToken)) {
             $loginUsername = $customer->username;
             $this->customer = $customer;
             if ($this->session->userdata('userloginFlag') == "1") {
                 $this->userLoginFlag = 1;
                 $this->session->set_userdata('userloginFlag', "0");
             }
         } else {
             $loginUsername = "";
         }
         $this->loginUsername = $loginUsername;
         $this->loginUser = $customer;
         $this->page_title = getconfigkey("defaultPageTitle");
         $this->load->helper('language');
         $this->show_analytic = TRUE;
         $this->page_keyword = getconfigkey("defaultKeyword");
         $this->page_description = getconfigkey("defaultDescription");
         $this->isRobotFollow = true;
         //------------------------------------------------
         // get data handler
         //------------------------------------------------
         $listAllCat = array();
         $newsCate = new Newscatalogue();
         $newsCate->order_by('position');
         $newsCate->where(array('recycle' => 0, 'parentcat_id' => 58));
         $newsCate->get_iterated();
         $this->newsCate = $newsCate;
         foreach ($newsCate as $row) {
             array_push($listAllCat, $row->id);
         }
         /*Get all business cat*/
         $businessCat = new Newscatalogue();
         $businessCat->order_by('position');
         $businessCat->where(array('recycle' => 0, 'parentcat_id' => 91));
         $businessCat->get_iterated();
         $this->businessCat = $businessCat;
         $guideCate = new Newscatalogue();
         $guideCate->order_by('position');
         $guideCate->where(array('recycle' => 0, 'parentcat_id' => 76));
         $guideCate->get_iterated();
         $this->guideCate = $guideCate;
         foreach ($guideCate as $row) {
             array_push($listAllCat, $row->id);
         }
         $this->listAllCat = $listAllCat;
         $projectsCate = new Newscatalogue();
         $projectsCate->order_by('position');
         $projectsCate->where(array('recycle' => 0, 'parentcat_id' => 83));
         $projectsCate->get_iterated();
         $this->projectsCate = $projectsCate;
         $arrayCateNewsId = array();
         foreach ($this->projectsCate as $row) {
             $arrayCateNewsId[] = $row->id;
         }
         $this->arrCateProject = $arrayCateNewsId;
         // project hot
         $projectHot = new Article();
         $projectHot->where('recycle', 0);
         $projectHot->where('hot', 1);
         $projectHot->where_in('newscatalogue_id', $arrayCateNewsId);
         $projectHot->order_by('created', 'desc');
         $projectHot->get(3);
         $this->projectHot = $projectHot;
         //get all housesale
         $typeHouseSale = new Estatetype();
         $typeHouseSale->where('estatecatalogue_id', 1);
         $typeHouseSale->order_by('position');
         $typeHouseSale->get_iterated();
         $this->typeHouseSale = $typeHouseSale;
         //get all houselease
         $typeHouseLease = new Estatetype();
         $typeHouseLease->where('estatecatalogue_id', 2);
         $typeHouseLease->order_by('position');
         $typeHouseLease->get_iterated();
         $this->typeHouseLease = $typeHouseLease;
         //get all housedemand
         $typeHouseDemand = new Estatetype();
         $typeHouseDemand->where('estatecatalogue_id', 3);
         $typeHouseDemand->order_by('position');
         $typeHouseDemand->get_iterated();
         $this->typeHouseDemand = $typeHouseDemand;
         // get all province
         $estateProvince = new Estatecity();
         $estateProvince->order_by('position', 'asc');
         $estateProvince->get_iterated();
         $this->estateProvince = $estateProvince;
         // get all Direction
         $estateDirection = new Estatedirection();
         $estateDirection->order_by('id', 'desc');
         $estateDirection->get_iterated();
         $this->estateDirection = $estateDirection;
         // get all Estatecatalogues
         $estateCatalogues = new Estatecatalogue();
         $estateCatalogues->order_by('position', 'asc');
         $estateCatalogues->get_iterated();
         $this->estateCatalogues = $estateCatalogues;
         // get all business world
         $businessWorld = new Article();
         $businessWorld->order_by('id', 'desc');
         $businessWorld->where(array('recycle' => 0, 'newscatalogue_id' => 78));
         $businessWorld->get(20);
         $this->businessWorld = $businessWorld;
         // get all project news
         $projectNews = new Article();
         $projectNews->order_by('id', 'desc');
         $projectNews->where(array('recycle' => 0, 'newscatalogue_id' => 71));
         $projectNews->get(6);
         $this->projectNews = $projectNews;
         $this->projectNewsFirst = $projectNews->limit(1);
         // get all legal advice
         $legalAdvices = new Article();
         $legalAdvices->order_by('id', 'desc');
         $legalAdvices->where(array('recycle' => 0, 'newscatalogue_id' => 82));
         $legalAdvices->get(11);
         $this->legalAdvices = $legalAdvices;
         // get all new STND
         $newsPrivate = new Article();
         $newsPrivate->order_by('id', 'desc');
         $newsPrivate->where(array('recycle' => 0, 'newscatalogue_id' => 75));
         $newsPrivate->get_iterated();
         $this->newsPrivate = $newsPrivate;
         // get all estateareas
         $estateareas = new Estatearea();
         $estateareas->order_by('position', 'asc');
         $estateareas->get_iterated();
         $this->estateareas = $estateareas;
         // get all estateprices
         $estateprices = new Estateprice();
         $estateprices->order_by('position', 'asc');
         $estateprices->get_iterated();
         $this->estateprices = $estateprices;
         //------------------------------------------------
         // Top Advertise
         //------------------------------------------------
         $banner = new banner();
         $banner->where('bannercat_id', 1);
         $banner->get_iterated();
         $this->banner = $banner;
         $bannerAdversiting = new Banner();
         $bannerAdversiting->where('bannercat_id', 19);
         $bannerAdversiting->get_iterated();
         $this->bannerAdversiting = $bannerAdversiting;
         $bannerLeft = new Banner();
         $bannerLeft->where('bannercat_id', 21);
         $bannerLeft->get_iterated();
         $this->bannerLeft = $bannerLeft;
         $bannerFooter = new Banner();
         $bannerFooter->where('bannercat_id', 20);
         $bannerFooter->get_iterated();
         $this->bannerFooter = $bannerFooter;
         $menu = new menu();
         $menu->order_by('position', 'asc');
         $menu->get_iterated(8);
         $this->menu = $menu;
         $productFooter = new menuitem();
         $productFooter->where('menu_id', 9);
         $productFooter->order_by('position', 'asc');
         $productFooter->get_iterated();
         $this->productFooter = $productFooter;
         $relation = new menuitem();
         $relation->order_by('position', 'asc');
         $relation->where('menu_id', 10);
         $relation->get_iterated();
         $this->relation = $relation;
         $this->_increaseVisiter();
         //load product manufacture
         $productManufacture = new Productmanufacture();
         $productManufacture->order_by('name', 'asc');
         $productManufacture->get_iterated();
         $this->productManufacture = $productManufacture;
         $adverHeader = new Banner();
         $adverHeader->where('bannercat_id', 25);
         $adverHeader->get(1);
         $this->adverHeader = $adverHeader;
         // get estates hot
         $newsHot = new Article();
         $newsHot->where_in('newscatalogue_id', array(71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82));
         $newsHot->order_by('id', 'desc');
         $newsHot->where('hotHome', 1);
         $newsHot->get(5);
         $this->newsHot = $newsHot;
     }
 }