Exemplo n.º 1
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('rss' => array('url')));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.link');
if (!empty($_GET['rss'])) {
    list($st, $header, $body, $lmdate, $rval) = @xml_parser($_GET['rss'], '');
    $result = array();
    if ($rval) {
        list($title, $link) = str_dbi_check(@get_siteinfo($rval));
        if (Utils_Unicode::validate($title, true)) {
            $result['name'] = correctTTForXmlText(Utils_Unicode::correct(htmlspecialchars(trim($title))));
        } else {
            $result['name'] = correctTTForXmlText(Utils_Unicode::bring(htmlspecialchars(trim($title))));
        }
        if (Utils_Unicode::validate($link, true)) {
            $result['url'] = correctTTForXmlText(Utils_Unicode::correct(htmlspecialchars(trim($link))));
        } else {
            $result['url'] = correctTTForXmlText(Utils_Unicode::bring(htmlspecialchars(trim($link))));
        }
        Respond::PrintResult($result);
    } else {
        $result['url'] = $_GET['rss'];
        $result['name'] = '';
        Respond::PrintResult($result);
    }
    exit;
} else {
Exemplo n.º 2
0
            $dpatterns[5] = "/<\\!\\[CDATA\\[(.+)\\]\\]>/sU";
            $dreplacements[5] = '$1';
        } else {
            $dpatterns[5] = "/<\\!\\[CDATA\\[(.+)\\]\\]>/sU";
            $dreplacements[5] = '';
        }
        $description = preg_replace($dpatterns, $dreplacements, $data[1]);
        $link = preg_replace("/<link.+href=\"(.+)\"(.+|)\\/>/sU", '$1', $data[2]);
        $date = $data[3];
        $theData .= "\n   <dt class=\"titel\"><a href=\"{$link}\" target=\"_blank\">{$title}</a></dt>\r";
    }
    $theData .= "</dl>";
    return $theData;
}
// ticker setup - insert the URL to the RSS Feed of your choice here
$container = 'item';
$tags = array('title', 'description', 'link', 'pubDate');
$feed = xml_parser("http://www.rosenheim24.de/rosenheim/lk-rosenheim/rssfeed.rdf", $container, $tags, 9, '');
?>

<h1>News from Rosenheim / Bavaria</h1>
<div class="container">

<?php 
//  utf-8 FTW!
echo iconv('ISO-8859-1', 'utf-8', $feed);
?>
</div>

</body>
</html>