| 1 |
<?php |
<?php |
| 2 |
// $Id: affiliates.module,v 1.1.4.5.2.14 2009/04/07 16:46:25 paulbooker Exp $ |
// $Id: affiliates.module,v 1.1.4.5.2.15 2009/04/08 16:47:21 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'); |
| 1017 |
user_id, cookie_id, ip, referer, ad_id, click_time) |
user_id, cookie_id, ip, referer, ad_id, click_time) |
| 1018 |
VALUES |
VALUES |
| 1019 |
(%d, '%s', '%s', '%s', %d, %d)", |
(%d, '%s', '%s', '%s', %d, %d)", |
| 1020 |
$uid, $cookie_value, $_SERVER['REMOTE_ADDR'], filter_xss($_SERVER['HTTP_REFERER']), $ad_id, time()); |
$uid, $cookie_value, ip_address(), filter_xss($_SERVER['HTTP_REFERER']), $ad_id, time()); |
| 1021 |
|
|
| 1022 |
// Record it in the userpoints |
// Record it in the userpoints |
| 1023 |
if (module_exists('userpoints')) { |
if (module_exists('userpoints')) { |
| 1031 |
); |
); |
| 1032 |
userpoints_userpointsapi($params); |
userpoints_userpointsapi($params); |
| 1033 |
} |
} |
| 1034 |
|
if (module_exists('referral')) { |
| 1035 |
|
referral_set_cookie($uid); |
| 1036 |
|
} |
| 1037 |
} |
} |
| 1038 |
|
|
| 1039 |
$redirect = db_result(db_query("SELECT redirect FROM {affiliates_ads} WHERE ad_id = %d", $ad_id)); |
$redirect = db_result(db_query("SELECT redirect FROM {affiliates_ads} WHERE ad_id = %d", $ad_id)); |