<?php $title = $forum['name'] . ' - 社区';?>
<?php include_once tpl('globalHeader');?>
<?php echo $this->nav($fid);?>
<div class="nav"><?php if ($isAllowPost):?><?php echo ilink('发新贴',url('system',array('s'=>'bbs','c'=>'thread','a'=>'default','fid'=>$forum['fid'])));?>|<?php endif;?><?php if ($isAllowSearch):?><?php echo ilink('搜索',url('system',array('s'=>'bbs','a'=>'search','fid'=>$fid)));?>|<?php endif;?><?php echo ilink('新贴',url('system',array('s'=>'bbs','a'=>'new','fid'=>$fid)));?>|<?php echo ilink('精华',url('system',array('s'=>'bbs','a'=>'forum','fid'=>$fid,'filter'=>'digest')));?>|<?php echo ilink('刷新',url('system',array('s'=>'bbs','a'=>'forum','fid'=>$fid)));?>|<?php echo ilink('版务', url('system', array('s'=>'bbs', 'a'=>'log', 'fid'=>$fid)));?>|<?php echo ilink('思过涯',url('system',array('s'=>'bbs','a'=>'ban','fid'=>$fid)));?></div>
<?php if (!empty($forum['rule'])):?><div class="block"><img src="<?php echo getImageFile('bugle.gif');?>" />公告:<?php echo $this->ubbCode($forum['rule']);?></div><?php endif;?>
<?php if (!empty($childs)):?>子版块:<?php foreach ($childs as $key => $value):?>〓<?php echo ilink($value,url('system',array('s'=>'bbs','a'=>'forum','fid'=>$key)));?>〓<?php endforeach;?><br/><?php endif;?>
<?php if ($forum['t_type'] && !empty($typeList)):?><div class="pl">分类:<?php foreach ($typeList as $type):?><?php echo ilink($type['name'],url('system',array('s'=>'bbs','a'=>'forum','fid'=>$fid,'filter'=>'type','typeid'=>$type['id'])));?> <?php endforeach;;?></div><?php endif;?>

<div class="content">
<?php if (!empty($threads)):?>
	<?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['ismark']):?><span class="r">[<?php echo userName($thread['markuid']);?>已阅]</span><?php endif;?><?php if ($thread['islock']):?>[锁]<?php endif;?><?php if ($thread['lastpost'] > CTIME):?>[前]<?php endif;?><?php if ($thread['special']):?><?php if (1 == $thread['special']):?><?php echo printImage('poll.gif');?><?php elseif (2 == $thread['special']):?><?php echo printImage('bbs/3g/shang.gif');?><?php elseif (3 == $thread['special']):?>[售]<?php elseif (5 == $thread['special']):?><span class="r">[抢楼]</span><?php endif;?><?php endif;?><?php if ($thread['isupload']):?><?php echo printImage('bbs/3g/common.gif');?><?endif;?><?php echo $thread['type'];?><?php echo ilink($this->filter(sFilter($thread['subject'])),url('system',array('s'=>'bbs','a'=>'thread','tid'=>$thread['id'])));?><?php if ($thread['rating']):?>[<span class="r">+<?php echo $thread['ratings'];?><img src="<?php echo getImageFile('bbs/3g/coins.png');?>" align="absmiddle" /></span>]<?php endif;?><span class="f">(回<?php echo ilink($thread['replies'],url('system',array('s'=>'bbs','c'=>'post','a'=>'list','tid'=>$thread['id'])));?> 点<?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['lastpost']);?></span>
        </div>
	<?php endforeach;?>
</div>
	<div class="search">[共<?php echo $pageObj->getTotalRecord();?>贴 <?php echo $pageObj->getCurrentPage();?>/<?php echo $pageObj->getTotalPage();?>]</div>
	<?php echo $pageObj->show();?>
    <form action="<?php echo url('system',array('s'=>'bbs','a'=>'forum','fid'=>$forum['fid']));?>" method="get">
    <input type="hidden" name="s" value="bbs" />
    <input type="hidden" name="a" value="forum" />
    <input type="hidden" name="fid" value="<?php echo $forum['fid'];?>" />
    <input type="hidden" name="sid" value="<?php echo $GLOBALS['sid'];?>" />
    <input type="hidden" name="st" value="2" />
    <input type="text" name="page" value="1" size="4" />
    <input type="submit" value="跳页" />
	</form>
<?php else:?>
	本版块暂无主题贴
<?php endif;?>
<div class="kind">今日: <?php echo $forum['todayposts'];?> , 主题: <?php echo $forum['threads'];?> , 帖数: <?php echo $forum['posts'];?></div>
<div class="nav">本版块斑竹</div>
<?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 echo isOnlineView($admin);?>]
	<?php endforeach;;?>
<?php else:?>
	本版块暂无斑竹
<?php endif;?>
<br/>
<?php echo date('n/d H:i:s');?>
<br/>
<?php echo $this->nav($fid);?>
</html>