0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: faq.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 - faq.php | ------------------------------------------------------------------------- | | This controller file is used to generate content for FAQs | */ class Faq extends Public_Controller { function __construct() { parent::Public_Controller(); //load css body style $this->config->set_item('css_body', 'jroxFaqs'); //load required models $this->load->model('init_model', 'init'); $this->load->model('faq_model', 'faq'); //create pagination links $this->config->set_item('uri', $this->config->item('base_folder_path') . '/' . $this->uri->segment(1)); } // ------------------------------------------------------------------------ function index() { //redirect to default view redirect(FAQ_ROUTE . '/view'); } // ------------------------------------------------------------------------ function view() { //set data array $data = $this->security_model->_load_config('public'); //initialize site with required db config $sdata = $this->init->_initialize(__CLASS__, __FUNCTION__); if ($this->uri->segment(3) == 'search') { $search_term = $this->uri->segment(4); $uri = $data['uri'] . '/view/search/' . $search_term; $data['query_string'] = str_replace('_', ' ', $search_term); } else { $category_id = (int)$this->uri->segment(4, 1); $uri = $data['uri'] . '/view/category_id/' . $category_id; } //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_faqs'] = $this->lang->line('frequently_asked_questions_faqs'); $data['lang_show'] = $this->lang->line('show'); $data['offset'] = $this->uri->segment(5, 0); $data['sort_column'] = $this->config->item('pub_dbs_faq_column'); $data['sort_order'] = $this->uri->segment(6, $this->config->item('pub_dbs_faq_order')); $data['next_sort_order'] = $this->uri->segment(6) == 'DESC' ? 'ASC' : 'DESC'; $data['page_title'] = $data['layout_design_header_tag_line'] . ' - ' . $this->lang->line('frequently_asked_questions_faqs'); $data['meta_keywords'] = $data['sts_store_default_keywords']; $data['meta_description'] = $data['sts_store_description']; //get the category details $filter = $this->db_validation_model->_get_details('faq_categories', '*', 'category_id', $category_id); $data['faq_category_name'] = $filter[0]['category_name']; //get faq_articles $sdata = $this->faq->_get_faq_articles($data['sts_faq_articles_per_page'], $data['offset'], $data['sort_column'], $data['sort_order'], true, $category_id); if (empty($sdata['rows'])) { $data['articles'] = array(); $data['pagination_rows'] = ''; $data['no_articles'] = '1'; $data['lang_no_articles_found'] = $this->lang->line('no_articles_found'); } else { //add the data to the array $data['articles'] = $sdata['rows']; $data['no_articles'] = '0'; //set pagination $pagination = $this->db_validation_model->_set_pagination($uri, 'faq_articles', $data['sts_faq_articles_per_page'], 5, $data['sort_order'], $data['sort_column'], $sdata['total_rows'], '', '', 'public'); $data['pagination_rows'] = $pagination['rows']; $data['num_pages'] = $pagination['num_pages']; $data['no_pages'] = $data['num_pages'] > 1 ? 1 : 0; } $this->parser->_JROX_load_view('tpl_faq', 'faq_pages', $data); } // ------------------------------------------------------------------------ function article() { //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 the category ID $data['content_title_url'] = $this->uri->segment(4); $data['article_id'] = (int)$this->uri->segment(3, 1); $data['lang_login_to_comment'] = $this->lang->line('login_to_comment'); $data['lang_click_to_register'] = $this->lang->line('click_to_register'); $data['lang_post_comment'] = $this->lang->line('post_comment'); $data['lang_comments'] = $this->lang->line('comments'); $data['show_message'] = ''; //get the article $row = $this->faq->_get_faq_article_details($data['article_id']); //set the meta tags $data['page_title'] = $row[0]['content_title']; $data['meta_keywords'] =$row[0]['content_tags']; $data['meta_description'] = $data['sts_store_description'] . ' - ' . $row[0]['content_title']; $data['content_title'] = $row[0]['content_title']; $data['content_body'] = $row[0]['content_body']; $data['template'] = $this->parser->_JROX_parse('tpl_faq_details', APPPATH . 'views/main', $data); $this->load->view('main/tpl_main', $data); } // ------------------------------------------------------------------------ } ?>