Hirdetés

Keresés

Új hozzászólás Aktív témák

  • disy68

    aktív tag

    válasz radi8tor #19711 üzenetére

    function areWeInIgnoredUrl() {
    if (basename(DIR_APPLICATION) != 'catalog') return true;

    $url = getFullURL();

    $ignoredUrls = getIgnoredUrls();

    foreach ($ignoredUrls as $ignoredUrl) {
    $ignoredUrl = preg_replace("/^(https?:)?\/\//", "*", $ignoredUrl);

    if ($ignoredUrl[0] != '!') {
    if (preg_match('~' . str_replace(array('~', '#asterisk#'), array('\~', '.*'), preg_quote(str_replace('*', '#asterisk#', $ignoredUrl))) . '~', $url)) {
    return false; // true;
    }
    } else {
    if (!preg_match('~' . str_replace(array('~', '#asterisk#'), array('\~', '.*'), preg_quote(str_replace('*', '#asterisk#', substr($ignoredUrl, 1)))) . '~', $url)) {
    return false; //true ;
    }
    }
    }

    return false;// true;
    }

    szerintem a fentire gondolt
    de lehet ott is negálni, ahol használod

    if (!areWeInIgnoredUrl()) {
    //logic
    }

    vagy beburkolod és negálod

    function areWeInEnabledUrl() {
    return !areWeInIgnoredUrl();
    }

Új hozzászólás Aktív témák