ACC SHELL
<?php
require "../include/config.php";
echo "<"."?xml version=\"1.0\" encoding=\"utf-8\"?".">
<rss version=\"2.0\">
";
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, kategorie.nazev AS kategorie
FROM [videa] A
LEFT JOIN [videa_kategorie] ON videa_kategorie.idvidea = A.id
LEFT JOIN [kategorie] ON videa_kategorie.idkategorie = kategorie.id
WHERE A.schvaleno = 1 AND A.pripraveno IS NOT NULL AND A.zobrazit = 1 AND A.sdilet = 1
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)."</title>
<link>https://www.oltv.cz/".$row->mr_url."-video-".$row->id.".html</link>
<description>".strip_tags(str_replace(" ","",$row->detail))."</description>
<pubDate>".gmdate("D, d M Y H:i:s", strtotime($row->caszalozeni))." GMT"."</pubDate>
<category>".$row->kategorie."</category>
<enclosure url=\"https://www.oltv.cz/data/videa/".$row->id."/".$row->vimeo.".jpg\" length=\"23562\" type=\"image/jpeg\" />
<guid isPermaLink=\"false\">https://www.oltv.cz/".$row->mr_url."-video-".$row->id.".html</guid>
</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>https://www.oltv.cz/</link>
<description>OLTV.cz - Olomoucká televize</description>
<language>cs</language>
<pubDate>".date(DateTime::RFC2822)."</pubDate>
<lastBuildDate>".$lastDate."</lastBuildDate>
<webMaster>oltv@esmedia.cz (oltv)</webMaster>
";
echo $videa;
echo "</channel>
</rss>
";
ACC SHELL 2018