{?set jieqi_page_rows = "15"?}
{?set $jieqi_contenttitle = "书评列表"?}

<script type="text/javascript">
//置顶置后
function act_top(url){
	var o = getTarget();
	var param = {
		method: 'POST', 
		onFinish: ''
	}
	if(o.getAttribute('switch') == '0'){
		url = url.replace('act=untop', 'act=top');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '1');
				o.innerHTML = '置后';
			}
		}
	}else{
		url = url.replace('act=top', 'act=untop');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '0');
				o.innerHTML = '置顶';
			}
		}
	}
	Ajax.Tip(url, param);
	return false;
}
//加精去精
function act_good(url){
	var o = getTarget();
	var param = {
		method: 'POST', 
		onReturn: ''
	}
	if(o.getAttribute('switch') == '0'){
		url = url.replace('act=normal', 'act=good');
		param.onFinish = function(res){
			if(res.match('成功')){
			o.setAttribute('switch', '1');
			o.innerHTML = '去精';
			}
		}
	}else{
		url = url.replace('act=good', 'act=normal');
		param.onFinish = function(res){
			if(res.match('成功')){
			o.setAttribute('switch', '0');
			o.innerHTML = '加精';
			}
		}
	}
	Ajax.Tip(url, param);
	return false;
}
//删除
function act_delete(url){
	var o = getTarget();
	var param = {
		method: 'POST', 
		onReturn: function(){
			$_(o.parentNode.parentNode).remove();
		}
	}
	if(confirm('确实要删除该书评么？')) Ajax.Tip(url, param);
	return false;
}
</script>

<ul class="tabb tab3 cf mb">
	<li><a href="{?$url_articleinfo?}">信息</a></li>
	<li><a href="{?$url_articleindex?}">目录</a></li>
	<li><a href="javascript:void(0);" class="selected">书评</a></li>
</ul>

{?if $newpost > 0?}
<div class="textbox hot" id="postresult">{?$postresult?}</div>
<script type="text/javascript">
setTimeout(function(){$_('postresult').hide()}, 3000);
</script>
{?/if?}
<div class="blockc mt">
<div class="blocktitle">{?if $enablepost == 1?}<a class="fr hot" href="#postnew">我要评论</a>{?/if?}<span class="fl">共 {?$jieqi_page_totalrows?} 条评论</span></div>
<ul class="ulrow">
{?section name=i loop=$reviewrows?}
	<li>
	<a class="db cf" href="{?function jieqi_geturl:'article':'reviewshow':1:$reviewrows[i].topicid?}">
	<em>{?$reviewrows[i].posttime|date:Y-m-d H:i:s?}</em><b>{?if $reviewrows[i].posterid > 0?}{?$reviewrows[i].poster?}{?else?}游客{?/if?}：</b>
	<p class="gray">{?if $reviewrows[i].istop == 1?}<span class="pop">[顶]</span>{?/if?}{?if $reviewrows[i].isgood == 1?}<span class="pop">[精]</span>{?/if?}{?$reviewrows[i].title?}</p>
	</a>
	</li>
{?/section?}
</ul>

<div class="pages">{?$url_jumppage?}</div>
</div>

{?if $enablepost == 1?}
<script type="text/javascript">
function frmreview_validate(){
  if(document.frmreview.pcontent.value == ""){
    alert("请输入内容");
    document.frmreview.pcontent.focus();
    return false;
  }
}
</script>
<a name="postnew"></a>
<div class="block">
	<div class="blocktitle">发表书评</div>
	<div class="blockcontent">
	{?if $jieqi_userid > 0?}
		<form class="cf" name="frmreview" id="frmreview" method="post" action="{?$jieqi_modules['article']['url']?}/reviews.php?aid={?$articleid?}" onsubmit="return frmreview_validate();" enctype="multipart/form-data">
		<fieldset>
		<div class="frow">
		<textarea class="textarea" name="pcontent" id="pcontent" style="width:100%;height:5em;"></textarea>
		</div>
		{?if $postcheckcode > 0?}
		<div class="frow">验证码：<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="点击刷新验证码"></div>
		{?/if?}
		<div class="frow">
		<input type="hidden" name="act" value="newpost" />{?$jieqi_token_input?}
		<button type="button" name="Submit" class="button" style="cursor:pointer;" onclick="postsubmit();"> 发表书评 </button>
		</div>
		</fieldset>
		</form>
	{?else?}
		<br />您需要 <a href="{?$jieqi_url?}/login.php">登录</a> 才能发表书评！<br /><br />
	{?/if?}
	</div>
</div>

{?/if?}