|
@@ -16,17 +16,20 @@ if (empty($url)) {
|
|
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
+try {
|
|
-$channel = Reader::import($url);
|
|
+ $channel = Reader::import($url);
|
|
-
|
|
+ if (!empty($channel)) {
|
|
-if (!empty($channel)) {
|
|
+
|
|
-
|
|
+ foreach ($channel as $item) {
|
|
- foreach ($channel as $item) {
|
|
+ $title = $item->getTitle();
|
|
- $title = $item->getTitle();
|
|
+ $link = $item->getLink();
|
|
- $link = $item->getLink();
|
|
+ if (!empty($link)) {
|
|
- if (!empty($link)) {
|
|
+ $title = Display::url($title, $link, ['target' => '_blank']);
|
|
- $title = Display::url($title, $link, ['target' => '_blank']);
|
|
+ }
|
|
|
|
+ echo Display::panel($item->getDescription(), $title);
|
|
}
|
|
}
|
|
- echo Display::panel($item->getDescription(), $title);
|
|
|
|
}
|
|
}
|
|
|
|
+} catch (Exception $e) {
|
|
|
|
+ echo Display::return_message($plugin->get_lang('no_valid_rss'), 'warning');
|
|
|
|
+ error_log($e->getMessage());
|
|
}
|
|
}
|