Ejemplo n.º 1
0
function Article2007($Title = '', $Legend = 'button', $Bla = '', $short = '', $sup = '', $sup2 = '', $liens = '')
{
    if ($liens) {
        $liens = explode("\n", trim($liens));
        foreach ($liens as $v) {
            $sup2 .= handle_url_tag($v) . ", ";
        }
    }
    $x = sql5("select sql_cache(keyword)from CSF where url='" . addslashes(u) . "' order by hits desc limit 0,30", 'no=1');
    if ($x) {
        foreach ($x as $t) {
            $kw .= blod($t['keyword']) . " ";
        }
    }
    #if(j9)Die("$Title<li>$Legend<li>$Bla<li>$short<li>$sup<li>$sup2<li>$liens");
    $z = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><TITLE>{$Title}</TITLE><META name='description' content='{$Title}'><link type='text/css' rel='stylesheet' href='/?css'><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><script src='/js.js'></script><link rel='canonical' href='" . surl . "'></HEAD><BODY>{$GLOBALS['pp']}";
    if (strlen($Bla) > 10) {
        $z .= "<div id=seo5>{$kw}</div><fieldset class=Mk1><LEGEND>{$Legend}</LEGEND><div class=Mk2><textarea id=Mk3>";
        if ($short) {
            $z .= "</textarea><style>#Mk3{display:none}</style><div>{$Bla}</div>{$sup2}</fieldset></div></body></html>";
        } else {
            $z .= "{$Bla}</textarea>{$sup2}</fieldset></div></body></html>";
        }
    }
    return $z . "<script src='http://www.google-analytics.com/ga.js'></script><script>try{var pageTracker=_gat._getTracker('" . $GLOBALS['ga'] . "');pageTracker._initData();pageTracker._trackPageview();}catch(e){}s7x();</script>";
}
Ejemplo n.º 2
0
function UnikData($data = '', $db = 'titre', $size = 10)
{
    $res = '';
    $sup = $_ENV['ksup'];
    $s[] = "origindata:" . $data;
    if (RS == 404) {
        return;
    }
    if (!isgoodurl() or preg_match("~url.data:|image/png;|base64|/(adtech|iframeproxy)~", U) or e(',badurl', 1)) {
        return;
    }
    static $trig;
    if (!$trig) {
        Gt('unikdata:start');
        $trig = 1;
    }
    #Returns only unique Array Data ! For Titles + descriptions (1Mo + 13ms)
    if (strpos(u3, '.jpg')) {
        return;
    }
    $rev = 1342976292;
    Gt('udata');
    $u = $db . ':' . hu3;
    #Maj
    if ($y = param($data, '&')) {
        extract($y);
    }
    #extraction paramètres ...?
    $origin = Rem($data, CLT(surl));
    $data = trim(str_replace(array('»', 'Â', '£', 'N%253BO=D'), ' ', $data), '!?»,. ');
    if (!$_ENV['auth']) {
        $u = Preg_Replace("~(#|\\?|&).*~", '', $u);
    } else {
        $u = Preg_Replace("~[#|\\?|&][^(&|\\?)" . $_ENV['auth'] . "]+~", '', $u);
    }
    #!genius!really nice syntax-"~(#|\?|&)[^(".$_ENV['auth'].")].*~"
    while (strlen($data) < $size && $sup) {
        $next = Array_shift($sup);
        if (!stripos($data, $next)) {
            $data .= ' ' . $next;
        }
    }
    #push ksup inside
    if (strpos(SURL, '?', 0)) {
        Preg_match_all("~=([^&]+)~is", SURL, $t);
        if ($t) {
            $t = $t[1];
            $data .= ' ' . implode(' ', $t);
        }
    }
    #si titre similaire, pusher le query string
    $ret = $data;
    #av("data:$data db:$db ret:$ret".pre($s));
    ###Si pas de résultats : invalider le record en placant un "1" dessus
    if (1 or H == 'a74.fr') {
        $arg = 'no=1,bd=' . sip;
        $prev = array();
        #previously db -> comes to mysql  unikdata:id,url,db,data,score
        #CREATE TABLE `unikdata`(`id` INT(8) NOT NULL AUTO_INCREMENT PRIMARY KEY,`url` VARCHAR(255) NOT NULL,`data` TEXT NOT NULL,`score` INT(5) NOT NULL) ENGINE = MYISAM;#`db` VARCHAR(25) NOT NULL,
        $s[] = "select sql_cache data from " . DB . ".unikdata where url=\"{$u}\"";
        $x = sql5(['cache' => 1, 'sql' => end($s)], "bd=" . sip) or $noexist = 1;
        #if(strpos(U,'webcam.php')){print_r(compact('y','s','u','x'));die;}
        $s[] = "result:" . count($x) . "/" . $x . "/data:" . $data;
        if ($x == $data) {
            return $data;
        } else {
            #on défini le score puis On recherche si des correspondances existent déjà
            if (!Q && e('tprio,forcetitre', 1)) {
                $score[$u] = 0;
            } else {
                $score[$u] = substr_count(u, '/') * 20 + substr_count(u, '?') * 10 + substr_count(u, '&') * 10 + strlen(u);
            }
            /*Score de lui même*/
            $datas[$u] = $data;
            $s[] = "select sql_cache url,score from " . DB . ".unikdata where data=\"{$data}\" and url<>\"{$u}\" and left(url,6) rlike'{$db}:" . H . ".*' order by score asc";
            $y = sql5(['cache' => 1, 'sql' => end($s)], $arg);
            /*
            select * from ben.unikdata where url='titre:a74.fr/z/webcam.php';
            select sql_cache url,score from ben.unikdata where data="Webcams Ski Haute Savoie" and url<>"titre:a74.fr/z/webcam.php" and left(url,6) rlike'titre:a74.fr.*' order by score asc
            insert into ben.unikdata(url,data,score)VALUES("titre:a74.fr/z/webcam.php","Webcams Ski Haute Savoie","32")
            */
            #Si une ou plusieurs Pages have the same results
            if ($y) {
                if (!is_array($y)) {
                    $y = [$y];
                }
                foreach ($y as $t) {
                    $score[$t['url']] = $t['score'];
                    $datas[$t['url']] = $data;
                }
            }
            if (count($score) == 1) {
                if ($noexist) {
                    return $data;
                    $s[] = "insert ignore into " . DB . ".unikdata(url,data,score)VALUES(\"{$u}\",\"{$data}\",\"{$score[$u]}\")";
                    sql5(end($s), $arg);
                } else {
                    return $data;
                    $s[] = "update " . DB . ".unikdata set data=\"{$data}\",score=\"{$score[$u]}\" where url=\"{$u}\"";
                    $x = sql5(end($s), $arg);
                }
                #Non car le score est unique !
                #if($db=='titre')DbM('unikdata',surl."<li>db?$db / ".hu3."->$data<li>noexist?$noexist<li>sql:".pre($s)."<li>score:".pre($score)."<li>datas:".pre($datas)."<li>res:".pre($res)."<li>GT:".pre($_ENV['dbt']),1);
                return $data;
            } else {
                #si plusieurs résultats pour mêmes données, il peut exister des similarités ..
                $s[] = "select sql_cache url,data,score from " . DB . ".unikdata where data rlike(\"{$data}*\") and url rlike'{$db}:" . H . ".*' and url<>\"{$u}\" order by score asc";
                $y = sql5(['cache' => 1, 'sql' => end($s)], $arg);
                #les autres résultats proches, on s'en tape !
                if ($y) {
                    foreach ($y as $t) {
                        $score[$t['url']] = $t['score'];
                        $datas[$t['url']] = $t['data'];
                    }
                }
                Asort($score);
                foreach ($score as $url => $v) {
                    #calcul des doublons et population de la matrice des résultats
                    $n = 0;
                    $t2 = $temp = $datas[$url];
                    while (in_Array(accents(strtolower($t2)), $prev) && $n < 20) {
                        #déjà un doublon de score inférieur - 20 opérations maximum
                        if ($trig != 'chiffres' && Preg_match_all("~([0-9]+)~", u, $m)) {
                            $n++;
                            $i = implode('', $m[1]);
                            $t2 = $temp . " {$i}";
                            $trig = 'chiffres';
                            continue;
                        }
                        $i++;
                        $t2 = $temp . " {$i}";
                        #sinon on incrémente
                    }
                    $res[$url] = $t2;
                    $prev[] = accents(strtolower($t2));
                    #les scores les plus pourris ramassent la merde
                    if ($url == $u) {
                        $ret = $t2;
                    }
                    #calcule le retour pour l'url courante
                }
                foreach ($res as $url => $v) {
                    if ($noexist && $url == $u) {
                        $s[] = "insert into " . DB . ".unikdata(url,data,score)VALUES(\"{$u}\",\"{$v}\",\"{$score[$u]}\")";
                        sql5(end($s), $arg);
                        continue;
                    }
                    $s[] = "update " . DB . ".unikdata set data=\"{$v}\" where url=\"{$url}\"";
                    sql5(end($s), $arg);
                    #Il est possible que l'url courante n'aie pas d'enregistrements !!!
                }
            }
            if ($db == 'titre') {
                DbM('unikdata', surl . "<li>db?{$db} / " . hu3 . "->{$data}<li>noexist?{$noexist}<li>sql:" . pre($s) . "<li>score:" . pre($score) . "<li>datas:" . pre($datas) . "<li>res:" . pre($res) . "<li>GT:" . pre($_ENV['dbt']), 1);
            }
            return $ret;
        }
    } else {
        $u = u3;
        #local db mode
        if ($db == 'titre' && filemtime(DR . $db . '.db') < $rev) {
            Unlink(DR . $db . '.db');
        }
        #Unlink the whole file
        #if(!strpos(u3,'=')&&$_ENV['soloQ'])$u=Preg_replace("~\?(?!({$_ENV['soloQ']})).*~is",'',u3);#déjà calculée dans autoappend
        #Determine unique Array 1
        while (strlen($data) < $size && $_ENV['ksup']) {
            $next = Array_shift($_ENV['ksup']);
            if (!stripos($data, $next)) {
                $data .= ' ' . $next;
            }
        }
        #push ksup inside
        Rem($key, $u, 'index');
        $x = FGC(DR . $db . '.db');
        #if(J9)die(pre($x));
        if ($x[$key] && now > $_ENV['rev'] && !strpos($_ENV['args'], 'forcetitre')) {
            return $x[$key];
        }
        #Si la clé date d'avant la dernière révision on la retourne
        if ($x[$key] != $data) {
            #différente ou non définie
            $score[$key] = substr_count(u, '/') * 20 + substr_count(u, '?') * 10 + substr_count(u, '&') * 10 + strlen(u);
            #Score de lui même
            if (strpos($_ENV['args'], ',tprio')) {
                $score[$key] = 0;
            }
            if (strpos(surl, '?', 0)) {
                Preg_match_all("~=([^&]+)~is", surl, $t);
                if ($t) {
                    $t = $t[1];
                    $data .= ' ' . implode(' ', $t);
                }
                #si titre similaire, ajouter le query string
            }
            #Cas 1 : il y a un chiffre dans l'url et il est différent des titres des autres, s'il y a déjà un chiffre, on remplace ce dernier par 156
            if (is_Array($x)) {
                null;
            } else {
                dbM("x is not array-no f*****g way:{$x[$key]}§" . pre($x));
            }
            #elseif(!$x){dbM("uniktitre:x is null ?? wtf ??");return;}
            $y = Array_map('strtolower', $x);
            $e = print_r(error_get_last(), 1);
            #if(stripos($e,'array given'))dBM("uniktitre:$db:{$x[$key]}\n<br>err:".pre($e)."\n<Br>y:".pre($y)."<Br>x:".pre($x));
            $found = array_keys($y, strtolower($data));
            #Arrive très souvent..;
            if (count($found) && Preg_match_all("~([0-9]+)~", u, $m)) {
                #avec des chiffres à injecter dans le titre
                $i = implode('', $m[1]);
                $data = $origin . " {$i}";
                $found = array_keys($y, strtolower($data));
                #last verif
                if (count($found) < 1) {
                    FAP("tx=1&file=" . DR . $db . '.db', array($u => $data));
                    db('found:numbers injected in title');
                    return $data;
                }
                #Ok si aucun doublon
            }
            if (count($found)) {
                #des doublons de titres ont été trouvés
                foreach ($found as $k2) {
                    #si les scores sont égaux, on ne pourra la comparer à un autre numéro..
                    $score[$k2] = substr_count($k2, '/') * 20 + substr_count($k2, '?') * 10 + substr_count($k2, '&') * 10 + strlen($k2);
                    if ($k2 == 'index') {
                        $score[$k2] = 0;
                    }
                    #raz page 0
                }
                Asort($score);
                $os = $score;
                foreach ($score as $k => $v) {
                    #Remplacer le score par les valeurs titre
                    while (in_array($data, $score) && $n < 10) {
                        $n++;
                        $i++;
                        $data = $origin . " {$i}";
                    }
                    if ($n > 10) {
                        Dbm("{$db} n:{$n}; data:" . pre($data) . "score:" . pre($score));
                    }
                    $score[$k] = $data;
                    GT('whilescore');
                    #crée autant
                }
                #if($score[0]==$score[self])Best=1;swap titles
                #if(count($score)<2)$score=end($score);
                FAP("tx=2,{$key}&file=" . dr . $db . '.db', $score);
                #DbM('unikdata',surl."<li>data:$data<li>x[key]:".print_r($x[$key],1)."<li>found:".print_r($found,1)."<li>score:".print_r($os,1)."<li>res:".print_r($score,1));
                return $score[$key];
            }
            if ($x[$key] && now > $_ENV['rev'] && !strpos($_ENV['args'], 'forcetitre')) {
                return $x[$key];
            }
        }
        #swap those values pour url prioritaire!!!
        if ($x[$key] && now > $_ENV['rev'] && !strpos($_ENV['args'], 'forcetitre')) {
            return $x[$key];
        }
        #ajouter ici les valeurs des query strings !
        if ($data && $key) {
            FAP("tx=3,{$key}&file=" . dr . $db . '.db', $key, $data);
            gt('l' . __LINE__);
            return $data;
        }
        DB(surl . ':notitle found:' . count($found) . 'x[key]' . $x[$key] . 'data:' . $data . 'origin:' . $origin);
    }
}
Ejemplo n.º 3
0
function ggtracker()
{
    rem($ref, $_ENV['yt']['ref'], refe);
    #.refe  Car déjà enregistré
    $files = "ico|eot|ttf|js|css|htc|woff|swf|xml|gif|png|bmp|flv|mp(3|4)|exe|jpe?g|aspx?";
    #bad extensions
    $bp = "~\\?(jsr?|css|rss)|Final|visuall|zsimu|contact2?\\.php|suivi|s74.fr|4Test|(zsimu|2001|admin|intranet|sql)/|z/\\!|/!|/y/|\\.({$files})\$~i";
    #bad url
    $bR = "~(a74|xzxzx|dc10)\\.fr|frontaliers\\.info|yahooapi|url=|\\.(s?html|{$files})\$~i";
    #bad referer : can't be the referer,ex:referal spam
    #shall be recorded on first step !
    if (stripos(' ' . $ref . refe, '<a href')) {
        Block(array('badref', $ref . refe));
    } elseif (h == 'cli') {
        $x = 'cli';
    } elseif (bots) {
        $x = 'bots';
    } elseif (!$GLOBALS['tracker']) {
        $x = '!tracker';
    } elseif ($GLOBALS['notracker']) {
        $x = 'notracker';
    } elseif ($_ENV['yt']['lw'] + 600 > now) {
        $x = 'lw<600';
    } elseif (Preg_Match('~SID|css|js|jsr~is', q)) {
        $x = 'badq';
    } elseif (Preg_Match("~\\.({$files})\$~is", u)) {
        $x = 'badfiletype';
    } elseif (Preg_Match("~yandsearch|saihm|seoheap|internesdedijon|(a74|xzxzxz)\\.fr~is", REFE . Q . $ref)) {
        $x = 'badref';
    } elseif (Preg_Match("~(Tag|2|zsimu|qform|contact2?)\\.php|Final|dev3|/(3p|mut|!r|\\?|sql|2001|intranet)~is", u)) {
        $x = 'badurl';
    } elseif (Preg_Match($bp, $ref, $t)) {
        $x = 'ref:badpat(u)';
    } elseif (Preg_Match($bp, u, $t2)) {
        $x = 'url:badpat';
    } elseif (Preg_Match($bR, refe . $ref, $t3)) {
        $x = 'ref:badpat(R)';
    } elseif (preg_match("~\\.(php|s?html?)\$~", u)) {
        $x = 11;
    } elseif (strpos(substr($v, -5), '.') > -1) {
        $x = 'is not php or shtml : other filetype';
    } else {
        $x = 12;
    }
    #unknown
    if (!is_numeric($x)) {
        null;
    } else {
        G2('k1');
        #si le fichier existe déjà sur le serveur, cette valeur est récupérée, puis inserée de nouveau pour marquer l'autre site avec le meme mot clés
        #$y=Preg_replace('`&(babsrc|affid|mntrid|channel|client|clientcop|source|gs_rfai|ei|btng|spell|resnum|sourceid|channel|filetype|vertical|_iceurlflag|_iceurl)=([^&]+)`is','',$y);
        $y = str_replace(array('search/z/results/', '/fr/results/index/q/', 'search/', 'search?w=tot', 'as_q=', 'custom&q=', '&aqa=', '&aqp=', '/web/', 'rdata=', 'lts/&q='), '&q=', $ref);
        $y = str_replace(array('search/srpcache', 'linkdoctor', 'toggle=1', 'sa=n', 'ei=', 'prmd=mc', 'hl=fr', 'rls=', 'org.mozilla:fr', ':official', 'firefox-a', 'http://', 'www.', 'fr.', 'search.', 'aq=', 'oq=', 'aqi=', 'fkt=', 'fsdt=', 'fr=yfp-t-703', 'meta=lr', 'source=hp', 'aql=', 'hs=', 'tbo=s', 'rlz=', 'searchal', 'utf-8', 'ie=', 'oe=', 'sourceid=', 'nabclient', 'gfns=', '/bottomnavigation', '/relevance', '%22', 'recherche google', 'ved=', 'ct=', 'sa=x', 'oi=spell', 'rlz=', 'hl=fr', 'oq=', 'linkdoctor', 'safari', 'redir_esc=', 'ie=', 'oe=', 'utf-8', 'aq=', 'rls=', 'org.mozilla:', 'fr:official', 'meta=', 'gs_rfai=', 'aqi=', 'ql=', 'navclient', 'usg=', 'vc=', 'safe=', 'active', 'com.microsoft', 'en-gb', 'searchbox', 'ecofree.org/search.php', 'pid=', 'search.daum.net', 'results&', 'itag=ody', 'search&', '&hl=fr', 'topnavigation/', 'relevance/', 'iq=true/', 'zoom=off/', '=7', '&oq=', '&aq=', '&cx=', 'partner-', 'mb-', 'pub-'), '&', $y);
        $y = trim(Preg_replace("~[&]{2,}~", '&', $y), ' &');
        $mots = kwd($y);
        #travaux de nettoyage du referrer =)
        if ($mots && !strpos($mots, 'provided') && !in_Array($mots, array('', ':'))) {
            $mots = Tridecoder($mots);
            $mots = Preg_replace("~((google|yahoo|bing|yandex|gooofullcom|vizzeo|.?chiadah|find\\.eu|ke\\.voila|voila|seexie|askpeter|iadah|yougoo|yhs4|ecosia)\\.|search;|cx=|goooful|(\\.fr)?iadah\\.com).*|\\.it\$~is", '', $mots);
            $trop = explode(',', "_,</a>,< a>,<a href=,refineobj:video,google.ca,google.ci,google.co.uk ,url ,google.fr ,google.com ,search ,hl=en,sa=t,spider.htm");
            $mots = trim(str_replace($trop, '', $mots));
            #synchronisation des bibliothècas,maintenance
            if (preg_match("~^.(ttp&%2f%2f|ttp:)~is", $mots) or strlen($mots) < 3) {
                Null;
            } elseif ($_ENV['yt']['mots'] == $mots || $_ENV['yt']['fmt']['kw'] + 600 > NOW) {
                null;
            } else {
                #Nouveau mot clé
                if (preg_match("~q=([^&]+)~is", $mots, $t)) {
                    $mots = $t[1];
                }
                if (Preg_Match_ALL("~" . BKW . "~i", $mots, $t)) {
                    Block($t[0], $mots);
                }
                #blockage de l'IP et throw 404
                if (Preg_Match("~bestof~is", U)) {
                    $mots = '';
                }
                #cancel
                if ($mots) {
                    #if(!$_ENV['yt']){$_ENV['yt']=Array();DBM('!yt',"<pre>".STARTER."-$mots</pre>",'a6');}$i=$_ENV['yt'];
                    $yt2 = array('lw' => NOW, 'date' => date("Y/m/d H:i:s"), 'mots' => $mots, array('fmt' => array('kw' => NOW)));
                    if ($_ENV['yt']['mots']) {
                        $yt2['mots-1'] = $_ENV['yt']['mots'];
                    }
                    #DBM('ggt',"<pre>$mots,".print_r($_ENV['yt'],1).'</pre>','gg9');
                    if (Preg_Match("~gclid=|aclk\\?~is", $_ENV['yt']['ref'])) {
                        $yt2['adwords'] = $mots;
                    } elseif (0) {
                        #insertions sql //todo:file_append puis écriture en lots
                        $x2 = sql5("UPDATE CSF set site='" . H . "',hits=hits+1,ip='" . IP . "',time=" . NOW . ",date=now(),Ref=\"{$ref}\" {$s1} where url=\"" . SU . "\" and keyword=\"{$mots}\" order by id ASC limit 1");
                        if ($x2 < 1) {
                            sql5("INSERT INTO CSF(ip,Ref,site,keyword,url,position,time,date)VALUES('" . IP . "',\"{$ref}\",'" . H . "',\"{$mots}\",\"" . SU . "\",'{$pos}'," . NOW . ",NOW())");
                        }
                        #INSERT INTO CSF SET key = 'key', generation = 'generation' ON DUPLICATE KEY UPDATE key = 'key', generation = (generation + 1);
                    }
                    #$_SESSION['st1']=$magic;#$_SESSION['mots']=$mots;
                    $magic = "{$mots};" . $_ENV['yt']['dlp'] . ";" . $_ENV['yt']['ref'];
                    setcookie('kw', $mots, 1484045758);
                    setcookie('dlp', $magic, 1484045758);
                }
            }
            if (is_array($yt2)) {
                $_ENV['yt'] = Array_merge($_ENV['yt'], $yt2);
                FAP(IPF, $_ENV['yt']);
            }
            redef('motcle', $mots);
        }
    }
}
Ejemplo n.º 4
0
function perf()
{
    static $t;
    unset($_ENV['header'], $_ENV['c']);
    GT('perf1');
    if (preg_match('~(js|css)$|(js|lastmod)\\.php~', SU) || isset($_POST['ajax'])) {
        return;
    }
    #
    //todo:ne pas executer cette fonction si header<>200 sur la page
    $x = $GLOBALS['pi'];
    if ($x['extension']) {
        #peut être vide..
        if (in_Array($x['extension'], explode(',', 'php,htm,html,fr,org,com,info,ch,tv'))) {
        } else {
            return;
        }
        #extension non autorisée
    }
    #cl('perf,j9:'.J9.','.$t.','.SU.','.print_r(,1));
    #if(!preg_match('~\.(html?|php)$~',U))return;
    if (Preg_Match("~glob=~", Q)) {
        $t = 7;
    } elseif (e(',forceperf', 1) or J9) {
        null;
    } elseif (is_numeric(H) || $t || RS == 404 || e('noperf', 1) || isset($_ENV['noperf']) || $_GET['re'] . $_GET['noperf'] . $_GET['np'] || strpos(U, '%2B%2B') || strlen(U) > 80) {
        $t = 1;
    } elseif (Preg_Match("~(js|jsr|css|rss|sm|redir)\$~", Q)) {
        $t = 2;
    } elseif (preg_match("~Tag\\.php|url(\\.|\\()data|image(/|-)png|base64|\\.(png|js|css|jsx?|jpe?g|gif|bmp|gif|ico|htc|sm)\$~", U)) {
        $t = 3;
    } elseif (!isgoodurl()) {
        $t = 4;
    } elseif (Preg_Match("~editor\\.php|officia|Tag|rss|data|xml|/(CIEL|admin|2001|adm)/|(gss|css.*)\$~i", SU) || preg_Match('~/z/~i', SU) && !preg_Match('~\\/sex|video~i', U)) {
        $t = 5;
    }
    if (preg_match("~base64|%27|\\+~", u)) {
        $t = 6;
    }
    if ($t) {
        Av('t', $t);
        return;
    }
    #FPC(ERLOGS,"noperf:$t\n",1);
    GT('fin');
    $t = 1;
    if (in_array(H, array('ben', 'localhost', '127.0.0.1'))) {
        av('H', $_ENV);
        kill();
    }
    #even if cached,if(j9)return;
    if (q) {
        null;
    } else {
        $f0 = TMP . "perf/" . trim(str_replace(array('http://', '/'), array('', '§'), SU), '§') . ".db";
        $f = TMP . "perf/" . mu . ".db";
        if (is_file($f0)) {
            rename($f0, $f);
        }
        #transition, beaucoup plus simple au final
        $x = FGC($f);
        #Faire correspondre avec fichier "mu" plutôt !!! @todo
        if (isset($_ENV['yt']['mots'])) {
            $x['mots'] = $_ENV['yt']['mots'];
        }
        $x['Memo'] = Memuse();
        #;
        $def = array('tim', 'nb', 'db');
        foreach ($def as $v) {
            if (!isset($x[$v])) {
                $x[$v] = 0;
            }
        }
        if ($x['tim'] > 9999999999) {
            $x['tim'] = $x['nb'] = 0;
        }
        #si bug gettime
        #if(!is_numeric($x['tim']))$x['tim']=0;$x['tim']+=$time;#err
        if (!is_numeric($x['nb'])) {
            $x['nb'] = 1;
        }
        $x['nb'] = $x['nb'] + 1;
        $x['avg'] = ceil($x['tim'] / $x['nb']);
        unset($x['calc'], $x['gen']);
        #if avg>800 db(,'prio'); et on peut créer fichier fpdata avec cette valeur avg afin de charger plus souvent, plus durablement le système de cache pour soulager les pages mettant bcp de temps à être pondues !!!!
        $x['db'] = explode(',', str_replace('Array', '', $x['db']));
        $x['db'] = Array_unique($x['db']);
        $x['db'] = implode(',', $x['db']);
        if (function_exists('sys_getloadavg')) {
            $sysload = implode('#', sys_getloadavg());
            $x['sys'] = date("H:i:s") . ">" . $sysload;
        }
        if (e('erver:pre', 1)) {
        } else {
            FPC($f, $x);
            Touch($f, $x['avg']);
        }
    }
    $x['db'] .= ",fin:" . $_ENV['lasttime'];
    $x['cachepath'] = CACHEPATH;
    if (!j9) {
        return;
    }
    Addurl();
    #les urls dont on s'en tape
    $edit = $y2 = null;
    #FAP(logs.'Vitale.db',Array('cp'=>cachepath,'sfn'=>$_SERVER['SCRIPT_FILENAME']));
    #$x=FGC(TMP.'cont/'.$mu.'.contenu');
    $f = TMP . 'cont/' . MU . '.contenu';
    if (is_file($f)) {
        $y = FGC($f);
        $_ENV['args'] .= " :muc:{$y['id']},len:" . $_ENV['x'];
        $edit .= "<button onclick=\"edt('?zp={$y['id']}');return false;\">e:muc:{$y['id']}</button>";
    } elseif (is_file(TMP . 'cont/' . MU)) {
        $y = FGC(TMP . 'cont/' . MU);
        e("e:mu:{$y}");
        #contient l'identifiant de la page
        $t = sql5("select sql_cache * from p.zpages2 where id={$y}");
        if ($t) {
            $edit .= "<button onclick=\"edt('?zp={$y}');return false;\">e:mu:{$y}</button>";
        } else {
            unlink(TMP . 'cont/' . MU);
        }
        #unlink si l'identifiant sql n'existe pas :)
    } elseif (isset($_POST['create'])) {
        #£todo:bad: right, that's bad, we're checking in this function, globally, if we have some postdata to edit this page contents
        $y = sql5("select id from p.zpages2 where url=\"" . SU . "\"");
        if (!$y) {
            $y = sql5("insert into p.zpages2(url)values(\"" . SU . "\")");
            if ($y) {
                FPC(TMP . 'cont/' . mu, $y);
            }
        }
    } elseif (!RU) {
        $edit .= "<form method=post><input type=hidden name=create value=1><input type=submit value=create></form>";
    }
    if (1) {
        $edit .= "<button accesskey='e' onclick=\"edt('?sfn=1');return false;\">kod</button>";
    }
    Arsort($_ENV['dbt']);
    unset($_ENV['c'], $_ENV['Adbt']);
    $x = Array_merge($_ENV, $x);
    if (is_file(CACHEPATH)) {
        $dif = " age:" . (filemtime(CACHEPATH) - NOW) . "";
    }
    if (is_Array($x['Memo'])) {
        $x['Memo'] = implode(',', $x['Memo']);
    }
    #$y=Pre($x,'nude=1');pre2console($y);
    if (isset($_ENV['debug'])) {
        $y2 = Pre($_ENV['debug'], 'nude=1');
        pre2console($y2);
    }
    #if(J11)$y=print_r(debug_backtrace(),1).$y;
    if (!strpos($_ENV['args'], 'nocss') && !AJAX) {
        $base = $x;
        header('Bs: ' . fixSer($x), 1);
        header('Cdebug: ' . str_replace(array("\r", "\n"), array('', '*'), print_r($base, 1)), 1);
        echo "\n\n<script>var y='" . jsonEnc($base) . "';var cinfo=JSON.parse(y);console.info('cinfo',cinfo);</script>";
        //todo JS debugging into header
    }
    #y.replace(/\"\"/gi,'*'),if(z2)console.info(\"%c\"+z2,'color:blue;font:10px Trebuchet MS');
    #[\"Perf:$sysload:$_ENV[lasttime] ms-\"+z]
    #.replace(/\\n +\(\\n/g,'(\\n').replace(/\\nArray\\n\(\\n\[/g,'\\nArray:\['),z2=\"$y2\".replace(/\\n +\(\\n/g,'(\\n').replace(/\\nArray\\n\(\\n\[/g,'\\nArray:\[');
    #console.info([%cPerf:$sysload:$_ENV[lasttime] ms-\"+z,'color:blue;font:10px Consolas');
    if (e('shutd')) {
        Null;
    } else {
        kill();
    }
    #Si une autre fonction de shutdown a été rajoutée par dessus - sinon fin de tout ( appel à die recursif dans foncshutdown ) !
}