61 lines
2.0 KiB
PHP
61 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* SOTESHOP/appAdsTrackerFrontendPlugin
|
|
*
|
|
*
|
|
* @package appAdsTrackerFrontendPlugin
|
|
* @author Bartosz Alejski <bartosz.alejski@sote.pl>
|
|
*/
|
|
class appAdsTrackerFrontendComponents extends sfComponents
|
|
{
|
|
public function executeShowAdsTracker()
|
|
{
|
|
if(appAdsTracker::getIsExcludeRemoteAddress()){
|
|
return sfView::NONE;
|
|
}
|
|
|
|
$config = stConfig::getInstance($this->getContext(), 'appAdsTrackerBackend');
|
|
$config->setCulture($this->getUser()->getCulture());
|
|
$this->config = $config;
|
|
|
|
$c = new Criteria();
|
|
$c->add(AdsTrackerListPeer::IS_ACTIVE , 1);
|
|
$adsTrackerList = AdsTrackerListPeer::doSelectJoinAll($c);
|
|
|
|
if($adsTrackerList){
|
|
foreach ($adsTrackerList as $adsTracker) {
|
|
$ads_array_hash[] = $adsTracker->getHash();
|
|
$ads_array_ids[] = $adsTracker->getId();
|
|
$ads_array_path[] = $adsTracker->getAdsTrackerPlatform()->getAdsName()."/".$adsTracker->getAdsTrackerCampaign()->getAdsName();
|
|
|
|
|
|
|
|
if ($adsTracker->getAdsTrackerPlatform()->getPlatformType ()==1) {
|
|
$this->ads_direct = $adsTracker->getId();
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
$this->ads_array_hash = json_encode($ads_array_hash);
|
|
$this->ads_array_ids = json_encode($ads_array_ids);
|
|
$this->ads_array_path = json_encode($ads_array_path);
|
|
$this->ads_hash_control = $config->get('hash_control');
|
|
|
|
|
|
|
|
|
|
// echo "<pre>";
|
|
// print_r($ads_array_hash);
|
|
// echo "</pre>";
|
|
//
|
|
// echo "<pre>";
|
|
// print_r($ads_array_ids);
|
|
// echo "</pre>";
|
|
//
|
|
// die();
|
|
|
|
}
|
|
|
|
} |