} $GetVars = NS_TRACK_QUERY::ParseTemplate(NS_TRACK_MISC::ValidVar($CurrentPageArr['query'])); $Skip = NS_TRACK_MISC::ValidId($GetVars['ns_skip']) ? true : false; if ($Skip) { return NS_TRACK_GENERAL::FinishTracking(); } $ClickSubId = NS_TRACK_MISC::ValidId($GetVars[$VarCamp]) ? $GetVars[$VarCamp] : 0; if (!$ClickSubId) { $ClickSubId = NS_TRACK_CAMPAIGN::GetCampaignBySrc(NS_TRACK_MISC::ValidVar($GetVars[$VarCampSource])); } $KeyId = NS_TRACK_MISC::ValidId($GetVars[$VarKeyword]) ? $GetVars[$VarKeyword] : 0; $Keyword = NS_TRACK_MISC::ValidVar($GetVars[$VarKw]) ? $GetVars[$VarKw] : false; if ($Keyword) { $KeyId = NS_TRACK_REFERER::GetKeywordId($Keyword); } $RefSet = NS_TRACK_REFERER::GetRefererSet($RefPageArr, $Ref); $QueryId = NS_TRACK_QUERY::GetQueryId($CurrentPageArr['query']); $Actions = NS_TRACK_ACTION::GetActionIds($PageId, $CurrentPageArr); if (!$KeepNoRef && $RefSet == 0 && !NS_TRACK_MISC::ValidId($_COOKIE['ns_log']) && $ClickSubId != 0) { $Skip = true; } if ($Skip) { return NS_TRACK_GENERAL::FinishTracking(); } if ($NoDblPageLoad) { NS_TRACK_GENERAL::CheckPathDblClick(); } if ($NoDblAdvClick) { NS_TRACK_GENERAL::CheckAdvDblClick(); } if ($Skip) {
function GetRefHost($Host = false) { global $_NS_TRACK_VARS; $Db =& $_NS_TRACK_VARS['Db']; $Query = "\n\t\tSELECT \n\t\t\tTH.ID, TH.KEY_VAR, TH.BAN,\n\t\t\tTHG.KEY_VAR AS GKEY, THG.BAN AS GBAN\n\t\t\tFROM " . NS_DB_PFX . "_tracker_host TH\n\t\t\t\tLEFT JOIN " . NS_DB_PFX . "_tracker_host_grp THG\n\t\t\t\t\tON THG.ID=TH.GRP_ID\n\t\t\tWHERE TH.HOST = '{$Host}'\n\t"; $RefObj = $Db->Select($Query); if (!$RefObj->ID) { NS_TRACK_REFERER::NewHost($Host); return NS_TRACK_REFERER::GetRefHost($Host); } if ($RefObj->BAN || $RefObj->GBAN) { return 0; } if ($RefObj->GKEY) { $RefObj->KEY_VAR = $RefObj->GKEY; } return $RefObj; }