| 1 |
<?php |
<?php |
| 2 |
// $Id: affiliates.module,v 1.1.4.5.2.16 2009/04/16 08:53:30 paulbooker Exp $ |
// $Id: affiliates.module,v 1.1.4.5.2.17 2009/07/13 12:45:27 paulbooker Exp $ |
| 3 |
|
|
| 4 |
// Portions Copyright 2006 http://2bits.com |
// Portions Copyright 2006 http://2bits.com |
| 5 |
define ('AFFILIATE_BUTTONS_DIRECTORY_RELATIVE_FILES', '/affiliates'); |
define ('AFFILIATE_BUTTONS_DIRECTORY_RELATIVE_FILES', '/affiliates'); |
| 1092 |
print theme('page', $obj->data); |
print theme('page', $obj->data); |
| 1093 |
} |
} |
| 1094 |
|
|
| 1095 |
function affiliates_click_denied() { |
function affiliates_click_denied($uid) { |
| 1096 |
global $user; |
$account = user_load(array('uid' => $user_id)); |
| 1097 |
$denied_users = explode(",", variable_get(AFFILIATE_DENIED_USERS,'')); |
$denied_users = explode(",", variable_get(AFFILIATE_DENIED_USERS,'')); |
| 1098 |
if (in_array($user->name, $denied_users)) return TRUE; |
if (in_array($account->name, $denied_users)) return TRUE; |
| 1099 |
$ip = ip_address(); |
$ip = ip_address(); |
| 1100 |
$denied_ips = explode(",", variable_get(AFFILIATE_DENIED_IPS,'')); |
$denied_ips = explode(",", variable_get(AFFILIATE_DENIED_IPS,'')); |
| 1101 |
if (in_array($ip, $denied_ips)) return TRUE; |
if (in_array($ip, $denied_ips)) return TRUE; |
| 1115 |
$uid = (int)arg(1); |
$uid = (int)arg(1); |
| 1116 |
$ad_id = (int)arg(2); |
$ad_id = (int)arg(2); |
| 1117 |
|
|
| 1118 |
$affiliates_click_denied = affiliates_click_denied(); |
$affiliates_click_denied = affiliates_click_denied($uid); |
| 1119 |
//If there's no cookie, proceed. |
//If there's no cookie, proceed. |
| 1120 |
if (!$_COOKIE['aff']) { |
if (!$_COOKIE['aff']) { |
| 1121 |
setcookie('aff', $cookie_value, time() + 86400); |
setcookie('aff', $cookie_value, time() + 86400); |