<?php


if (!defined("IN_HABBO")) { header("Location: ../index.php"); exit; }

// So many queries just to make it look pretty..

$news_1_query = mysql_query("SELECT id, title, datestr, topstory_image, seo_link, snippet FROM site_news ORDER BY timestamp DESC LIMIT 1");
$news_2_query = mysql_query("SELECT id, title, datestr, topstory_image, seo_link, snippet FROM site_news ORDER BY timestamp DESC LIMIT 1,2");
$news_3_query = mysql_query("SELECT id, title, datestr, topstory_image, seo_link, snippet FROM site_news ORDER BY timestamp DESC LIMIT 2,3");
$news_4_query = mysql_query("SELECT id, title, datestr, topstory_image, seo_link, snippet FROM site_news ORDER BY timestamp DESC LIMIT 3,4");
$news_5_query = mysql_query("SELECT id, title, datestr, topstory_image, seo_link, snippet FROM site_news ORDER BY timestamp DESC LIMIT 4,5");

$news_1_row = mysql_fetch_assoc($news_1_query);
$news_2_row = mysql_fetch_assoc($news_2_query);
$news_3_row = mysql_fetch_assoc($news_3_query);
$news_4_row = mysql_fetch_assoc($news_4_query);
$news_5_row = mysql_fetch_assoc($news_5_query);

$news_1_title = $news_1_row['title'];
$news_1_snippet = $news_1_row['snippet'];
$news_1_datestr = HabboCMSTEXT($news_1_row['datestr']);
$news_1_topstory_image = HabboCMSTEXT($news_1_row['topstory_image']);
$news_1_link = HabboCMSTEXT($news_1_row['id']);
$news_1_link = HabboCMSTEXT($news_1_row['id']);
$news_1_seo = HabboCMSTEXT($news_1_row['seo_link']);


if(empty($news_1_title)){ $news_1_title = "Article non trouv&eacute;"; }
if(empty($news_1_snippet)){ $news_1_snippet = "Cet article n'existe pas encore."; }
if(empty($news_1_topstory_image)){ $news_1_topstory_image = "http://images.habbohotel.co.uk/c_images/Top_Story_Images/shabbolin_300x187_A.gif"; }

$news_2_title = $news_2_row['title'];
$news_2_snippet = $news_2_row['snippet'];
$news_2_datestr = HabboCMSTEXT($news_2_row['datestr']);
$news_2_topstory_image = HabboCMSTEXT($news_2_row['topstory_image']);
$news_2_link = HabboCMSTEXT($news_2_row['id']);
$news_2_seo = HabboCMSTEXT($news_2_row['seo_link']);

if(empty($news_2_title)){ $news_2_title = "Article non trouv&eacute;"; }
if(empty($news_2_snippet)){ $news_2_snippet = "Cet article n'existe pas encore"; }
if(empty($news_2_topstory_image)){ $news_2_topstory_image = "http://images.habbohotel.co.uk/c_images/Top_Story_Images/shabbolin_300x187_A.gif"; }

$news_3_title = $news_3_row['title'];
$news_3_snippet = $news_3_row['snippet'];
$news_3_datestr = HabboCMSTEXT($news_3_row['datestr']);
$news_3_topstory_image = HabboCMSTEXT($news_3_row['topstory_image']);
$news_3_link = HabboCMSTEXT($news_3_row['id']);
$news_3_seo = HabboCMSTEXT($news_3_row['seo_link']);

if(empty($news_3_title)){ $news_3_title = "Article non trouv&eacute;"; }
if(empty($news_3_datestr)){ $news_3_datestr = "Cet article n'existe pas encore"; }
if(empty($news_3_topstory_image)){ $news_3_topstory_image = "http://images.habbohotel.co.uk/c_images/Top_Story_Images/shabbolin_300x187_A.gif"; }

$news_4_title = $news_4_row['title'];
$news_4_snippet = $news_4_row['snippet'];
$news_4_datestr = HabboCMSTEXT($news_4_row['datestr']);
$news_4_link = HabboCMSTEXT($news_4_row['id']);
$news_4_seo = HabboCMSTEXT($news_4_row['seo_link']);

if(empty($news_4_title)){ $news_4_title = "Article non trouv&eacute;"; }
if(empty($news_4_datestr)){ $news_4_datestr = "Cet article n'existe pas encore"; }

$news_5_title = $news_5_row['title'];
$news_5_snippet = $news_5_row['snippet'];
$news_5_datestr = HabboCMSTEXT($news_5_row['datestr']);
$news_5_link = HabboCMSTEXT($news_5_row['id']);
$news_5_seo = HabboCMSTEXT($news_5_row['seo_link']);

if(empty($news_5_title)){ $news_5_title = "Article non trouv&eacute;"; }
if(empty($news_5_datestr)){ $news_5_datestr = "Cet article n'existe pas encore"; }

?>