0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: rss.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 - rss.php | ------------------------------------------------------------------------- | | This controller file generates the rss feeds | */ class Rss extends Public_Controller { function __construct() { parent::Public_Controller(); //load sitemap model $this->load->model('init_model', 'init'); $this->load->model('rss_model', 'rss'); $this->load->helper('xml'); $this->num_options = get_default_currency($this->config->item('sts_store_default_currency')); } // ------------------------------------------------------------------------ function index() { //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; } $data['lang_rss_feeds'] = $this->lang->line('rss_feeds'); $data['lang_new_products'] = $this->lang->line('new_products'); $data['lang_featured_products'] = $this->lang->line('featured_products'); $data['lang_get_feed'] = $this->lang->line('get_feed'); $data['lang_faqs'] = $this->lang->line('frequently_asked_questions_faqs'); $data['page_title'] = $data['layout_design_header_tag_line'] . ' - ' . $this->lang->line('rss_feeds'); $data['meta_keywords'] = $data['sts_store_default_keywords'] . ', ' . $this->lang->line('rss_feeds'); $data['meta_description'] = $data['sts_store_description'] . ' ' . $this->lang->line('rss_feeds'); $this->parser->_JROX_load_view('tpl_rss_feeds', 'content_pages', $data); } // ------------------------------------------------------------------------ function feed() { //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; } switch ($this->uri->segment(3)) { case 'new_products': $data['rows'] = $this->rss->_get_new_products($this->num_options); $data['feed_name'] = $this->config->item('sts_store_name') . ' - ' . $this->lang->line('new_products'); $data['feed_url'] = base_url() . PRODUCTS_ROUTE . '/new_products'; break; case 'featured_products': $data['rows'] = $this->rss->_get_featured_products($this->num_options); $data['feed_name'] = $this->config->item('sts_store_name') . ' - ' . $this->lang->line('featured_products'); $data['feed_url'] = base_url() .'/home/index/store'; break; case 'faq': $data['rows'] = $this->rss->_get_faqs($this->num_options); $data['feed_name'] = $this->config->item('sts_store_name') . ' - ' . $this->lang->line('faqs'); $data['feed_url'] = base_url() . FAQ_ROUTE . '/view'; break; default: //content $data['rows'] = $this->rss->_get_content($this->num_options); $data['feed_name'] = $this->config->item('sts_store_name') . ' - ' . $this->lang->line('content'); $data['feed_url'] = base_url() . CONTENT_ROUTE . '/view'; break; } $data['encoding'] = 'utf-8'; $data['page_description'] = $this->config->item('sts_store_description'); $data['page_language'] = 'en-ca'; $data['creator_email'] = $this->config->item('sts_store_email'); $data['content_type'] = PRODUCTS_ROUTE; header("Content-Type: application/rss+xml"); $this->load->view('main/tpl_rss_feed', $data); } // ------------------------------------------------------------------------ } ?>