コード例 #1
0
function UpdateStats()
{
    global $Logs, $Lang;
    $Query = "\n\t\tSELECT RS.*, R.REFERER\n\t\t\tFROM " . PFX . "_tracker_referer_set RS\n\t\t\tINNER JOIN " . PFX . "_tracker_referer R\n\t\t\t\tON R.ID=RS.REFERER_ID\n\t\tWHERE (RS.HOST_ID=0 OR RS.NATURAL_KEY=0) AND PROCESSED='0'\n\t";
    $Set = new Query($Query);
    $Count = 0;
    $Cnt = 0;
    while ($RefSet = $Set->Row()) {
        $Cnt++;
        $RefArr = PreparePathAddr($RefSet->REFERER);
        if (!ValidArr($RefArr)) {
            continue;
        }
        $HostObj = GetRefHost($RefArr['host']);
        if (!ValidId($HostObj->ID)) {
            continue;
        }
        $Res = RefSetUpdate($RefSet->ID, $RefArr, $RefSet->REFERER_ID, $HostObj);
        if ($Res) {
            $Count++;
        }
    }
    $Logs->Msg(str_replace("{CNT}", "<B>{$Count}</B>", $Lang['Updated']));
}
コード例 #2
0
    }
    if (ValidId($DeletePage) && ValidId($EditId)) {
        DelPageFromSplit($DeletePage);
    }
}
/////////////////////////////////////////////
///////// display section here
if (ValidVar($NewPage) && ValidId($EditId)) {
    $PageSiteId = 0;
    $CompanySiteCnt = 0;
    $SiteIdCnt = 0;
    $CheckArr = parse_url($NewPage);
    if (!ValidVar($CheckArr['scheme'])) {
        $NewPage = "http://" . $NewPage;
    }
    $NewPageArr = PreparePathAddr($NewPage);
    if ($NewPageArr === false) {
        $Logs->Err(str_replace("{ADDR}", $NewPage, $Lang['UnableToParse']));
    } else {
        if (strpos($NewPageArr['query'], "ns_skip") !== false) {
            $NewPageArr['query'] = preg_replace("/ns_skip=[^&]*/", "", $NewPageArr['query']);
        }
        if (!$AddToSite) {
            $Query = "\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tCOUNT( DISTINCT SH.SITE_ID) \n\t\t\t\t\tFROM " . PFX . "_tracker_site_host SH\n\t\t\t\t\t\tINNER JOIN " . PFX . "_tracker_site S \n\t\t\t\t\t\t\tON S.ID=SH.SITE_ID\n\t\t\t\t\tWHERE SH.HOST = '" . escape_string($NewPageArr['host']) . "' AND S.COMPANY_ID={$CompId}\n\t\t\t\t";
            $SiteIdCnt = $Db->ReturnValue($Query);
            $CompanySiteCnt = $Db->ReturnValue("SELECT COUNT(ID) FROM " . PFX . "_tracker_site WHERE COMPANY_ID={$CompId}");
            $PageSiteId = $Db->ReturnValue("SELECT SITE_ID FROM " . PFX . "_tracker_site_host WHERE HOST = '" . escape_string($NewPageArr['host']) . "'");
        } else {
            $Query = "SELECT ID FROM " . PFX . "_tracker_site_host WHERE HOST = '" . escape_string($NewPageArr['host']) . "' AND SITE_ID={$AddToSite}";
            $CheckId = $Db->ReturnValue($Query);
            if (!$CheckId) {