<?php 
require("common_begin.php");

$newsID = $_GET['id'];
if (!isset($newsID))
  die("no news ID set");
  
// clip off the 'news_' of the div ID
$newsID = substr($newsID, 5);

$lst = Listopia::getInstance();

if ($lst->isLoggedIn())
{
  $query = $lst->Database()->select(array(
                      'table' => 'news',
                      'condition' => 'news.news_id = ' . ((int)$newsID),
                      'limit' => 1
                      ));
  if (!empty($query[0]))
  {
    echo stripslashes($query[0]['news']['message']);
  }
  else
  {
    echo "[unknown entry]";
  }
}
else
{
  echo "[not logged in]";
}
  
require("common_end.php");

