1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-04-09 19:15:42 +02:00

fixes what broke in the last commit

This commit is contained in:
Alessandro Cosentino 2012-07-30 15:38:58 -04:00
parent 25051024bc
commit eda7f50864
5 changed files with 19 additions and 24 deletions

View File

@ -23,8 +23,12 @@ $folderid = $_POST['folderid'];
$newfeed = OC_News_Utils::fetch($feedurl);
$feedmapper = new OC_News_FeedMapper();
$newfeedid = $feedmapper->save($newfeed, $folderid);
$newfeedid = false;
if ($newfeed !== null) {
$feedmapper = new OC_News_FeedMapper();
$newfeedid = $feedmapper->save($newfeed, $folderid);
}
$l = OC_L10N::get('news');

View File

@ -21,16 +21,8 @@ OC::$CLASSPATH['OC_News_FolderMapper'] = 'apps/news/lib/foldermapper.php';
OC::$CLASSPATH['OC_News_Utils'] = 'apps/news/lib/utils.php';
$l = new OC_l10n('news');
OCP\App::register( array(
'order' => 70,
'id' => 'news',
'name' => 'News'
));
OCP\App::addNavigationEntry( array(
'id' => 'news',
'order' => 74,

View File

@ -30,21 +30,20 @@ class OC_News_Utils {
return null;
}
if (!$spfeed->handle_content_type()) {
return null;
}
$spfeed->handle_content_type();
$title = $spfeed->get_title();
$spitems = $spfeed->get_items();
$items = array();
foreach($spitems as $spitem) { //FIXME: maybe we can avoid this loop
$itemUrl = $spitem->get_permalink();
$itemTitle = $spitem->get_title();
$itemGUID = $spitem->get_id();
$itemBody = $spitem->get_content();
$items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody);
if ($spitems = $spfeed->get_items()) {
foreach($spitems as $spitem) { //FIXME: maybe we can avoid this loop
$itemUrl = $spitem->get_permalink();
$itemTitle = $spitem->get_title();
$itemGUID = $spitem->get_id();
$itemBody = $spitem->get_content();
$items[] = new OC_News_Item($itemUrl, $itemTitle, $itemGUID, $itemBody);
}
}
$feed = new OC_News_Feed($url, $title, $items);
$favicon = $spfeed->get_image_url();

View File

@ -62,7 +62,7 @@ class OPMLParser {
$title = $rawfeed['title'];
$feed->setTitle($title);
}
echo $url;
return $feed;
}

View File

@ -1,6 +1,6 @@
<?php
$content = file_get_contents('/var/www/apps/news/prova.opml');
$content = file_get_contents('/tmp/occOrigzvXqKO');
require_once('news/opmlparser.php');