0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
marketting
/
system
/
application
/
controllers
/
[
Home
]
File: track.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 - track | ------------------------------------------------------------------------- | | This controller manages ad tracking | */ class Track extends Public_Controller { function __construct() { parent::Public_Controller(); $this->config->set_item('jrox_module_type', 'tracker'); $this->load->library('user_agent'); $this->load->model('tracking_model'); } function index() { $this->db->where('id', $this->uri->segment(2)); $query = $this->db->get('tracking'); if ($query->num_rows() > 0) { $row = $query->row_array(); $referrer = $this->agent->referrer(); $insert = true; //check if we only want unique links in the db if (!empty($referrer)) { if ($this->config->item('tracker_unique_referrals_only') == true) { if ($this->tracking_model->_check_referrer($referrer) == true) { $insert = false; } } } if ($insert == true) { //insert into db $sdata = array( 'mid' => $row['mid'], 'tid' => $this->uri->segment(2), 'referrer' => $referrer, 'date' => now(), ); $this->db->insert('tracking_referrals', $sdata); $cookie = array('name' => 'jrox_tracker_id', 'value' => $this->uri->segment(2), 'expire' => 60 * 60 * 24 * $this->config->item('sts_affiliate_cookie_timer') ); //set the affiliate cookie set_cookie($cookie); } redirect_301($row['url'], true); } } } ?>