/[drupal]/contributions/modules/affiliates/affiliates.module
ViewVC logotype

Diff of /contributions/modules/affiliates/affiliates.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.5.2.17, Mon Jul 13 12:45:27 2009 UTC revision 1.1.4.5.2.18, Mon Jul 20 16:17:12 2009 UTC
# Line 1  Line 1 
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');
# Line 1092  function affiliates_top_climbers() { Line 1092  function affiliates_top_climbers() {
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;
# Line 1115  function affiliates_click() { Line 1115  function affiliates_click() {
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);

Legend:
Removed from v.1.1.4.5.2.17  
changed lines
  Added in v.1.1.4.5.2.18

  ViewVC Help
Powered by ViewVC 1.1.2