<?php
/*
 ########################################################################
#                                                                        #
#           Version 4       /                        /   /               #
#          -----------__---/__---__------__----__---/---/-               #
#           | /| /  /___) /   ) (_ `   /   ) /___) /   /                 #
#          _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___               #
#                       Free Content / Management System                 #
#                                   /                                    #
#                                                                        #
#                                                                        #
#   Copyright 2005-2006 by webspell.org                                  #
#                                                                        #
#   visit webSPELL.org, webspell.info to get webSPELL for free           #
#   - Script runs under the GNU GENERAL PUBLIC LICENSE                   #
#   - It's NOT allowed to remove this copyright-tag                      #
#   -- http://www.fsf.org/licensing/licenses/gpl.html                    #
#                                                                        #
#   Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at),   #
#   Far Development by Development Team - webspell.org                   #
#                                                                        #
#   visit webspell.org                                                   #
#                                                                        #
 ########################################################################
*/

if($rubricID) $only = "AND rubricID='".$rubricID."'";
else $only='';

$ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' ".$only." AND intern<=".isclanmember($userID)." ORDER BY date DESC LIMIT 0,".$maxheadlines);
echo'<table width="100%" cellspacing="0" cellpadding="2">';
while($ds=mysql_fetch_array($ergebnis)) {
    $date=date("d.m", $ds[date]);
	$time=date("H:i", $ds[date]);
	if(!isset($lang)) $lang=$ds[lang1];
	if($lang==$ds[lang1]) {
	    if($ds[headline1]) $headlines = $ds[headline1];
		else $headlines = $ds[headline2];
	}
	else {
	    if($ds[headline2]) $headlines = $ds[headline2];
		else $headlines = $ds[headline1];
	}
	$news_id=$ds[newsID];
	
	if(strlen($headlines)>$maxheadlinechars) {
	    $headlines=substr($headlines, 0, $maxheadlinechars);
		$headlines.='..';
	}	
	
	$headlines=clearfromtags($headlines);
	
	$languages=cleartext('[flag]'.$ds[lang1].'[/flag]');
	if($ds[headline2]) $language.=cleartext('[flag]'.$ds[lang2].'[/flag]');
 
    eval ("\$headlines = \"".gettemplate("headlines")."\";");
    echo $headlines;
}
echo'</table>';
unset($rubricID);
?>
