0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: reps.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 - reps.php | ------------------------------------------------------------------------- | | This controller file is used to generate replication pages | */ class Reps extends Public_Controller { var $username; var $replication_page; function __construct() { parent::Public_Controller(); //load css body style $this->config->set_item('css_body', 'jroxReps'); //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->username = $this->uri->segment(2); $this->replication_page = $this->uri->segment(3); } function index() { redirect(); } // ------------------------------------------------------------------------ function id() { if ($this->config->item('sts_affiliate_enable_replication') == 0) { redirect_301(); exit(); } //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; } //check for valid affiliate user $aff_data = $this->aff->_validate_user($this->username); if (empty($aff_data)) { redirect_301(); exit(); } else { foreach ($aff_data as $key => $val) { $data['replication_' . $key] = $val; } $data['replication_member_id'] = $data['replication_mid']; //get sponsor info if ($this->config->item('sts_affiliate_link_type') == 'replicated_site') { //insert the tracking data $sdata = array('date' => _generate_timestamp(), 'member_id' => $aff_data['mid'], 'tool_type' => '', 'tool_id' => '', 'referrer' => $this->agent->referrer(), 'ip_address' => $this->input->ip_address(), 'user_agent' => $this->agent->agent_string(), 'os' => $this->agent->platform(), 'browser' => $this->agent->browser(), 'isp' => gethostbyaddr($this->input->ip_address()), ); $this->aff->_insert_affiliate_traffic($sdata); } } $data['page_title'] = $data['layout_design_header_tag_line']; $data['meta_keywords'] = $data['sts_store_default_keywords']; $data['meta_description'] = $data['sts_store_description']; //format the affiliate data //check for image $data['replication_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['replication_sponsor_image'] = base_url() . 'images/' . $this->config->item('images_members_dir') . '/' . $filename; } $data['replication_safe_email'] = safe_mailto($aff_data['primary_email'], $this->lang->line('replication_contact_me') , 'class="jroxReplicationSafeMail" id="jroxReplicationSafeMail"'); //get the affiliate link $data['replication_affiliate_link'] = _get_aff_link($aff_data['username']); //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'] . '-' . $aff_data['username'] . '-0-0'; if ($cookie = set_tracking_cookie($cid)) { //set the session data $this->session->set_userdata($cookie, serialize($aff_data)); $this->session->set_userdata('jrox_site_referral_regular', $cookie); } } if ($this->replication_page == false) { $this->replication_page = 'index'; } $show_header = $this->config->item('sts_affiliate_replication_enable_header_footer') == 1 ? true : false; $this->parser->_JROX_load_view('replication/' . $this->replication_page, 'none', $data, $show_header, $show_header); } } ?>