<?php $title = $fid ? $forum['name'] : '' . '新贴 - 社区';?>
<?php include_once tpl('globalHeader');?>
<?php if ($isAllowPost):?><?php echo ilink('发新贴',url('system',array('s'=>'bbs','c'=>'thread','a'=>'default','fid'=>$forum['fid'])));?>|<?php endif;?><?php echo ilink('精华',url('system',array('s'=>'bbs','a'=>'forum','filter'=>'digest','fid'=>$fid)));?>|<?php echo ilink('刷新',url('system',array('s'=>'bbs','a'=>'forum','fid'=>$fid)));?>|<?php echo ilink('思过涯',url('system',array('s'=>'bbs','a'=>'ban','fid'=>$fid)));?>
<br/>
<div class="nav"><?php echo date('n月d日');?>新帖</div>
<?php if (!empty($threads)):?>
    <div class="content">
	<?php $page = ($pageObj->getCurrentPage() - 1) * $pageObj->getPageSize();?>
	<?php foreach ($threads as $thread):?>
		<div class="comment"><?php echo ++$page;?>.<?php if ($thread['topped']):?><?php echo printImage('bbs/web/top_'.$thread['topped'].'.gif');?><?php endif;?><?php if ($thread['isdigest']):?><?php echo printImage('bbs/web/digest.gif', '精华', '精华');?><?php endif;?><?php if ($thread['islock']):?><b>[锁]</b><?php endif;?><?php echo ilink($this->filter($thread['subject']),url('system',array('s'=>'bbs','a'=>'thread','tid'=>$thread['id'])));?><span class="f">(回<?php echo $thread['replies'];?> 点<?php echo $thread['hits'];?>)</span>
            <br/>
            <span class="f">楼主:<?php echo ilink($this->filter(userName($thread['uid'])),url('system',array('s'=>'member','uid'=>$thread['uid'])));?></span>
            <br/>
            <span class="f">最后回复:<?php echo date('y/m/d H:i', $thread['createdate']);?></span>
        </div>
	<?php endforeach;?>
    </div>
    <div class="search">
	[共<?php echo $pageObj->getTotalRecord();?>贴 <?php echo $pageObj->getCurrentPage();?>/<?php echo $pageObj->getTotalPage();?>]
	<br/>
	<?php echo $pageObj->show();?>
	</div>
<?php else:?>
	本版块暂无新贴
<?php endif;?>

<div class="kind">本版块斑竹</div>
<div class="content">
<?php if (!empty($forum['forumadmin'])):?>
	<?php $forumAdmins = explode(',', trim($forum['forumadmin'],','));?>
	<?php foreach ($forumAdmins as $admin):?>
		<?php echo ilink(userName($admin),url('system',array('s'=>'member','uid'=>$admin)));?>
	<?php endforeach;;?>
<?php else:?>
	本版块暂无斑竹
<?php endif;?>
</div>
<?php echo date('n/d H:i:s');?>
<br/>
<?php if ($fid):?><?php echo $this->nav($fid);?><?php else:?><?php echo backLink();?><?php endif;?>
</html>