<?php

  /*

      news.php

      News page. Shows the current news for the system. [Commented]

      Changelog:
        2006-01-14 dave: Cleaned up code for v1.0 release

      ## PAGE CONTAINS HANDYANDY MYSQL MODS ##
      ## Copyright (C) 2005 Andy Deakin (handyandy.org.uk) ##

      ----

      Copyright (C) 2003  Central Manchester CLC
      Copyright (C) 2003  David Thorne (davethorne@gmail.com)

      This program is free software; you can redistribute it and/or
      modify it under the terms of the GNU General Public License
      as published by the Free Software Foundation version 2.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

  */

  // Destroy any session that might exist effectively logging off
  session_start();
  session_destroy();

  // Page Title
  $ptitle = 'News';

  // Includes
  require_once 'system/db.php';
  require_once 'system/lang.php';
  require 'header.php';

  // Language selection
  set_text_domain("news");
?>

  <h1><?php echo gettext("News")?></h1>
  <h2><?php echo gettext("Here you will find all the news updates, the latest of which are displayed on the front page.")?></h2>
  
  <div class="block">
<?php
  $result = db_recordset("SELECT date,content FROM tbl_News WHERE frontpagepara=0 and lang='".$language."' ORDER BY date DESC, id DESC");
  foreach ($result as $news) {
    echo "    <h3>[{$news['date']}]</h3>\n";
    echo "<p>". nl2br($news['content'])."</p>\n";
  }
?>
  </div>

<?php

  // Include
  require 'footer.php';
?>
