<?if( $_SERVER['REMOTE_ADDR'] == BENTIIP && strstr($_SERVER['HTTP_USER_AGENT'],UBUNTU) || MEHET == "igen" ):?>


<? $tomb = $this->phpsession->get('fuser'); ?>
<?if( $tomb ):?>


<script type="text/javascript">

jQuery(document).ready(function($){
    $('#edit_temakor_dialog').dialog({
        autoOpen: false,
        modal: true,
        width: 560
    });
	
	
    $('#new_temakor_dialog').dialog({
        autoOpen: false,
        modal: true,
        width: 560
    });
	
	
    // téma szerkesztés
    $('.edit_anchor').click(function(){
        //populate the dialog
        var con = $('#modositas_form');
        var event = $(this).parents('.temakorcim');
        
        $('#ujnev', con).val(event.attr('temakorcime'));
        $('#tid', con).val(event.attr('tid'));
        
        //open the dialog
        $('#edit_temakor_dialog').dialog('open');
        $('div.ui-dialog-titlebar').css({'display': 'none'});
        $('div..ui-widget-content').css({'background': 'none'});
        $('div..ui-widget-content').css({'border': 'none'});
        $('div..ui-icon').css({'background': 'none'});
        
        return false;
    });
	
	
    // új téma
    $('.new_anchor').click(function(){
        //open the dialog
        $('#new_temakor_dialog').dialog('open');
        $('div.ui-dialog-titlebar').css({'display': 'none'});
        $('div..ui-widget-content').css({'background': 'none'});
        $('div..ui-widget-content').css({'border': 'none'});
        $('div..ui-icon').css({'background': 'none'});
  //      $('div.ui-widget-content').css({'height': '0px'});
        return false;
    });
    
    $('.bezargomb').click(function(){
        $('#new_temakor_dialog').dialog('close');
        $('#edit_temakor_dialog').dialog('close');
        return false;
    });
    
    //alert("vége");
});

</script>


<div class="forummodositas" style="display: none;" id="edit_temakor_dialog">
	<div class="forumpopuptop"></div>
	<div class="forumpopup">
		<h2><?=lang('forum_temaatnev')?></h2>
		<form action="/forum/tatnevez" method="post" id="modositas_form">
		<input type="hidden" name="atnevez" id="atnevez" value="true" />
		<input type="hidden" name="tid" id="tid" value="" />
		<input type="text" style="width: 475px; margin-bottom: 10px;" name="ujnev" id="ujnev" value=""/>
		<div style="text-align: right;">
		<input type="submit" value="OK" class="ngomb" style="width: 120px; background: url('/public/img/forum/stilus/button_normal.png');" />
		<button class="bezargomb megsem" style="width: 120px; background: url('/public/img/forum/stilus/button_grey.png');">
			<?=lang('forum_megsem')?>
		</button>
		</div>
		</form>
	</div>
	<div class="forumpopupbottom"></div>
</div>


<div class="forummodositas" style="display: none;" id="new_temakor_dialog">
	<div class="forumpopuptop"></div>
	<div class="forumpopup">
		<h2><?=lang('forum_ujtemanyit')?></h2>
		<form action="/forum/ujtema" method="post" id="uj_form">
		<input type="hidden" name="nyit" id="nyit" value="true" />
		<input type="text" style="width: 475px; margin-bottom: 10px;" name="temacim" id="temacim" />
		<div style="text-align: right;">
		<input type="submit" value="OK" class="ngomb" style="width: 120px; background: url('/public/img/forum/stilus/button_normal.png');" />
		<button class="bezargomb megsem" class="megsem" style="width: 120px; background: url('/public/img/forum/stilus/button_grey.png');">
			<?=lang('forum_megsem')?>
		</button>
		</div>
		</form>
	</div>
	<div class="forumpopupbottom"></div>
</div>
<?endif;?>






<div class="temaktop"></div>
<div class="temak">


<h2 class='forumh2'>
	<a href="/forum/temakorok"><?=lang('forum_topics')?></a>
	<img src="/public/img/forum/stilus/big_arrow.png" alt="nyil" />
	<?=$temakorcim?>
</h2>

<div align="right"><div class="gombst" style="background: url('/public/img/forum/stilus/button_back.png'); width: 110px; float: right; cursor: pointer;" onclick="location.href='/forum/temakorok'"><?=lang('forum_vissza')?></div></div>
<?php
	$tomb = $this->phpsession->get('fuser');?>
	
	<?if($this->phpsession->get('fuser')):?>
		<div class="gombst new_anchor" style="background: url('/public/img/forum/stilus/button_new.png'); width: 110px; float: right; margin-right: 8px; cursor: pointer;"><?=lang('forum_ujtema')?></div><br />
		<br />
	<?endif;?>
	
	<div class="clear"></div>
	
	<?if($temak):?>
	<?if(eng()):?>
	<?$this->load->view("forum/temalapozas")?>
	<?endif;?>
	
	<div>
	<table>
		<th><?=lang('forum_temcim')?></th>
		<th width="100px" align="center"><?=lang('forum_hszek')?></th>
		<th width="160px" align="center"><?=lang('forum_uthsz')?></th>
		<?if( isset($moderator) && $moderator):?>
		<th width="50px" align="center">&nbsp;</th>
		<?endif;?>
	
<?
	foreach($temak as $tema){
		?>
		<tr>
			<td>
				<h2 style="margin-bottom: 0px; padding: 0px;"><a href="/forum/listaz/<?=$tema->tema_id?>" title="<?=$tema->cim?>" ><?=$tema->cim?></a></h2>
				<span class="tdalso"><?=lang('forum_letrehoz')?>: <?=$tema->megnyito?></span>
			</td>
			<td align=center>
				<span style="font-size: 1.3em;"><strong><?=$tema->szam?></strong></span>
			</td>
			<td>
				
				<?
				$ido = time() - strtotime($tema->datum);
				if($ido < 60){
					$ido = '0 '.lang('forum_perce1');
					
				}elseif($ido < 60*60){
					$x = round($ido/60);
					if($x == 1) $ido = $x.' '.lang('forum_perce1');
					else $ido = $x.' '.lang('forum_perce');
					
				}elseif($ido < 60*60*24){
					$x = round($ido/(60*60));
					if($x == 1) $ido = $x.' '.lang('forum_oraja1');
					else $ido = $x.' '.lang('forum_oraja');
					
				}elseif($ido < 60*60*24*7){
					$x = round($ido/(60*60*24));
					if($x == 1) $ido = $x.' '.lang('forum_napja1');
					else $ido = $x.' '.lang('forum_napja');
					
				}elseif($ido < 60*60*24*28){
					$x = round($ido/(60*60*24*7));
					if($x == 1) $ido = $x.' '.lang('forum_hete1');
					else $ido = $x.' '.lang('forum_hete');
					
				}elseif($ido < 60*60*24*365){
					$x = round($ido/(60*60*24*28));
					if($x == 1) $ido = $x.' '.lang('forum_honapja1');
					else $ido = $x.' '.lang('forum_honapja');
					
				}else{
					$x = round($ido/(60*60*24*365));
					if($x == 1) $ido = $x.' '.lang('forum_eve1');
					$ido = $x.' '.lang('forum_eve');
				}
				
				if($tema->datum=="2010-01-01 10:10:10")
					$ido = "-";
				?>
				
				
				<?=$ido?><br />
				<span class="tdalso"><?=$tema->utolsouser?></span>
			</td>
		<?if( isset($moderator) && $moderator ):?>
		<td>
			<a style="cursor: pointer; margin-right: 15px;" onclick="if(confirm('<?=lang('forum_torlesmegerosites')?>')){window.location.href='http://<?=$_SERVER['SERVER_NAME']?>/forum/tematorol/<?=$tema->tema_id?>'} else{};"> <img src="/public/img/forum/stilus/icon_delete.png" alt="<?=lang('forum_torles')?>" title="<?=lang('forum_torles')?>" />
			</a>
			<span class="temakorcim" temakorcime="<?=$tema->cim?>" tid="<?=$tema->tema_id?>">
			<a href="/forum/tatnevez/<?=$tema->tema_id?>" class="edit_anchor">
				<img src="/public/img/forum/stilus/icon_edit.png" alt="<?=lang('forum_atnevez')?>" title="<?=lang('forum_atnevez')?>" />
			</a>
			</span>
		</td>
		<?endif;?>
		</tr>
		<?
	} ?>
	</table>
	</div>
	<?$this->load->view("forum/temalapozas")?>
	<?endif;?>
	
</div>

<div class="temakbottom"></div>









<?else:?>





<div style="width: 600px">
<h2><?if(isset($temakorcim)):?><?=$temakorcim?><?else:?><?=lang('forum_topics')?><?endif;?> <?=lang('forum_topic')?></h2><br />

<div align="right"><div class="gombst" style="width: 90px"><a href="http://<?=$_SERVER['SERVER_NAME']?>/forum/temakorok"><?=lang('forum_vissza')?></a></div></div>
<?php
	$tomb = $this->phpsession->get('fuser');?>
	
	<?if($this->phpsession->get('fuser')):?>
		<div class="gombst"><a href="http://<?=$_SERVER['SERVER_NAME']?>/forum/ujtema"><?=lang('forum_ujtema')?></a></div><br />
		<br />
	<?endif;?>
	
	<?if($temak):?>
	<?if(eng()):?>
	<?$this->load->view("forum/temalapozas")?>
	<?endif;?>
	
	<div class="temak">
	<table>
		<th width=150px align="center"><?=lang('forum_temcim')?></th>
		<th align="center"><?=lang('forum_letrehoz')?></th>
		<th align="center"><?=lang('forum_hszek')?></th>
		<th align="center"><?=lang('forum_uthsz')?></th>
		<?if( isset($moderator) && $moderator):?><th align="center"><?=lang('forum_torles')?> | <?=lang('forum_atnevez')?></th><?endif;?>
	
<?	$bg = "#FFEEBB";
	foreach($temak as $tema){
		print "<tr>\n";
		print "\t<td><a href=\"http://".$_SERVER['SERVER_NAME']."/forum/listaz/".$tema->tema_id."\" title=\"".$tema->cim."\">" . $tema->cim . "</a></td>\n";
		print "\t<td>" . $tema->megnyito . "</td>\n";
		print "\t<td align=center>" . $tema->szam . "</td>\n";
		print "\t<td>" . $tema->datum . "</td>\n";?>
		<?if( isset($moderator) && $moderator ):?>
		<td bgcolor=<?=$bg?>><a style="cursor: pointer" onclick="if(confirm('<?=lang('forum_torlesmegerosites')?>')){window.location.href='http://<?=$_SERVER['SERVER_NAME']?>/forum/tematorol/<?=$tema->tema_id?>'} else{};"><?=lang('forum_torles')?></a> |  <a href="http://<?=$_SERVER['SERVER_NAME']?>/forum/tatnevez/<?=$tema->tema_id?>"><?=lang('forum_atnevez')?></a></td>
		<?endif;?>
		</tr>
		<?
	} ?>
	</table>
	</div>
	<?$this->load->view("forum/temalapozas")?>
	
	<?else:?>
		<b><?=lang('forum_nincstema')?></b>
	<?endif;?>
	
</div>



<?endif;?>