ACC SHELL
<?php
require_once("../include/config.php");
echo "<"."?xml version=\"1.0\" encoding=\"utf-8\"?".">
<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:media=\"http://search.yahoo.com/mrss/\">
";
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Type: text/xml; charset=utf-8');
$sql = "
SELECT
A.id, A.mr_url, A.nazev, A.caszalozeni, A.detail, A.vimeo
FROM [videa] A
LEFT JOIN [videa_kanaly] ON A.id = videa_kanaly.idvidea
WHERE A.schvaleno = 1 AND A.pripraveno IS NOT NULL AND A.zobrazit = 1 AND videa_kanaly.idkanaly = 9 AND A.vimeo > 0
ORDER BY A.id DESC LIMIT 0,8
";
$result = dibi::query($sql);
$videa = "";
$lastDate = "";
foreach($result as $n => $row) {
$videa .= "
<item>
<title>".htmlspecialchars($row->nazev, ENT_QUOTES)."</title>
<link>https://www.oltv.cz/".$row->mr_url."-video-".$row->id.".html?utm_source=olomouc_eu&utm_medium=partner&utm_campaign=partner_iframe_olomouc_eu</link>
<description>".htmlspecialchars(strip_tags(trim($row->detail)), ENT_QUOTES)."</description>
<pubDate>".gmdate("D, d M Y H:i:s", strtotime($row->caszalozeni))." GMT"."</pubDate>
<media:thumbnail url=\"https://www.oltv.cz/data/videa/".$row->id."/".$row->vimeo.".jpg\" />
</item>
";
if ($n == 0) { $lastDate = gmdate("D, d M Y H:i:s", strtotime($row->caszalozeni))." GMT"; }
}
echo "<channel>
<title>OLTV.cz - Olomoucká televize</title>
<link>http://www.oltv.cz/</link>
<description>OLTV.cz - Olomoucká televize</description>
<language>cs</language>
<pubDate>".date(DateTime::RFC2822)."</pubDate>
<lastBuildDate>".$lastDate."</lastBuildDate>
<generator>http://www.oltv.cz</generator>
<webMaster>oltv@esmedia.cz (oltv)</webMaster>
";
echo $videa;
echo "</channel>
</rss>
";
ACC SHELL 2018