{?set jieqi_blocks_module = "system"?}
{?set jieqi_blocks_config = "userblocks"?}
{?set jieqi_page_rows = "30"?}
{?set $jieqi_pagetitle = "会客室留言列表-{$jieqi_sitename}"?}

{?if $newpost > 0?}
<div class="textbox hot" id="postresult">{?$postresult?}</div>
<script type="text/javascript">
setTimeout(function(){$_('postresult').hide()}, 3000);
</script>
{?/if?}
<div class="cf">
	<div class="fl"><a href="{?function jieqi_geturl:'system':'user':$ownerid?}">{?$ownername?}</a> 的会客室</div>
	<div class="fr">{?if $type == "good"?}[<a href="{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&type=all">全部主题</a>]&nbsp;&nbsp;[精华主题]{?else?}[全部主题]&nbsp;&nbsp;[<a href="{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&type=good">精华主题</a>]{?/if?}{?if $enablepost == 1?}&nbsp;&nbsp;[<a href="#postnew">发表主题</a>]{?/if?}</div>
</div>

<table class="grid" width="100%">
  <tr class="head">
    <th width="54%">主题</th>
    <th width="13%">回复/查看</th>
    <th width="13%">发表人</th>
    <th width="20%">发表时间</th>
  </tr>
  <tbody id="jieqi_page_contents">
  {?section name=i loop=$ptopicrows?}
  <tr>
    <td>{?if $ptopicrows[i].istop == 1?}<span class="hot">[顶]</span>{?/if?}{?if $ptopicrows[i].isgood == 1?}<span class="hot">[精]</span>{?/if?}<a href="{?$jieqi_url?}/ptopicshow.php?tid={?$ptopicrows[i].topicid?}">{?$ptopicrows[i].title|truncate:'54':'..'?}</a></td>
    <td align="center">{?$ptopicrows[i].replies?}/{?$ptopicrows[i].views?}</td>
    <td>{?if $ptopicrows[i].posterid > 0?}<a href="{?function jieqi_geturl:'system':'user':$ptopicrows[i].posterid?}" target="_blank">{?$ptopicrows[i].poster?}</a>{?else?}游客{?/if?}</td>
    <td align="center">{?$ptopicrows[i].posttime|date:"Y-m-d H:i:s"?}
	{?if $ismaster == 1?}
	<br />
	{?if $ptopicrows[i].istop == 0?}
	[<a id="act_top_{?$ptopicrows[i].topicid?}" href="javascript:;" onclick="Ajax.Tip('{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&tid={?$ptopicrows[i].topicid?}&act=top{?$jieqi_token_url?}', {method: 'POST'});">置顶</a>]
	{?else?}
	[<a id="act_untop_{?$ptopicrows[i].topicid?}" href="javascript:;" onclick="Ajax.Tip('{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&tid={?$ptopicrows[i].topicid?}&act=untop{?$jieqi_token_url?}', {method: 'POST'});">置后</a>]
	{?/if?} 
	{?if $ptopicrows[i].isgood == 0?}
	[<a id="act_good_{?$ptopicrows[i].topicid?}" href="javascript:;" onclick="Ajax.Tip('{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&tid={?$ptopicrows[i].topicid?}&act=good{?$jieqi_token_url?}', {method: 'POST'});">加精</a>]
	{?else?}
	[<a id="act_normal_{?$ptopicrows[i].topicid?}" href="javascript:;" onclick="Ajax.Tip('{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&tid={?$ptopicrows[i].topicid?}&act=normal{?$jieqi_token_url?}', {method: 'POST'});">去精</a>]
	{?/if?} 
	[<a id="act_del_{?$ptopicrows[i].topicid?}" href="javascript:;" onclick="if(confirm('确实要删除该主题么？')) Ajax.Tip('{?$jieqi_url?}/ptopics.php?oid={?$ownerid?}&tid={?$ptopicrows[i].topicid?}&act=del{?$jieqi_token_url?}', {method: 'POST'});">删除</a>]
	{?/if?}
	</td>
  </tr>
  {?/section?}
  </tbody>
</table>
<div class="pages">{?$url_jumppage?}</div>

<a name="postnew"></a>
{?if $enablepost == 1?}
<script type="text/javascript">
function frmpost_validate(){
  if(document.frmpost.pcontent.value == ""){
    alert("请输入内容");
    document.frmpost.pcontent.focus();
    return false;
  }
}
</script>
<form name="frmpost" id="frmpost" action="{?$jieqi_url?}/ptopics.php?oid={?$oid?}&do=submit" method="post" onsubmit="return frmpost_validate();" enctype="multipart/form-data">
<table width="100%" class="grid" cellspacing="1" align="center">
<caption>发表主题</caption>
<tr valign="middle" align="left">
  <td class="tdl" width="25%">标题：</td>
  <td class="tdr" width="75%"><input type="text" class="text" name="ptitle" id="ptitle" size="60" maxlength="60" value="" /></td>
</tr>
<tr valign="middle" align="left">
  <td class="tdl">内容：</td>
  <td class="tdr"><textarea class="textarea" name="pcontent" id="pcontent" rows="12" cols="60"></textarea>
  <script type="text/javascript">loadJs("{?$jieqi_url?}/scripts/ubbeditor_{?$jieqi_charset?}.js", function(){UBBEditor.Create("pcontent");});</script>
  </td>
</tr>
{?if $postcheckcode > 0?}
<tr valign="middle" align="left">
  <td class="tdl">验证码：</td>
  <td class="tdr"><input type="text" class="text" style="width:6em;" name="checkcode" id="checkcode" onfocus="if(this.form.imgccode.style.display == 'none'){this.form.imgccode.src = '{?$jieqi_url?}/checkcode.php?rand={?$jieqi_time?}';this.form.imgccode.style.display = '';}" title="点击显示验证码"><img name="imgccode" src="" style="cursor:pointer;vertical-align:middle;margin-left:3px;display:none;" onclick="this.src='{?$jieqi_url?}/checkcode.php?rand='+Math.random();" title="点击刷新验证码"></td>
</tr>
{?/if?}
<tr valign="middle" align="left">
  <td class="tdl">&nbsp;<input type="hidden" name="act" value="newpost" />{?$jieqi_token_input?}</td>
  <td class="tdr"><button type="submit" class="button" name="btnpost">提 交</button></td>
</tr>
</table>
</form>
{?else?}
<table class="grid" width="100%" align="center">
  <caption>发表主题</caption>
  <tr>
    <td align="center"><br />您不能发表主题，如果尚未登录，请先点击 <a class="hot" href="{?$jieqi_user_url?}/login.php" onclick="openDialog('{?$jieqi_user_url?}/login.php?ajax_gets=jieqi_contents', false);stopEvent();">登录</a><br /><br /></td>
  </tr>
</table>
{?/if?}