$params->setDate(date('Y-m-d H:i:s')); $params->setRtype(@$_COOKIE['PAPCookie_Imp_'.$bannerId] == '' ? 'U' : 'R'); $params->setUserid(@$_GET[$settings->get(Lib_SettingFile::PARAM_NAME_USER_ID)]); $params->setBannerid($bannerId); $params->setParentbannerid(@$_GET[$settings->get(Lib_SettingFile::PARAM_NAME_ROTATOR_ID)]); $params->setChannel(@$_GET['chan']); $params->setIp(Lib_Server::getRemoteIp()); $params->setData1(@$_GET[$settings->get('param_name_extra_data1')]); $params->setData2(@$_GET[$settings->get('param_name_extra_data2')]); if ($settings->isOfflineImpressionProcessing()) { $settings->getDb()->saveToDb($params, 'qu_pap_impressions'. $settings->get('impTableInput')); output($bannerId); return; } require_once 'bootstrap.php'; @include_once('../include/Compiled/Impression.php'); Gpf_Session::create(new Pap_Tracking_ModuleBase(), null, false); $impression = new Pap_Db_RawImpression(0); foreach ($params->toArray() as $key => $value) { $impression->set($key, $value); } $processor = new Pap_Tracking_Impression_ImpressionProcessor(); $processor->runOnline($impression); output($bannerId); ?>
public function getParentBannerId() { return $this->rawImpression->getParentBannerId(); }
protected function importImpression(Pap_Db_RawImpression $impression, $count = 1) { $impressionContext = new Pap_Contexts_Impression($impression); try { $impressionContext->setUserObject($this->getUser($impression->getUserId())); } catch (Gpf_Exception $e) { $this->debug('Invalid user '.$impression->getUserId().'. Skipping'); return; } try { $impressionContext->setBannerObject($this->getBanner($impression->getBannerId())); } catch (Gpf_Exception $e) { $this->debug('Invalid banner '.$impression->getBannerId().'. Skipping'); return; } try { $campaign = $this->getCampaign($impressionContext->getBannerObject()->getCampaignId()); $impressionContext->setAccountId($campaign->getAccountID(), Pap_Contexts_Tracking::ACCOUNT_RECOGNIZED_FROM_CAMPAIGN); } catch (Gpf_Exception $e) { $this->debug('Invalid campaign '.$impressionContext->getBannerObject()->getCampaignId().'. Skipping'); return; } try { $impressionContext->setChannelObject($this->getChannel($impression->getChannel(), $impressionContext)); } catch (Gpf_Exception $e) { } $impressionContext->setCount($count); $this->saveImpression($impressionContext); }