<#import "/lib/function.ftl" as fn>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>${application["seo"]["title"]} —— 帖子列表</title>
<#include "includes/head.ftl">
<script type="text/javascript" src="scripts/menu/menu.js"></script>
<link rel="stylesheet" href="scripts/menu/menu.css" type="text/css" media="all"/>
<style type="text/css">
	/*.box2 { padding: 0px; border: 1px solid silver; height:26px; background-color: #f5f5f5;line-height:150%;}
	.box2 { padding: 0px; border: 1px solid silver; height:26px; background-color: #f5f5f5;line-height:150%;}
	.box2 .right { margin-right:4px;  padding:4px 0px; text-align:right; width:280px; height:14px; }
	.box2 .left { margin-left:4px; padding:4px 0px; text-align:left; height:14px; }*/
</style>
</head>
<body>
<#include "includes/top.ftl">
  <#assign GUEST = "guest">
  <#assign sessionExist = Session["sessionUser"]?exists>
  <#assign sessionUser = Session["sessionUser"]?if_exists>

  <#assign link = "<a href=\"forum.action?forumId="+forum.id+"\" title=\""+forum.name+"\">"+forum.name+"</a> &gt; 贴子列表">
  <#include "includes/quick.ftl">
  <!-- board begin -->
  <!-- child forums -->
  <#if childForums.size()!=0>  
  <div class="box1">
    <div class="title"> ${forum.name} </div>
  </div>
  <#list childForums as childForum>  
  <div class="box2" style="height:56px;">
  	<#if childForum.lastPostTopic?exists>
    <div class="frtl" style="width: 240px;margin-top: 8px;height: 44px;">
      <div>主题：<a 
			href="topic.action?topicId=${childForum.lastPostTopic.id?if_exists}" title="${childForum.lastPostTopic.title?if_exists}">${childForum.lastPostTopic.title?if_exists}</a></div>
      <div>发贴：<a href="user.action?username=${childForum.lastPostTopic.username?if_exists}" title="ntsky">${URLEncoder.encode(childForum.lastPostTopic.username?if_exists)}</a></div>
      <div>日期：${childForum.lastPostTopic.lastPostTime?if_exists?datetime}</div>
    </div>
    </#if>
    <div class="ftl" style="border-right: 1px solid silver; width: 70px; height: 56px;text-align: center;"> <img src="skins/default/forum_<#if forum.status==1>new.gif<#elseif forum.status==0>none.gif</#if>" alt="" style="margin-top: 28px;"/></div>
    <div class="tl">
      <div style="padding-top:4px;padding-left:8px;"><a href="forum.action?forumId=${childForum.id}" title="${childForum.name}"><strong>${childForum.name}</strong></a></div>
      <div style="overflow:hidden;height:38px;line-height:150%;padding:3px 4px 1px;"><span style="padding-left:4px;">${childForum.description}</span></div>
    </div>
  </div>
  <div class="box2" style="border-bottom: 1px solid silver;height: 25px;background-color: #f9f9f9;">
    <div class="frtl" style="width: 240px; height: 25px"> <img style="margin-top: 8px" alt="今日发贴数" src="skins/default/forum_today.gif"/> <span class="red"> ${childForum.totalTodayPost} </span> <img alt="主题贴数" src="skins/default/forum_topics.gif"/> ${childForum.totalTopic} <img alt="发贴总数" src="skins/default/forum_posts.gif"/> ${childForum.totalPost} </div>
    <div class="ftl" style="width: 70px;border-right: 1px solid silver;height: 25px;"></div>
    <div class="tl" style="padding-top:4px;padding-left:78px;"> 版主：<#list childForum.masters?split(",") as master><a title="查看版主${master}的资料" href="user.action?username=${URLEncoder.encode(master)}" rel="_blank">${master}</a> </#list></div>  
  </div>
  </#list>
  </#if>
  <!-- child forums -->
  <!-- end #board -->
  <#if forum.remark?if_exists!="">
  <!-- explain begin -->
  <div class="box1 dashed">
    <h2>本版规则</h2>
    <div> ${forum.rules?if_exists} </div>
  </div>
  <!-- end #explain -->
  </#if>
  <!-- announce -->
  <div class="box5">
    <div class="ftr" style="width:88%;"><marquee onmouseover="this.stop();" onmouseout="this.start();" scrollAmount="4" id="announces"></marquee></div>
    <div class="ftl" style="padding-left:4px;width:10%;"><strong>论坛公告 :  </strong></div>
  </div>
  <!-- announce -->
  <script type="text/javascript">
  	var menus = new Array();
  	<#list forum.masters?split(",") as master>
  	menus[${master_index}] = "<a title=\"查看版主${master}的资料\" href=\"user.action?username=${URLEncoder.encode(master)}\" rel=\"_blank\">${master}</a>";
  	</#list>
  </script>
  <div class="box5" style="border:0px;background-color: #fff;margin:12px 2%;">
  	<div class="left"> <a href="createTopic-page.action?forumId=${forum.id}" title="发表新贴"><img alt="发表新贴" src="images/new_post.jpg"/></a><span style="margin-left:8px;"><a href="createTopic-page.action?forumId=${forum.id}&amp;isVote=1" title="发表新投票"><img alt="发表新投票" src="images/new_poll.jpg"/></a></span> </div>
	<div class="right" style="height:22px;"><a href="${base}/rss/rss-${forum.id}.xml"><img src="images/rss.gif" align="absmiddle"></a> <a href="#" onMouseover="dropdownmenu(this, event, menus, '80px')" onMouseout="delayhidemenu()"><span class="red"><strong>版主</strong></span></a> | <a href="topics.action?forumId=${forum.id}&amp;status=1" title="查看本版精华">查看本版精华</a><#if sessionExist><#if (sessionUser.roles=="2")||(sessionUser.roles=="3")> | <a href="masterPanel.action?forumId=${forum.id}" title="管理"><span class="red">管理</span></a></#if></#if></div>
  </div> 
  <!-- forum list begin -->
  <div class="box1 mtq">
  	<#if categories.size() != 0>
  	<div style="border-bottom:1px solid silver;line-height:150%; padding:4px; height:20px;">
    <strong>专题 : </strong> <#list categories as category><a href="topics.action?forumId=${forum.id}&amp;categoryId=${category.id}" title="${category.name}">${category.name}</a> </#list>
    </div>
    </#if>
    <div style=" background-color: #f7f7f7; height:26px;">
      <div class="lrbox" style="width:490px;">
        <div class="d" style="width:90px;">作者</div>
        <div class="d" style="width:50px;">回复</div>
        <div class="d" style="width:50px;">查看</div>
        <div class="d" style="width:260px;">最后发表</div>
      </div>
      <div class="llbox" style="width:24px;">状态</div>
      <div class="llbox" style="border-right:0px;">主题</div>
    </div>
    <#list topics as topic>
    <div class="lbox1" style="padding:0px;">
      <div class="lrbox" style="width:490px; ">
        <div class="d" style="width:90px;"><#if topic.username!=GUEST><a href="user.action?username=${URLEncoder.encode(topic.username?if_exists)}" rel="external">${topic.username?if_exists}</a><#else>${topic.username?if_exists}</#if></div>
        <div class="d" style="width:50px;">${topic.replies?int}</div>
        <div class="d" style="width:50px;">${topic.views}</div>
        <div class="d" style="width:260px;text-align:left;padding-left:8px;">${topic.lastPostTime?string("yyyy-MM-dd HH:mm:ss")} | <#if topic.username!=GUEST><a href="user.action?username=${URLEncoder.encode(topic.lastPostUser?if_exists)}" rel="external" title="查看${topic.lastPostUser}的资料">${topic.lastPostUser}</a><#else>guest</#if></div>
      </div>
      <div class="llbox" style="width:24px;">
      <#switch topic.status>
		  <#case 1>
		     <img src="skins/default/topicstauts/good.gif" alt="精华帖,${topic.title}"/>
		     <#break>
		  <#case 2>
		  	<img src="skins/default/topicstauts/lock.gif" alt="被锁定的帖,${topic.title}"/>
		     <#break>
		  <#default>
		     <#if topic.isTop=1>
		        <img src="skins/default/topicstauts/top.gif" alt="置顶帖,${topic.title}"/>
		     <#elseif topic.isVote=1>
		     	<img src="skins/default/topicstauts/poll.gif" alt="投票帖,${topic.title}"/>
		     <#elseif topic.replies?int gt 10>
		     	<img src="skins/default/topicstauts/hot.gif" alt="热门帖,${topic.title}"/>
		     <#else>
		     	<img src="skins/default/topicstauts/basic.gif" alt="普通题,${topic.title}"/>
		     </#if>
      </#switch> 
      </div>
      <div class="llbox" style="text-align:left;border-right:0px;"><a href="topic.action?topicId=${topic.id}" title="${topic.title}">${topic.title}</a><#if DateUtil.isToday(topic.dateCreated?string("yyyy-MM-dd HH:mm:ss")[0..9])><img src="skins/default/topicstauts/new.gif" alt="新帖,${topic.title}"/></#if><@fn.topicPagination topicId=topic.id postNum=topic.replies?int /></div>
    </div>
    </#list>
  </div>
  <div class="box1" style="clear:both;border:0px; height:26px; margin-top:4px;">
    <div class="dashed" style="float:right; margin:0px;height:18px; padding:4px;line-height:150%;">
		<@fn.simplePager pagination=pagination />
    </div>
  </div>
  <!-- end #forum list -->
  <#include "includes/location-order.ftl">
  <!-- search begin style="margin: 16px 2% 0px;background-color: #f9f9f9;border: 1px solid silver;"-->
  <div class="lbox1" style="margin:16px 2% 0px ; border: 1px solid silver;">
      <div class="lrbox" style="background-color: #f6f6f6;">
        <div class="d" style="width:15%; border-left:0px;"><img src="skins/default/topicstauts/basic.gif" alt="普通主题"/>普通主题</div>
        <div class="d" style="width:13%; border-left:0px;"><img src="skins/default/topicstauts/lock.gif" alt="锁定主题"/>锁定主题</div>
        <div class="d" style="width:13%; border-left:0px;"><img src="skins/default/topicstauts/hot.gif" alt="回帖大于10"/>回帖大于10</div>
        <div class="d" style="width:13%; border-left:0px;"><img src="skins/default/topicstauts/poll.gif" alt="普通投票"/>普通投票</div>
        <div class="d" style="width:13%; border-left:0px;"><img src="skins/default/topicstauts/good.gif" alt="精华主题"/>精华主题</div>
        <div class="d" style="width:13%; border-left:0px;"><img src="skins/default/topicstauts/top.gif" alt="置顶主题"/>置顶主题</div>
        <div class="d" style="width:13%;border-left:0px;border-right:0px;"><img src="skins/default/topicstauts/new.gif" alt="最新主题"/>最新主题</div>
      </div>
  </div>
  <!-- end #search -->
<script type="text/javascript" src="scripts/system/announcement_${req.getParameter("forumId")}.js"></script>	
<script type="text/javascript">
//<![CDATA[
	// 公告
	document.getElementById("announces").innerHTML = announcementClass.getScrollAnnouncements();
//]]>
</script> 
<#include "includes/footer.ftl">   
</body>
</html>
