0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
affiliates_8mor
/
[
Home
]
File: randomaff.php
<?php ##################################################################################### ## JROX.COM Affiliate Manager - randomaff.php file ## Version 1.6.2 ## ## Author: Ryan Roxas(ryan@jrox.com) ## Homepage: http://jam.jrox.com ## Bug Reports: http://jam.jrox.com/bugzilla/ ## Release Notes: docs/READ_ME.txt ####################################################################################### ####################################################################################### ## COPYRIGHT NOTICE ## Copyright 2007 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. ####################################################################################### #################################################################################### ## This file is used to set an affiliate cookie if no affiliate cookie exists ## #################################################################################### require_once 'includes/common.php'; require_once 'includes/setlang.php'; require HOME_BASE_DIRECTORY.'/includes/mod/mod_members.php'; if (DEBUG_ADVANCED_ERROR == true) { error_reporting(E_ALL); } else { error_reporting(0); } ########################################## ## DO NOT EDIT ANYTHING BELOW THIS LINE ## ########################################## if (empty($_COOKIE['jrox'])) { Db_Connect(); $query = mysql_query("SELECT mid FROM jx_members WHERE status = 'active' ORDER BY RAND() LIMIT 1") or die(cmysql_error(__LINE__, __FILE__)); if ($query) { if (mysql_num_rows($query) > 0) { $q = mysql_fetch_row($query); $mid = $q[0]; $timer_check = mysql_query("SELECT cookie_date_value, cookie_date_type FROM jx_settings") or die(cmysql_error(__LINE__, __FILE__)); $timer_row = mysql_fetch_assoc($timer_check); extract($timer_row); if(!empty($_SERVER['HTTP_REFERER'])) { $ref_site = $_SERVER['HTTP_REFERER']; } else { $ref_site = ROW_UNKNOWN; } //CALCULATE COOKIE TIMER switch ($cookie_date_type) { case "day": $cookie_expires = $cookie_date_value * 60 * 60 * 24; break; case "week": $cookie_expires = $cookie_date_value * 60 * 60 * 24 * 7; break; case "month": $cookie_expires = $cookie_date_value * 60 * 60 * 24 * 30; break; case "year": $cookie_expires = $cookie_date_value * 60 * 60 * 24 * 365; break; } $cookie_domain = ".".COOKIE_DOMAIN; if (!empty($program_id) AND is_numeric($program_id)) { $pid = $program_id; } elseif (!empty($_GET['program_id']) AND is_numeric($_GET['program_id'])) { $pid = $_GET['pid']; } else { $pid = 1; } //CHECK IF PID IS VALID if ($pid != 1) { $query = mysql_query("SELECT * FROM jx_products WHERE pid = '$pid'") or die(cmysql_error(__LINE__, __FILE__)); if (mysql_num_rows($query) != 1) { exit(); } } $cookie_id = urlencode($mid."###".$pid."###0###0"."###".$ref_site); setcookie("jrox", $cookie_id, time()+$cookie_expires,"/", $cookie_domain); } } } ?>