0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: profiles.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 - profiles.php | ------------------------------------------------------------------------- | | This controller file is used to generate the profiles page for users | */ class Profiles extends Public_Controller { function __construct() { parent::Public_Controller(); //load css body style $this->config->set_item('css_body', 'jroxProfile'); //load required models $this->load->model('init_model', 'init'); $this->load->model('products_model', 'prod'); //create pagination links $this->config->set_item('uri', $this->config->item('base_folder_path') . '/' . $this->uri->segment(1)); $this->config->set_item('uri_string', str_replace('/', ':', trim_slashes($this->uri->uri_string()))); //set the username $this->config->set_item('jrox_site_referral', $this->uri->segment(2)); } function index() { redirect(); } function users() { if ($this->config->item('sts_affiliate_enable_profiles') == 0) redirect_301(); //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; } $aff_data = $this->aff->_validate_user($this->config->item('jrox_site_referral')); if (empty($aff_data)) redirect_301(); //format the affiliate data //check for image $data['sponsor_image'] = base_url() . 'images/misc/sponsor.png'; if (!empty($aff_data['photo_file_name'])) { if ($aff_data['image_resized'] == 1) { $filename = $aff_data['raw_name'] . '_jrox' . $aff_data['file_ext']; } else { $filename = $aff_data['photo_file_name']; } $data['sponsor_image'] = base_url() . 'images/' . $this->config->item('images_members_dir') . '/' . $filename; } $data['fname'] = $aff_data['fname']; $data['lname'] = $aff_data['lname']; $data['company'] = $aff_data['company']; $data['username'] = $aff_data['username']; $data['email'] = safe_mailto($aff_data['primary_email'], $this->lang->line('contact_me') , 'class="jroxProfileEmailLink"'); $data['website'] = jrox_auto_link($aff_data['website'], $this->lang->line('my_website'), 'class="jroxProfileWebsiteLink"'); $data['profile_description'] = ''; $data['show_profile_desc'] = 0; if ($this->config->item('sts_affiliate_enable_profile_description') == 1) { $data['profile_description'] = nl2br($aff_data['profile_description']); $data['show_profile_desc'] = 1; } //get currency options $num_options = get_default_currency($this->config->item('sts_store_default_currency')); //get recommended products $data['show_recommend'] = 0; $data['recommended_products'] = ''; if ($this->config->item('sts_affiliate_enable_recommended_profile') == 1) { $recommended = $this->prod->_get_recommended_products($aff_data['mid'], $num_options); if (!empty($recommended)) { $data['show_recommend'] = 1; $data['recommended_products'] = $recommended; } } $data['page_title'] = $data['layout_design_header_tag_line'] . ' - ' . $this->lang->line('profile_page'); $data['meta_keywords'] = $data['sts_store_default_keywords']; $data['meta_description'] = $data['sts_store_description']; //set the language text $data['lang_profiles'] = $this->lang->line('profiles'); $data['lang_more_info'] = $this->lang->line('more_info'); $data['lang_recommended_products'] = $this->lang->line('recommended_products'); $data['lang_delete_profile_recommended'] = $this->lang->line('delete_profile_recommended'); if (!$this->session->userdata('userid')) { //add tracking cookie if not already set $cookie_name = $this->config->item('aff_cookie_name'); if (get_cookie($cookie_name) == false) { $cid = $aff_data['mid'] . '-' . $this->config->item('jrox_site_referral'); if ($cookie = set_tracking_cookie($cid)) { //set the session data $this->session->set_userdata($cookie, serialize($aff_data)); } } } //echo '<pre>';print_r($aff_data); exit(); //echo '<pre>';print_r($recommended); exit(); $this->parser->_JROX_load_view('tpl_profile', 'profile_pages', $data); } } ?>