Location: PHPKode > projects > ACollab > archive.php
<?php
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2004  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* 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 may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/
// $Id: archive.php 66 2004-03-16 20:10:48Z joel $

define('AC_INCLUDE_PATH', 'include/');

require(AC_INCLUDE_PATH.'vitals.inc.php');
authenticate(USER_CLIENT, USER_GROUP_ADMIN);

$_SECTION[0][0] = _AC('home');
$_SECTION[0][1] = 'home.php';
$_SECTION[1][0] = _AC('archive');
$_SECTION[1][1] = 'archive.php';


require(AC_INCLUDE_PATH.'header.inc.php');

echo '<h4>'._AC('news_and_announcements').'</h4>';

	$sql	= "SELECT * FROM ".TABLE_PREFIX."news WHERE group_id=$_SESSION[group_id] ORDER BY date DESC";
	$result	= mysql_query($sql, $db);

	if ($row = mysql_fetch_array($result)) {
		echo '<table width="70%" align="center"><tr><td>';
		do {
			echo '<a name="'.$row['news_id'].'"></a>';

			echo '<h5>'.$row['subject'].'</h5>';
			echo '<p width="75%"><small><small class="date"><i>'.AT_date(_AC('news_date_format'), $row['date'], AT_DATE_MYSQL_DATETIME).'</i></small> ';
			
			echo nl2br($row['body']);
				
			echo '</small></p>';
		} while ($row = mysql_fetch_array($result));
		echo '</td></tr></table>';
	
	} else {
		echo '<p>'._AC('no_news_found').'</p>';
	}

	require(AC_INCLUDE_PATH.'footer.inc.php');
?>
Return current item: ACollab