예제 #1
0
if ($query = mysql_query($sql)) {
    $x = 1;
    //Voor elke gevonden title
    while ($row = mysql_fetch_array($query)) {
        //Laat wat info zien
        echo "Rij {$x}: ID van title: " . $row['uid'] . " Qid: " . $row['quid'] . "\nQuery: " . $row['query'] . " \nREGEXP : " . addslashes(make_regexp($row['query'])) . "\n";
        if (make_regexp($row['query'])) {
            //Maak een zoek opdracht aan om te kijken of er links zijn die matchen aan titles
            $sql_link = 'SELECT
                title,hostname,uid,link
            FROM
                links_forum
            WHERE
                title LIKE "%' . addslashes($row['titleName']) . '%"
            AND
                title REGEXP "' . addslashes(make_regexp($row['query'])) . '"
            AND
                hostname IN (SELECT  `url` FROM  `filehoster` WHERE  `black` =  "off")
            AND
               `match` = 0
               ';
            //Als er - query aan wezig zijn voeg die dan ook doe
            if ($min_keys = min_keys(addslashes($row['query']))) {
                $sql_link .= "\n            AND\n                title NOT IN ('" . $min_keys . "')";
            }
            //Voer de query uit voor het vergelijken
            if ($query_link = mysql_query($sql_link)) {
                $y = 1;
                //Voor elke gevodnen link
                while ($link = mysql_fetch_array($query_link)) {
                    //Haal id van de filehoster op
예제 #2
0
        exit('Er gata iets fout');
    }
}
function min_keys($q)
{
    //De - keys op halen
    $arr = explode(' -', $q);
    unset($arr[0]);
    if (empty($arr)) {
        return false;
    } else {
        $not_in = '"%';
        $not_in .= implode('%","%', $arr);
        $not_in .= '%"';
        return $not_in;
    }
}
function getInnerSubstring($string, $delim)
{
    // "foo a foo" becomes: array(""," a ","")
    $string = explode($delim, $string, 3);
    // also, we only need 2 items at most
    // we check whether the 2nd is set and return it, otherwise we return an empty string
    return isset($string[1]) ? $string[1] : '';
}
//$q = '(intitle:"A Lady Christmas" AND intitle:"A LADY X-MAS") AND intitle:"2012" ';
//$q = '(intitle:"Egberts-Koolstra" AND intitle:"Route 2f, Nederlands 4 Erop Of Eronder") AND (intitle:"ebook" OR intitle:"e-book" OR intitle:"eboek" OR intitle:"e-boek" OR intitle:"epub" OR intitle:"mobi" OR intitle:"boek" OR intitle:"book") ';
//$q = ' intitle:"Kolen" AND intitle:"A Biographical Approach To Landscape" AND (intitle:"ebook" OR intitle:"e-book" OR intitle:"eboek" OR intitle:"e-boek" OR intitle:"epub" OR intitle:"mobi" OR intitle:"boek" OR intitle:"book")';
$q = '(intitle:"Genuine" AND intitle:"Ehsan")';
print_r(make_regexp($q));