Advertisement
johnburn

Untitled

Jul 25th, 2011
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.76 KB | None | 0 0
  1. <?php
  2. /*
  3. * Gay script ;D
  4. *
  5. */
  6.  
  7. $page = 0;
  8. $set = 0;
  9. $link = 0;
  10. $split = 0;
  11. $split_redirect = 0;
  12. $custom = 0;
  13. $url = null;
  14. $id = 0;
  15. include ("API/config.php");
  16. include ("includes/validation_functions.php");
  17. if (isset($_REQUEST['id'])) {
  18.     $id = quote_smart($_REQUEST['id']);
  19. } else {
  20.     $id = 0;
  21. }
  22. if (isset($_REQUEST['idevcustom'])) {
  23.     $idevcustom = quote_smart($_REQUEST['idevcustom']);
  24. } else {
  25.     $idevcustom = null;
  26. }
  27. if (isset($_REQUEST['url'])) {
  28.     $url = quote_smart($_REQUEST['url']);
  29. } else {
  30.     $url = null;
  31. }
  32. if (isset($_REQUEST['ip_address'])) {
  33.     $ip_addr = quote_smart($_REQUEST['ip_address']);
  34. }
  35. if (isset($_REQUEST['id'])) {
  36.     if (!$tlinks && $second_tier == 1) {
  37.         $checkref = mysql_query("select ta, ti from idevaff_tlog where ta = '{$id}' and ti = '{$ip_addr}'");
  38.         if (!mysql_num_rows($checkref)) {
  39.             mysql_query("insert into idevaff_tlog (ta, ti) values ('{$id}', '{$ip_addr}')");
  40.         }
  41.     }
  42.     $incoming_data = explode("_", $id);
  43.     if (isset($incoming_data[0])) {
  44.         $id = $incoming_data[0];
  45.     }
  46.     if (isset($incoming_data[1])) {
  47.         $page = $incoming_data[1];
  48.     }
  49.     if (isset($incoming_data[2])) {
  50.         $set = $incoming_data[2];
  51.     }
  52.     if (isset($incoming_data[3])) {
  53.         $link = $incoming_data[3];
  54.     }
  55.     if (isset($incoming_data[4])) {
  56.         $split = $incoming_data[4];
  57.     }
  58.     if (isset($incoming_data[5])) {
  59.         $split_redirect = $incoming_data[5];
  60.     }
  61.     if (isset($_REQUEST['page'])) {
  62.         $page = $_REQUEST['page'];
  63.     }
  64.     if (isset($_REQUEST['set'])) {
  65.         $set = $_REQUEST['set'];
  66.     }
  67.     if (isset($_REQUEST['link'])) {
  68.         $link = $_REQUEST['link'];
  69.     }
  70.     if ($set == 1) {
  71.         $table = "banners";
  72.         $col = "number";
  73.     }
  74.     if ($set == 2) {
  75.         $table = "ads";
  76.         $col = "id";
  77.     }
  78.     if ($set == 3) {
  79.         $table = "links";
  80.         $col = "id";
  81.     }
  82.     if ($set == 4) {
  83.         $table = "htmlads";
  84.         $col = "id";
  85.     }
  86.     if ($set == 5) {
  87.         $table = "email_templates";
  88.         $col = "id";
  89.     }
  90.     if ($set == 6) {
  91.         $table = "peels";
  92.         $col = "number";
  93.     }
  94.     if ($set == 7) {
  95.         $table = "lightboxes";
  96.         $col = "number";
  97.     }
  98.     if (isset($_REQUEST['keyword'])) {
  99.         $split = $_REQUEST['keyword'];
  100.     }
  101.     if (isset($_REQUEST['custom'])) {
  102.         $custom = $_REQUEST['custom'];
  103.     }
  104.     if (isset($_REQUEST['url'])) {
  105.         $split_redirect = $_REQUEST['url'];
  106.     }
  107.     include ("includes/validate_sub.php");
  108.     include ("includes/validate_tids.php");
  109.     include ("includes/redirect_page.php");
  110.     $idchk = mysql_query("select id from idevaff_affiliates where id = '{$id}'");
  111.     if (mysql_num_rows($idchk) && $id != 0) {
  112.         $itime = date("g:ia");
  113.         $idate = date("m-d-y");
  114.         $time_now = time();
  115.         if (isset($_GET['clickref'])) {
  116.             $curl = $_GET['clickref'];
  117.         }
  118.         $cookiedata = $id . "-" . $curl . "-" . $set . "-" . $link . "-" . $split . "-" . $sub_id . "-" . $tid1 . "-" . $tid2 . "-" . $tid3 . "-" . $tid4 . "-" . $redirect;
  119.         $checkip = mysql_query("select stamp from idevaff_iptracking where acct_id = '{$id}' and ip = '{$ip_addr}' order by id DESC");
  120.         if (mysql_num_rows($checkip)) {
  121.             $checkip = mysql_fetch_array($checkip);
  122.             $stamp = $checkip['stamp'];
  123.             $diff = $time_now - $stamp;
  124.             if ($ex3 <= $diff) {
  125.                 if (isset($_GET['curlad'])) {
  126.                     $curl = $_GET['curlad'];
  127.                 }
  128.                 setcookie("idev", "", time() - $ex3, "/", "{$cookie_url}", 0);
  129.                 setcookie("idev", "{$cookiedata}", time() + $ex3, "/", "{$cookie_url}", 0);
  130.                 mysql_query("insert into idevaff_iptracking (acct_id, ip, refer, stamp, hit_time, hit_date, src1, src2, split, sub_id, tid1, tid2, tid3, tid4, target_url) values ('{$id}', '{$ip_addr}', '{$curl}', '{$time_now}', '{$itime}', '{$idate}', '{$set}', '{$link}', '{$split}', '{$sub_id}', '{$tid1}', '{$tid2}', '{$tid3}', '{$tid4}', '{$redirect}')");
  131.                 if ($set) {
  132.                     mysql_query("update idevaff_{$table} set hits = hits+1 where {$col} = {$link}");
  133.                 }
  134.             }
  135.             $idev_credit = 0;
  136.         } else {
  137.             $idev_credit = 1;
  138.             if (isset($_GET['curlad'])) {
  139.                 $curl = $_GET['curlad'];
  140.             }
  141.             setcookie("idev", "{$cookiedata}", time() + $ex3, "/", "{$cookie_url}", 0);
  142.             mysql_query("insert into idevaff_iptracking (acct_id, ip, refer, stamp, hit_time, hit_date, src1, src2, split, sub_id, tid1, tid2, tid3, tid4, target_url) values ('{$id}', '{$ip_addr}', '{$curl}', '{$time_now}', '{$itime}', '{$idate}', '{$set}', '{$link}', '{$split}', '{$sub_id}', '{$tid1}', '{$tid2}', '{$tid3}', '{$tid4}', '{$redirect}')");
  143.             if ($set) {
  144.                 mysql_query("update idevaff_{$table} set hits = hits+1 where {$col} = {$link}");
  145.             }
  146.         }
  147.         mysql_query("update idevaff_affiliates set hits_in = hits_in+1 where id = '{$id}'");
  148.         $getpaylevel = mysql_query("select type, level from idevaff_affiliates where id = '{$id}'");
  149.         $paylevel = mysql_fetch_array($getpaylevel);
  150.         $type = $paylevel['type'];
  151.         $level = $paylevel['level'];
  152.         $getpayamount = mysql_query("select amt from idevaff_paylevels where type = '{$type}' and level = '{$level}'");
  153.         $payamount = mysql_fetch_array($getpayamount);
  154.         $payout = $payamount['amt'];
  155.         $app_check = "sale_approval_{$type}";
  156.         if ($type == 3 && $idev_credit == 1) {
  157.             include ("includes/click.php");
  158.         }
  159.     }
  160.     include ("includes/redirect.php");
  161. }
  162. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement