Exemplo n.º 1
0
     }
 }
 if ($topic != "") {
     $q .= "AND s.topic='{$topic}' ";
 }
 if ($days != "" && $days != 0) {
     $q .= "AND TO_DAYS(NOW()) - TO_DAYS(time) <= '{$days}' ";
 }
 $q .= " ORDER BY s.time DESC" . $limit;
 $t = $topic;
 $x = 0;
 if ($SuperCache) {
     $cache_clef = "[objet]==> {$q}";
     $CACHE_TIMINGS[$cache_clef] = 3600;
     $cache_obj = new cacheManager();
     $tab_sid = $cache_obj->startCachingObjet($cache_clef);
     if ($tab_sid != "") {
         $x = count($tab_sid);
     }
 } else {
     $cache_obj = new SuperCacheEmpty();
 }
 if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
     $result = sql_query($q);
     if ($result) {
         while (list($sid, $aid, $title, $time, $url, $topic, $informant, $ihome) = sql_fetch_row($result)) {
             if (ctrl_aff($ihome, 0)) {
                 $tab_sid[$x]['sid'] = $sid;
                 $tab_sid[$x]['aid'] = $aid;
                 $tab_sid[$x]['title'] = $title;
                 $tab_sid[$x]['time'] = $time;
Exemplo n.º 2
0
function charg_metalang()
{
    global $SuperCache, $CACHE_TIMINGS, $REQUEST_URI;
    global $NPDS_Prefix;
    if ($SuperCache) {
        $racine = parse_url(basename($REQUEST_URI));
        $cache_clef = "[metalang]==>" . $racine['path'] . ".common";
        $CACHE_TIMINGS[$cache_clef] = 86400;
        $cache_obj = new cacheManager();
        $glossaire = $cache_obj->startCachingObjet($cache_clef);
    } else {
        $cache_obj = new SuperCacheEmpty();
    }
    if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
        $result = sql_query("SELECT def, content, type_meta, type_uri, uri FROM " . $NPDS_Prefix . "metalang WHERE type_meta='mot' OR type_meta='meta' OR type_meta='smil'");
        while (list($def, $content, $type_meta, $type_uri, $uri) = sql_fetch_row($result)) {
            // la syntaxe est presque la même que pour les blocs (on n'utilise que la racine de l'URI)
            // si type_uri="-" / uri site les URIs où les meta-mot NE seront PAS actifs (tous sauf ...)
            // si type_uri="+" / uri site les URI où les meta-mot seront actifs (seulement ...)
            // Le séparateur entre les URI est l'ESPACE
            // => Exemples : index.php user.php forum.php static.php
            if ($uri != "") {
                $match = match_uri($racine['path'], $uri);
                if ($match and $type_uri == "+" or !$match and $type_uri == "-") {
                    $glossaire[$def]['content'] = $content;
                    $glossaire[$def]['type'] = $type_meta;
                }
            } else {
                $glossaire[$def]['content'] = $content;
                $glossaire[$def]['type'] = $type_meta;
            }
        }
    }
    if ($SuperCache) {
        $cache_obj->endCachingObjet($cache_clef, $glossaire);
    }
    return $glossaire;
}