<div class="right-news">
<?php $hirek_lista = $this->mnews->get_latest(15, $this->muser->user['lang'], true, 'fresh');?>
<?$hirek_listaja=array();?>
	<?if($hirek_lista):?>
	<?foreach($hirek_lista as $lista):?>
	    <?$datum=$lista->news_y. '-' . $lista->news_m . '-' . $lista->news_d;?>
		<?$lista->datum= date('D, d M Y H:i:s +0200', strtotime($datum));?>
		<?array_push($hirek_listaja,$lista);?>
	    <?usort($hirek_listaja,"hasonlito")?>
	
	
	
	
	
	<?endforeach;?>
		<h2><?=lang('latest_news')?> </h2>
		<a href="http://<?=$_SERVER['SERVER_NAME']?>/rss/" alt="RSS Feed"><img src="http://cadline.hu/public/img/Feed-icon.png"></a>
		<ul style="margin-top: 0px;">
			<?foreach($hirek_listaja as $hir):?>
			    <?$datum=$hir->news_y . '-' . $hir->news_m . '-' .$hir->news_d;?>
				<li>
				<?if($hir->url):?><?=anchor('news/show/'.$hir->url,$hir->news_title)?>
				<?else:?><?=anchor('news/show/'.$hir->news_id, $hir->news_title)?>
				<?endif;?>
				</li>
			<?endforeach;?>
		</ul>
	<?endif;?>
	<?php $arch_hirek_lista = $this->mnews->get_latest(20, $this->muser->user['lang'], true, 'arch');?>
	<?/*Itt kezd�dik egy pr�ba*/?>
	<?$arch_lista=array();?>
	<?if($arch_hirek_lista):?>
	    <?foreach($arch_hirek_lista as $lista):?>
	        <?$datum=$lista->news_y . '-' . $lista->news_m . '-' . $lista->news_d;?>
	        <?$lista->datum = date('D, d M Y H:i:s +0200', strtotime($datum));?>
			<?array_push($arch_lista,$lista);?>
			<?usort($arch_lista,"hasonlito");?>
		<?endforeach;?>
	<?/*itt v�gz�dik*/?>
		<div id="news_arch" >
		<ul>
			<?foreach($arch_lista as $hir):?>
				<li><?=anchor('news/show/'.$hir->news_id, $hir->news_title)?></li>
			<?endforeach;?>
		</ul>
		</div>
	<?endif;?>
	<?php
   function hasonlito( $a, $b ){
	if ( strtotime($a->datum) == strtotime($b->datum) )
		return 0;
	if ( strtotime($a->datum) > strtotime($b->datum) )
		return -1;
	return 1;
    }


   ?>
</div>

