<?php

if ( $config['no_news'] != '0' && $config['no_news'] != '' ) {

	$data =& $osDB->getAll( 'SELECT * FROM ! order by date desc limit 0,!', array( NEWS_TABLE ,$config['no_news'] ) );

	foreach( $data as $index => $row ) {

		$row['date'] = date(get_lang('DISPLAY_DATE_FORMAT'), $row['date'] );

	// how many characters should be displayed

		$arrtext = explode( ' ', $row['text'], $config['length_news'] + 1);

		$arrtext[$config['length_news']] = '';

		$row['text'] = trim(implode( ' ', $arrtext)) . '...';

		$data[ $index ] = $row;
	}

	$t->assign ( 'news_data', $data );
	unset($data, $row);
}
?>