Last active
January 31, 2021 04:25
-
-
Save ertugrulturan/a1486ae14ce89e3662dcf261f913bfdb to your computer and use it in GitHub Desktop.
RSS - PHP Source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'config.php'; | |
function lambda($a){ | |
$a = str_replace("&", "&", $a); | |
return $a; | |
} | |
header("Content-Type: text/xml"); | |
echo '<?xml version="1.0" encoding="utf-8"?> | |
<rss version="2.0"> | |
<channel> | |
<title>RSS Source - T13R</title> | |
<description></description> | |
<link>https://obir.ninja/</link> | |
<language>tr-TR</language> | |
'; | |
$veri = $db->prepare("SELECT * FROM icerikler ORDER BY icerik_id DESC"); | |
$veri->execute(); | |
$islem = $veri->fetchALL(PDO::FETCH_ASSOC); | |
foreach ($islem as $row) { | |
echo ' | |
<item> | |
<title>'.lambda($row["makale_baslik"]).'</title> | |
<description> | |
<![CDATA[<img src="'.$row["makale_resim"].'"><br> | |
'.lambda($row["makale_aciklama"]).' | |
]]> | |
</description> | |
<link>'.$row["makale_link"].'</link> | |
<image>'.$row["makale_resim"].'</image> | |
<pubDate>'.$row["makale_tarih"].'</pubDate> | |
</item> | |
'; | |
} | |
echo '</channel> | |
</rss> '; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment