<?php
include("cnx.php");
?>
<?php echo("<?"); ?>xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>iYell !</title>
<description>Last yells</description>
<lastBuildDate><?php echo(date("r")); ?></lastBuildDate>
<link><?php echo($url); ?></link>
<?php
if(is_numeric($_GET['start'])){
$start = $_GET['start'];
}else{
$start = 0;
}
$sql = "SELECT * FROM iyell order by date desc LIMIT ".$start.",20;";
$req = mysql_query($sql);
while($yell = @mysql_fetch_array($req)){
$text = $yell["text"];
$author = $yell["author"];
$link = $yell["link"];
$id = $yell["id"];
$date = $yell['date'];
if(strtolower(substr($link,-3)) == "jpg" || strtolower(substr($link,-3)) == "png" || strtolower(substr($link,-3)) == "gif" || strtolower(substr($link,-3)) == "bmp"){
$linktype = "img";
}else{
$linktype = "a";
}
if(substr($link,0,7) != "mailto:" && substr($link,0,7) != "http://" && substr($link,0,8) != "https://" && substr($link,0,6) != "ftp://" && $link != ""){
$link = "http://" . $link;
}
if($link == ""){
$link = $url.$id;
}
echo("
<item>
<title>Yell nr. ". $id ."</title>
<description>". htmlentities($text,ENT_QUOTES,"UTF-8") ."</description>
<pubDate>". date("r",$date) ."</pubDate>
<link>". htmlentities($link,ENT_QUOTES,"UTF-8") ."</link>
</item>
");
}
?>
</channel>
</rss>