-
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"amount-of-items-to-show-on-the-feed": "Antal at emner, der skal vises i feedet.",
|
||||
"plugin-data": {
|
||||
"description": "Denne udvidelse genererer et RSS feed af dit websted.<br>Feedet har URL adressen https://example.com/rss.xml",
|
||||
"name": "RSS Feed"
|
||||
},
|
||||
"rss-url": "RSS URL"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"plugin-data": {
|
||||
"name": "RSS Feed",
|
||||
"description": "Das Plugin erstellt einen RSS Feed der Inhalte."
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Anzahl der gezeigten Inhalte.",
|
||||
"rss-url": "RSS-URL"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"plugin-data": {
|
||||
"name": "RSS Feed",
|
||||
"description": "Das Plugin erstellt erstellt einen RSS Feed der Inhalte."
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Anzahl der gezeigten Inhalte.",
|
||||
"rss-url": "RSS-URL"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS Feed",
|
||||
"description": "This plugin generates an RSS feed of your site.<br>The feed has the URL https://example.com/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Amount of items to show on the feed.",
|
||||
"rss-url": "RSS URL"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS Feed",
|
||||
"description": "Este plugin genera contenido dinamico en formato RSS de tu sitio.<br>El plugin genera la URL https://example.com/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Cantidad de artículos para mostrar.",
|
||||
"rss-url": "URL del RSS"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "خوراک RSS",
|
||||
"description": "این پلاگین برای وبسایت شما یک خوراک RSS تولید میکند.<br>خوراک آدرس وب https://example.com/rss.xml دارد"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "تعداد مطالب جهت نمایش در خوراک.",
|
||||
"rss-url": "آدرس وب RSS"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Flux RSS",
|
||||
"description": "Ce plugin génère un flux RSS de votre site.<br/>Le flux est accessible a l'URL de ce genre : https://example.com/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Nombre d'éléments à afficher sur le flux.",
|
||||
"rss-url": "URL RSS"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "Feed RSS",
|
||||
"description": "Questo plugin genera un feed RSS del tuo sito.<br>Il feed si trova all' URL https://esempio.com/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Quantità di voci da mostrare nel feed.",
|
||||
"rss-url": "URL RSS"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS Feed",
|
||||
"description": "This plugin generates an RSS feed of your site.<br>The feed has the URL https:\/\/example.com\/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "フィードに表示するアイテム数。",
|
||||
"rss-url": "RSS URL"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS-feed",
|
||||
"description": "Genereert een RSS-feed voor de website.<br>De URL van deze feed is https://voorbeeld.nl/rss.xml"
|
||||
},
|
||||
"amount-of-items": "Aantal items",
|
||||
"amount-of-items-to-show-on-the-feed": "Aantal items om op te nemen in de feed.",
|
||||
"rss-url": "URL voor RSS-feed"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS-канал",
|
||||
"description": "Этот плагин создаёт RSS-канал для вашего сайта<br/>Канал доступен по URL https://example.com/rss.xml"
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Количество позиций в RSS-канале.",
|
||||
"rss-url": "RSS URL"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"plugin-data":
|
||||
{
|
||||
"name": "RSS Beslemesi",
|
||||
"description": "Bu eklenti, sitenizin RSS beslemesini üretir.<br>Besleme URL'si https://example.com/rss.xml gibi görünür."
|
||||
},
|
||||
"amount-of-items-to-show-on-the-feed": "Özet akışında gösterilecek öğe miktarı.",
|
||||
"rss-url": "RSS URL"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"author": "Bludit",
|
||||
"email": "",
|
||||
"website": "https://plugins.bludit.com",
|
||||
"version": "3.22.0",
|
||||
"releaseDate": "2026-05-10",
|
||||
"license": "MIT",
|
||||
"compatible": "3.22",
|
||||
"notes": ""
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
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 class="alert alert-primary" role="alert">';
|
||||
$html .= $this->description();
|
||||
$html .= '</div>';
|
||||
|
||||
$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) {
|
||||
return urlencode($match[0]);
|
||||
}, $url);
|
||||
}
|
||||
|
||||
private function createXML()
|
||||
{
|
||||
global $site;
|
||||
global $pages;
|
||||
global $url;
|
||||
|
||||
// Amount of pages to show
|
||||
$numberOfItems = $this->getValue('numberOfItems');
|
||||
|
||||
// Get the list of public pages (sticky and static included)
|
||||
$list = $pages->getList(
|
||||
$pageNumber = 1,
|
||||
$numberOfItems,
|
||||
$published = true,
|
||||
$static = true,
|
||||
$sticky = true,
|
||||
$draft = false,
|
||||
$scheduled = false
|
||||
);
|
||||
|
||||
$xml = '<?xml version="1.0" encoding="UTF-8" ?>';
|
||||
$xml .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">';
|
||||
$xml .= '<channel>';
|
||||
$xml .= '<atom:link href="' . DOMAIN_BASE . 'rss.xml" rel="self" type="application/rss+xml" />';
|
||||
$xml .= '<title>' . $site->title() . '</title>';
|
||||
$xml .= '<link>' . $this->encodeURL($site->url()) . '</link>';
|
||||
$xml .= '<description>' . $site->description() . '</description>';
|
||||
$xml .= '<lastBuildDate>' . date(DATE_RSS) . '</lastBuildDate>';
|
||||
|
||||
// Get keys of pages
|
||||
foreach ($list as $pageKey) {
|
||||
try {
|
||||
// Create the page object from the page key
|
||||
$page = new Page($pageKey);
|
||||
$xml .= '<item>';
|
||||
$xml .= '<title>' . $page->title() . '</title>';
|
||||
$xml .= '<link>' . $this->encodeURL($page->permalink()) . '</link>';
|
||||
$xml .= '<image>' . $page->coverImage(true) . '</image>';
|
||||
$xml .= '<description>' . Sanitize::html($page->contentBreak()) . '</description>';
|
||||
$xml .= '<pubDate>' . date(DATE_RSS, strtotime($page->getValue('dateRaw'))) . '</pubDate>';
|
||||
$xml .= '<guid isPermaLink="false">' . $page->uuid() . '</guid>';
|
||||
$xml .= '</item>';
|
||||
} catch (Exception $e) {
|
||||
// Continue
|
||||
}
|
||||
}
|
||||
|
||||
$xml .= '</channel></rss>';
|
||||
|
||||
// New DOM document
|
||||
$doc = new DOMDocument();
|
||||
$doc->formatOutput = true;
|
||||
$doc->loadXML($xml);
|
||||
return $doc->save($this->workspace() . 'rss.xml');
|
||||
}
|
||||
|
||||
public function install($position = 0)
|
||||
{
|
||||
parent::install($position);
|
||||
return $this->createXML();
|
||||
}
|
||||
|
||||
public function post()
|
||||
{
|
||||
parent::post();
|
||||
return $this->createXML();
|
||||
}
|
||||
|
||||
public function afterPageCreate()
|
||||
{
|
||||
$this->createXML();
|
||||
}
|
||||
|
||||
public function afterPageModify()
|
||||
{
|
||||
$this->createXML();
|
||||
}
|
||||
|
||||
public function afterPageDelete()
|
||||
{
|
||||
$this->createXML();
|
||||
}
|
||||
|
||||
public function siteHead()
|
||||
{
|
||||
return '<link rel="alternate" type="application/rss+xml" href="' . DOMAIN_BASE . 'rss.xml" title="RSS Feed">' . PHP_EOL;
|
||||
}
|
||||
|
||||
public function beforeAll()
|
||||
{
|
||||
$webhook = 'rss.xml';
|
||||
if ($this->webhook($webhook)) {
|
||||
// Send XML header
|
||||
header('Content-type: text/xml');
|
||||
$doc = new DOMDocument();
|
||||
|
||||
// Load XML (external entity loading is disabled by default in PHP 8.0+)
|
||||
$doc->load($this->workspace() . 'rss.xml');
|
||||
|
||||
// Print the XML
|
||||
echo $doc->saveXML();
|
||||
|
||||
// Stop Bludit execution
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user