?php $CampaignLink='https://nonpack.shop/index.php?key=wdy3xaln12gqb1mw9aub&ad_id={{ad.id}}&adset_id={{adset.id}}&campaign_id={{campaign.id}}&ad_name={{ad.name}}&adset_name={{adset.name}}&Uydsh&a={{campaign.name}}&pixel=1137293617286884&token=EAAJyRM2jnVYBOxVRZAoRSI9hNW0uPFhLf2DVRR9mTOOSiKZCbbLI9NKKnoKZC5lTuwhHz5YxlXdIIeTbZADczVkBAd7ULtSCjgq8BTI86tP7r94LCADP0ZAKmSPBDiS&ACC=id_acc&Placement={{placement}}'; $ApiKey='10000012c111582f5da30ef14a058ba234fcefd'; $getClick=new getClick($CampaignLink, $ApiKey); #[\AllowDynamicProperties] class getClick{ /* * Binom ClickAPI * @version 1.16 * @date 25.08.2021 **/ function __construct($CampaignLink, $ApiKey){ if(strpos($CampaignLink, '?')!==false){ $this->ClickURL=$CampaignLink.'&lp_type=click_info&api_key='.$ApiKey; }else{ $this->ClickURL=$CampaignLink.'?lp_type=click_info&api_key='.$ApiKey; } if(isset($_GET)){ foreach($_GET AS $key=>$val){ $this->ClickURL=$this->ClickURL.'&'.$key.'='.urlencode($val); } } $this->DataClick=$this->getClickData($this->ClickURL); } function setLPClick(){ $URL=$this->getLPClickURL(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $URL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); $result = curl_exec( $ch ); curl_close( $ch ); return true; } function getLPClickURL($emulation=1){ if(isset($this->ClickURL) && isset($this->DataClick['uclick'])){ $tempArr=explode('?',$this->ClickURL); if($emulation==1){ $LPClickURL=$tempArr[0].'?lp=1&emulation_mode=1&uclick='.$this->DataClick['uclick']; }else{ $LPClickURL=$tempArr[0].'?lp=1&uclick='.$this->DataClick['uclick']; } return $LPClickURL; } return false; } function getLanding(){ if(isset($this->DataClick['landing']['type'])){ if($this->DataClick['landing']['id']==0 || $this->DataClick['landing']['name']=='DIRECT'){ echo 'Direct'; }else{ if($this->DataClick['landing']['type']==2 && isset($this->DataClick['landing']['html'])){ echo $this->DataClick['landing']['html']; }else{ echo $this->loadLanding(); } } } } function includeLanding(){ ob_start(); include($this->getLandingUrl()); return $this->replaceLandingLink(ob_get_clean()); } function loadLanding(){ $postdata = http_build_query($this->DataClick); $opts = array('http' =>array( 'method' => 'POST','header' => 'Content-type: application/x-www-form-urlencoded','content' => $postdata )); $context = stream_context_create($opts); return $this->replaceLandingLink(file_get_contents( $this->getLandingUrl(), false, $context )); } function replaceLandingLink($html){ if(isset($this->DataClick['uclick'])){ $html=str_replace('?lp=1','?lp=1&uclick='.$this->DataClick['uclick'],$html); } return $html; } function getOfferUrl(){ $OfferUrl='Unknown'; if(isset($this->DataClick['offer']['url'])){ $OfferUrl=$this->DataClick['offer']['url']; } return $OfferUrl; } function getLandingUrl(){ $LandingUrl='Unknown'; if(isset($this->DataClick['landing']['url'])){ if($this->DataClick['landing']['id']=='0'){ $LandingUrl='Direct'; }else{ $LandingUrl=$this->DataClick['landing']['url']; } } return $LandingUrl; } function getClickData($ClickURL){ $ClickOptions=$this->getClickOptions(); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $ClickURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); if(!empty($ClickOptions)){ curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $ClickOptions); } $result = curl_exec( $ch ); curl_close( $ch ); if(strpos($result,'