<?php
include("head.php");
?>
<a href="send.php" id="send">I WANT YO YELL !</a>
<?php
if(is_numeric($_GET['start'])){
$start = $_GET['start'];
}else{
$start = 0;
}
$sql = "SELECT * FROM iyell order by date desc LIMIT ".$start.",51;";
$req = mysql_query($sql);
$i = 0;
while($yell = @mysql_fetch_array($req)){
$i++;
if($i <= 50){
$text = htmlentities($yell["text"],ENT_QUOTES,"UTF-8");
$author = htmlentities($yell["author"],ENT_QUOTES,"UTF-8");
$link = htmlentities($yell["link"],ENT_QUOTES,"UTF-8");
$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("<p><strong><a href=\"". $url . $id."\">Nr. ". $id."</a></strong></p><div class='yell'>");
if($linktype == "img"){
echo("<img src=\"". $link ."\" alt=\"". $text ."\" >");
}
if($text == ""){
echo("Nothing to say");
}else{
echo($text);
}
if($linktype == "img"){
echo("<p style='clear: both;'></p>");
}
echo("</div>");
echo("<div class='author'>");
?><div class="fb-like" data-href="<?php echo($url.$id); ?>" data-send="true" data-layout="button_count" data-width="150" data-show-faces="false"></div> <?php
echo("<a href=\"". $link ."\" target=\"_blank\">".$author." - ". $link ."</a> ". date("r",$date) ." <a href=\"contact.php?id=". $id ."\">Report abuse</a></div>");
echo("
<div class=\"fb-comments\" data-href=\"". $url.$id ."\" data-num-posts=\"2\" data-width=\"500\"></div><br><hr>");
}
}
echo("<p id='pages'><a href='/'>Main page</a> ");
if($start > 0){
echo("<a href='last.php?start=".($start-50)."'>« Previous</a> ");
}
if($i == 51){
echo("<a href='last.php?start=".($start+50)."'>Next »</a> ");
}
echo("</p>");
include("foot.php");
?>