mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-15 00:14:45 +02:00
Add enclosures support, see example in DemoBridge.
This commit is contained in:
parent
e7595391cd
commit
4deefdfd7d
3 changed files with 29 additions and 5 deletions
|
@ -36,6 +36,15 @@ class AtomFormat extends FormatAbstract{
|
|||
// We prevent content from closing the CDATA too early.
|
||||
$entryContent = is_null($data->content) ? '' : '<![CDATA[' . $this->sanitizeHtml(str_replace(']]>','',$data->content)) . ']]>';
|
||||
|
||||
// We generate a list of the enclosure links
|
||||
$entryEnclosure = "";
|
||||
|
||||
foreach($data->enclosures as $enclosure) {
|
||||
|
||||
$entryEnclosures .= "<link rel=\"enclosure\" href=\"".$enclosure."\"></link>";
|
||||
|
||||
}
|
||||
|
||||
$entries .= <<<EOD
|
||||
|
||||
<entry>
|
||||
|
@ -48,6 +57,7 @@ class AtomFormat extends FormatAbstract{
|
|||
<id>{$entryUri}</id>
|
||||
<updated>{$entryTimestamp}</updated>
|
||||
<content type="html">{$entryContent}</content>
|
||||
{$entryEnclosures}
|
||||
</entry>
|
||||
|
||||
EOD;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue