<div class="right-news">
<?php $hirek_news = $this->mnews->get_latest(15, $this->muser->user['lang'], true, 'fresh');?>
    <?$hirek_lista=array();?>
	<?$this->load->model('mevents');?>
	<?foreach($hirek_news as $hir):?>
	    <?{?>
		    <?$hir2='';?>
		    <?$datum=$hir->news_d. '-' . $hir->news_m. '-' . $hir->news_d;?>
			<?$hir2->datum = date('D, d M Y H:i:s +0200', strtotime($datum));?>
		    <?$hir2->title = $hir->news_title;?>
			<?$hir2->short = $hir->news_short;?>
			<?if(hun()):?>
			    <? $hir2->url = "http://www.archline.hu/news/show/" . $hir->news_id;?>
			<?else:?>
			    <?$hir2->url = "http://www.archlinexp.com/news/show/" . $hir->news_id;?>
			<?endif;?>
		    <?array_push($hirek_lista, $hir2);?>
		<?}?>
	<?endforeach;?>
	<?$esemenyek = $this->mevents->get_rss($this->muser->user['lang']);?>
	<?foreach($esemenyek as $hir):?>
	    <?$hir2='';?>
		<?$hir2->datum = date('D, d M Y H:i:s +0200', $hir->datum);?>
		<?$hir2->title = $hir->title;?>
		<?$hir2->short = substr($hir->short,0,128) . "...";?>
		<?array_push($hirek_lista, $hir2);?>
	<?endforeach;?>
	<?usort($hirek_lista,"hasonlito");?>
	<?$data['hirek_lista']=$hirek_lista;?>
	<?if($hirek_lista):?>
		<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_lista as $hir):?>
				<li><?=anchor('news/show/'.$hir->news_id, $hir->news_title)?></li>
			<?endforeach;?>
		</ul>
	<?endif;?><?echo"itt vagyok";?>
	<?php $arch_hirek_news = $this->mnews->get_latest(20, $this->muser->user['lang'], true, 'arch');?>
	
	<?if($arch_hirek_news):?>
		<div id="news_arch" >
		<ul>
			<?foreach($arch_hirek_news as $hir):?>
				<li><?=anchor('news/show/'.$hir->news_id, $hir->news_title)?></li>
			<?endforeach;?>
		</ul>
		</div>
	<?endif;?>
</div>

<?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;
    }


?>