gino-news  2.1.0
Modulo News per gino CMS
feed_rss.php
Go to the documentation of this file.
1 <?php
16 ?>
17 <? namespace Gino\App\News; ?>
18 <? //@cond no-doxygen ?>
19 <?= '<?xml version="1.0" encoding="utf-8"?>' ?>
20 <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
21  <channel>
22  <atom:link href="<?= $request->absolute_url ?>" rel="self" type="application/rss+xml" />
23  <title><?= $title ?></title>
24  <link><?= $request->root_absolute_url ?></link>
25  <description><?= $description ?></description>
26  <language><?= $request->session->lng ?></language>
27  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
28  <?php if(count($news) > 0): ?>
29  <?php foreach($news as $n): ?>
30  <?php $id = \Gino\htmlChars($n->id); ?>
31  <?php $title = \Gino\htmlChars($n->ml('title')); ?>
32  <?php $text = \Gino\htmlChars($n->ml('text')); ?>
33  <?php $text = str_replace("src=\"", "src=\"".$request->root_absolute_url, $text); ?>
34  <?php $text = str_replace("href=\"", "href=\"".$request->root_absolute_url, $text); ?>
35  <?php $date = \date('d/m/Y', strtotime($n->date)); ?>
36  <item>
37  <title><?= sprintf('%s. %s', $date, $title) ?></title>
38  <link><?= $request->root_absolute_url . $n->getUrl() ?></link>
39  <description>
40  <![CDATA[
41  <?= $text ?>
42  ]]>
43  </description>
44  <guid><?= $request->root_absolute_url . $n->getUrl() ?></guid>
45  </item>
46  <?php endforeach ?>
47  <?php endif ?>
48  </channel>
49 </rss>
50 <? // @endcond ?>
Namespace dell'applicazione News