🚚 Make RSS a module
This commit is contained in:
parent
edf71f9a40
commit
4d207bcdd8
14 changed files with 1 additions and 28 deletions
|
@ -3,33 +3,6 @@
|
|||
class pluginRSS extends Plugin
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
// Fields and default values for the database of this plugin
|
||||
$this->dbFields = array(
|
||||
'numberOfItems' => 5
|
||||
);
|
||||
}
|
||||
|
||||
// Method called on the settings of the plugin on the admin area
|
||||
public function form()
|
||||
{
|
||||
global $L;
|
||||
|
||||
$html = '<div>';
|
||||
$html .= '<label>' . $L->get('RSS URL') . '</label>';
|
||||
$html .= '<a href="' . Theme::rssUrl() . '">' . Theme::rssUrl() . '</a>';
|
||||
$html .= '</div>';
|
||||
|
||||
$html .= '<div>';
|
||||
$html .= '<label>' . $L->get('Amount of items') . '</label>';
|
||||
$html .= '<input id="jsnumberOfItems" name="numberOfItems" type="text" dir="auto" value="' . $this->getValue('numberOfItems') . '">';
|
||||
$html .= '<span class="tip">' . $L->get('Amount of items to show on the feed') . '</span>';
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
private function encodeURL($url)
|
||||
{
|
||||
return preg_replace_callback('/[^\x20-\x7f]/', function ($match) {
|
||||
|
@ -44,7 +17,7 @@ class pluginRSS extends Plugin
|
|||
global $url;
|
||||
|
||||
// Amount of pages to show
|
||||
$numberOfItems = $this->getValue('numberOfItems');
|
||||
$numberOfItems = $site->itemsPerPage();
|
||||
|
||||
// Get the list of public pages (sticky and static included)
|
||||
$list = $pages->getList(
|
Loading…
Add table
Reference in a new issue