<?php

/* 
 ======================================================================
 lastRSS DEMO 4 - Multilingual RSS agregator
 ----------------------------------------------------------------------
 This example shows, how to display RSS resources in different
 languages and different character encodings on one page.
 ======================================================================
*/
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Multilingual RSS agregator</title>
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#000080" alink="#FF0000">

<h1>LastRSS demo :: Multilingual RSS agregator</h1>
<p>This example shows, how to display RSS resources in different languages and different character encodings on the one page.</p>
<a href="http://lastrss.webdot.cz/">
<img src="lastrss_button.gif" alt="lastRSS.php - RSS parser for PHP" width="88" height="31" border="0">
</a>
<hr>

<?php

function ShowOneRSS($url) {
    global 
$rss;
    if (
$rs $rss->get($url)) {
        echo 
'<h2><a href="'.$rs['link'].'">'.$rs['title']."</a></h2>\n";
        echo 
'<small>Language/Encoding: <font color="red"><b>'.$rs['language'].'/'.$rs['encoding']."</b></font><br></small>\n";
        echo 
$rs['description']."<br>\n";
            echo 
"<ul>\n";
            foreach (
$rs['items'] as $item) {
                echo 
'<li><a href="'.$item['link'].'" title="'.$item['description'].'">'.$item['title'].'</a></li>';
            }
            if (
$rs['items_count'] <= 0) { echo "<li>Sorry, no items found in the RSS file :-(</li>"; }
            echo 
"</ul>\n";
    }
}

// ===============================================================================

// include lastRSS
include "./lastRSS.php";

// List of RSS URLs
$rss_left = array(
    
'http://slashdot.jp/articles.rdf',
    
'http://www.honositomuhely.hu/klip/honosito.rss',
    
'http://www.ibm.com/news/kr/ko/index.rss'
);
$rss_right = array(
    
'http://www.kinomol.cz/rss.php',
    
'http://palmq.ru/backend.php',
    
'http://www.freshfolder.com/rss.php'
);

// Create lastRSS object
$rss = new lastRSS;

// Set cache dir, cache interval and character encoding
$rss->cache_dir './temp';
$rss->cache_time 1200// (5 seconds)
$rss->cp 'UTF-8';
$rss->items_limit 5;

// Show all rss files
echo '<table cellpadding="10" border="0"><tr><td width="50%" valign="top">';
foreach (
$rss_left as $urlShowOneRSS($url);
echo 
'</td><td width="50%" valign="top">';
foreach (
$rss_right as $urlShowOneRSS($url);
echo 
'</td></tr></table>';

?>

</body>
</html>