Esempio n. 1
0
        if ($id and $lastdate) {
            $db->query("UPDATE " . PREFIX . "_rss SET lastdate='{$lastdate}' WHERE id='{$id}'");
        }
        clear_cache();
        msg("info", $lang['addnews_ok'], $lang['rss_added'], "?mod=rss");
    }
    msg("error", $lang['addnews_error'], $lang['rss_notadded'], "?mod=rss");
} elseif ($_REQUEST['action'] == "news" and $id) {
    include_once ENGINE_DIR . '/classes/rss.class.php';
    include_once ENGINE_DIR . '/classes/parse.class.php';
    $parse = new ParseFilter(array(), array(), 1, 1);
    $parse->leech_mode = true;
    $rss = $db->super_query("SELECT * FROM " . PREFIX . "_rss WHERE id='{$id}'");
    $xml = new xmlParser(stripslashes($rss['url']), $rss['max_news']);
    $xml->pre_lastdate = $rss['lastdate'];
    $xml->pre_parse($rss['date']);
    $i = 0;
    foreach ($xml->content as $content) {
        if ($rss['text_type']) {
            $xml->content[$i]['title'] = $parse->decodeBBCodes($xml->content[$i]['title'], false);
            $xml->content[$i]['description'] = $parse->decodeBBCodes($xml->content[$i]['description'], false);
            $xml->content[$i]['date'] = date("Y-m-d H:i:s", $xml->content[$i]['date']);
        } else {
            $xml->content[$i]['title'] = $parse->decodeBBCodes($xml->content[$i]['title'], false);
            $xml->content[$i]['description'] = $parse->decodeBBCodes($xml->content[$i]['description'], true, "yes");
            $xml->content[$i]['date'] = date("Y-m-d H:i:s", $xml->content[$i]['date']);
        }
        $i++;
    }
    echoheader("<i class=\"icon-rss\"></i>" . $lang['opt_rss'], $lang['header_rs_1']);
    echo <<<HTML
Esempio n. 2
0
     continue;
 }
 $buffer = dle_cache("informer_" . $value['id'], $config['skin']);
 if ($buffer !== false) {
     $file_date = @filemtime(ENGINE_DIR . '/cache/informer_' . $value['id'] . '_' . md5($config['skin']) . '.tmp');
     if ($file_date) {
         if (date("d-H", $file_date) != date("d-H")) {
             $buffer = false;
             @unlink(ENGINE_DIR . '/cache/informer_' . $value['id'] . '_' . md5($config['skin']) . '.tmp');
         }
     }
 }
 if ($buffer === false) {
     include_once ENGINE_DIR . '/classes/rss.class.php';
     $xml = new xmlParser(stripslashes($value['url']), $value['news_max']);
     $xml->pre_parse(0);
     $tpl->load_template($value['template'] . '.tpl');
     foreach ($xml->content as $content) {
         $content['title'] = trim(strip_tags($content['title']));
         $content['category'] = trim(strip_tags($content['category']));
         $content['author'] = trim(strip_tags($content['author']));
         if ($value['tmax'] and dle_strlen($content['title'], $config['charset']) > $value['tmax']) {
             $content['title'] = dle_substr($content['title'], 0, $value['tmax'], $config['charset']) . " ...";
         }
         if (stripos($tpl->copy_template, "{image-") !== false) {
             $images = array();
             preg_match_all('/(img|src)=("|\')[^"\'>]+/i', $content['description'], $media);
             $data = preg_replace('/(img|src)("|\'|="|=\')(.*)/i', "\$3", $media[0]);
             foreach ($data as $url) {
                 $info = pathinfo($url);
                 if (isset($info['extension'])) {