Twiebie |
|
---|---|
I couldn't find a solution by using the search function, my question is what the easiest way is to import a .xml feed into a page?
I tried using: include:http://www.xmlfeedurl.com/feed.xml but that wont work because it's trying to import a page from a folder on the server. Thanks in advance. |
Kort |
|
---|---|
SED.by - создание сайтов, разработка плагинов и тем для Котонти
|
Kaan |
|
---|---|
http://neocrome.net/forums.php?m=posts&p=132464#132464
The solution has a name - RSS reader. Download it here: http://www.neocrome.net/datas/users/5280-plug-rssreader.rar |
Twiebie |
|
---|---|
I used that one when I was still using Seditio, but i'm having problems with it on Cotonti.
I thought maybe there was a simple option in Cotonti. |
vice |
|
---|---|
If you know a little PHP, then you can write your own plugin. I used to write for themselves, this RSS graber.
echo '<div id="main"><div align="justify">';
//point to an xml file
$feed = "http://www.opennet.ru/opennews/opennews_mini_full.rss";
//create object
$sxml = simplexml_load_file($feed);
echo "<center><h2> ГОРЯЧИЕ НОВОСТИ. ПОДРОБНО.
</h2></center>
<img align=left src=skins/ice/img/cofcup.jpg >
<br><br>";
//echo "<h2>{$sxml->channel->title}</h2>\n";
$i = 1;
foreach ($sxml->channel->item as $item){
$strtemp = "<font color=blue>$item->title</font><br>$item->description<br>";
$strtemp = iconv("utf-8", "windows-1251", $strtemp);
$strtemp = strip_tags($strtemp, '<p><br><font>');
$newtext = ereg_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])|Источник:","",$strtemp);
echo $newtext;
echo '<center><img src=skins/ice/img/cup.png> 
<img src=skins/ice/img/cup.png> 
<img src=skins/ice/img/cup.png>
</center><br>';
$i++;
if ($i > 5) break;
}
echo '</div></div>';
An example of how it looks http://linux.povorotka.org.ua/plug.php?e=feed |