0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: home.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); /* | ------------------------------------------------------------------------- | COPYRIGHT NOTICE | Copyright 2008 JROX Technologies, Inc. All Rights Reserved. | ------------------------------------------------------------------------- | This script may be only used and modified in accordance to the license | agreement attached (license.txt) except where expressly noted within | commented areas of the code body. This copyright notice and the | comments above and below must remain intact at all times. By using this | code you agree to indemnify JROX Technologies, Inc, its corporate agents | and affiliates from any liability that might arise from its use. | | Selling the code for this program without prior written consent is | expressly forbidden and in violation of Domestic and International | copyright laws. | | ------------------------------------------------------------------------- | FILENAME - home.php | ------------------------------------------------------------------------- | | This controller file is used for default home page | */ class Home extends Public_Controller { function __construct() { parent::Public_Controller(); //load css body style $this->config->set_item('css_body', 'jroxHome'); //load required models $this->load->model('init_model', 'init'); } // ------------------------------------------------------------------------ function index() { //set data array $data = $this->security_model->_load_config('public', __CLASS__, __FUNCTION__); //first check if we need to redirect to a custom URL $this->init->_redirect_home(); //initialize site with required db config $sdata = $this->init->_initialize(__CLASS__, __FUNCTION__); //set up the languages array $data['languages'] = $sdata['languages']; //set all text foreach ($sdata['text'] as $key => $val) { $data[$key] = $val; } //set referral info foreach ($sdata['aff_cfg'] as $key => $val) { $data[$key] = $val; } //set the meta tags $data['page_title'] = $data['layout_design_header_tag_line']; $data['meta_keywords'] = $data['sts_store_default_keywords']; $data['meta_description'] = $data['sts_store_description']; //load the content model $this->load->model('content_model'); $srow = $this->content_model->_get_homepage(); $data['home_content_body'] = $srow['content_body']; $data['home_content_title'] = $srow['content_title']; $data['meta_keywords'] .= ', ' . $srow['content_tags']; //check if store is to be manually loaded if ($this->uri->segment(1) == 'store') { if ($data['layout_design_home_page_redirect'] == 'homepage') { $data['home_content_body'] = ''; } $data['layout_design_home_page_redirect'] = 'store'; } //check what page to load switch ($data['layout_design_home_page_redirect']) { case 'content': $row = $this->content_model->_get_homepage_articles(); if (empty($row)) { $data['content'] = ''; $data['no_content'] = '1'; $data['lang_no_content_found'] = $this->lang->line('no_content_found'); } else { $data['content'] = $row; $data['no_content'] = '0'; } $data['lang_read_more'] = $this->lang->line('read_more'); $data['lang_more_articles'] = $this->lang->line('more_articles'); $this->parser->_JROX_load_view('tpl_content_home', 'home_page', $data); break; case 'store': $this->load->model('products_model'); //get products $num_options = get_default_currency($this->config->item('sts_store_default_currency')); $row = $this->products_model->_get_home_products($num_options); if (empty($row)) { $data['products'] = ''; $data['no_products'] = '1'; $data['lang_no_products_found'] = $this->lang->line('no_featured_products_home_page'); } else { $data['products'] = $row; $data['no_products'] = '0'; } $data['lang_more_info'] = $this->lang->line('more_info'); $data['lang_buy_now'] = $this->lang->line('buy_now'); $data['lang_more_featured_products'] = $this->lang->line('more_featured_products'); if ($this->session->userdata('user_products_grid_set') == 'grid') { $template = 'tpl_store_home_grid'; } else { $template = 'tpl_store_home'; } $this->parser->_JROX_load_view($template, 'store', $data); break; case 'homepage': //load the home page data $this->parser->_JROX_load_view('tpl_home_page', 'home_page', $data); break; } } // ------------------------------------------------------------------------ function maintenance() { //set data array $data = $this->security_model->_load_config('public'); //initialize site with required db config $sdata = $this->init->_initialize(__CLASS__, __FUNCTION__); //set up the languages array $data['languages'] = $sdata['languages']; //set all text foreach ($sdata['text'] as $key => $val) { $data[$key] = $val; } //set referral info foreach ($sdata['aff_cfg'] as $key => $val) { $data[$key] = $val; } //set page title $data['page_title'] = $this->lang->line('store_maintenance'); $data['meta_keywords'] = ''; $data['lang_heading'] = $this->lang->line('store_maintenance'); $data['show_message'] = $this->lang->line('store_maintenance_enabled'); $data['sub_message'] = ''; $this->parser->_JROX_load_view('tpl_general_message', 'none', $data); } // ------------------------------------------------------------------------ function switch_currency() { if ($this->uri->segment('3')) { $this->session->set_userdata('user_currency_set', $this->uri->segment(3)); } if ($this->agent->referrer()) { redirect_301($this->agent->referrer(), true, false); } else { redirect_301(); } } // ------------------------------------------------------------------------ function switch_language() { if ($this->uri->segment('3')) { $this->session->set_userdata('user_language_set', $this->uri->segment(3)); } if ($this->agent->referrer()) { redirect_301($this->agent->referrer(), true, false); } else { redirect_301(); } } } ?>