".$current_id = $_SERVER['REMOTE_ADDR']; echo "
".$current_user = $_SESSION['U']; echo "
".$current_deal = $deal['id']; echo "
".$current_date = date('Y-m-d',time()); echo "
".$r_deal_id = $rat['deal_id']; echo "
".$r_deal_ip = $rat['ip']; echo "
".$r_deal_user = $rat['userid']; echo "
".$r_deal_date = substr($rat['r_date'], 0, 10); //validate if(!empty($_SESSION['U'])){ $num1 = $SQL("$SL * $FR `deal_rating` $W `ip` = '".$current_id."' and DATE(r_date) = '".$current_date."' and userid = '".$current_user."' and `deal_id` = '".$current_deal."'"); } else { $num1 = $SQL("$SL * $FR `deal_rating` $W `ip` = '".$current_id."' and DATE(r_date) = '".$current_date."' and `deal_id` = '".$current_deal."'"); } if(mysql_num_rows($num1) == 0) { $SQL("$UD `deals` SET `outs` = outs+1 $W `id` = $_GET[deal]"); //insert rating $SQL("insert into deal_rating set userid ='".$sessionid."',deal_id ='".$_GET[deal]."',ip ='".$_SERVER['REMOTE_ADDR']."',r_date = '".date('Y-m-d H:i:s',time())."',type=2"); //assign commision if($leveld['level'] ==0 ) { if($_SESSION['affiliate']) { $postURL = "http://www.dealsdog.co.uk/blog/wp-content/plugins/wp-affiliate-platform/api/post.php"; // The Secret key (Get this value from the settings menu of this plugin) $secretKey = "52f3640a12f19"; // Retrieve the value from the browser's cookie to find out who the referrer was $affiliate_id = $_SESSION['affiliate']; $sale_amt = 1; $commision_amt = calculate_amt('wp_aff_commission_level_three',1); // Prepare the data $data3 = array (); $data3['secret'] = $secretKey; $data3['ap_id'] = $affiliate_id; $data3['sale_amt'] = $sale_amt; $data3['commition_amount'] = $commision_amt; $data3['buyer_email'] = isset($_SESSION['email'])?$_SESSION['email']:'N/A'; $data3['item_id'] = 'Ext Click'; // send data to post URL to award the commission $ch = curl_init ($postURL); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data3); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $returnValue = curl_exec ($ch); curl_close($ch); } } } } } header("Location: $deal[link]"); } else { $store = $FA($SQL("$SL url $FR `stores` INNER JOIN deals WHERE stores.id = deals.storeid AND deals.id = $_GET[deal]")); if ($store[url]) header("Location: $store[url]"); else header("Location: $HOME",TRUE,301); } } elseif ($_GET[store]) { $store = $FA($SQL("$SL url $FR `stores` $W `domain` = '$_GET[store]'")); if ($store[url]) { $SQL("$UD `stores` SET `outs` = outs+1 $W `domain` = '$_GET[store]'"); header("Location: $store[url]"); } else header("Location: $HOME",TRUE,301); } ?>