<?
		$iserror = 0;
		
		$bid = isset($bid)?intval($bid):0;
		$getbooks = new getbook;
		$booktitle = $db->query_field("select articlename from ".JIEQI_DB_PREFIX."_article_article where articleid = ".$bid);
		if(!$booktitle){
				$iserror = 1;
				$url = array();
				$tourl = URL_book_index($url);
				$pagecontent = "<b>警告：</b><br/>";
				$pagecontent .= "不存在的书会！<br/>";
				$pagecontent .= ">>".backurl()."<br/>";	
		}
		
		if($iserror == 0){
				/*自定义数据*/$pagelistsize = 10;//每页显示条数
				switch($rank){
						case "good":
								$totaltopics = $db->query_num("select topicid from ".JIEQI_DB_PREFIX."_article_reviews where isgood=1 and ownerid = ".$bid);
								break;
						case "new":
								$totaltopics = $db->query_num("select topicid from ".JIEQI_DB_PREFIX."_article_reviews where ownerid = ".$bid);
								break;
						case "lock":
								$totaltopics = $db->query_num("select topicid from ".JIEQI_DB_PREFIX."_article_reviews where islock=1 and ownerid = ".$bid);
								break;
						default:
								$totaltopics = $db->query_num("select topicid from ".JIEQI_DB_PREFIX."_article_reviews where ownerid = ".$bid);
								break;
				}
				$totalpage = ceil($totaltopics/$pagelistsize);
				$page = isset($page)?intval($page):"1";
				$page = ($page>$totalpage)?($totalpage):($page);
				$totalpage = ($totalpage==0)?1:intval($totalpage);
				$page = ($page<1)?(1):($page);
				$sqlstart = ($page-1)*$pagelistsize;
    		
				$smartydate = array("pagetitle" => "《".$booktitle."》书会",
													"booktitle" => $booktitle,
													"totaltopics" => $totaltopics,
													"totalpage" => $totalpage,
													"page" => $page,
													"pagelistsize" => $pagelistsize,
													"bid" => $bid,
													"data" => array("bid" => $bid,"rank" => $rank),
														);
											
				switch($rank){
						case "good":
								$smartyObj->assign('reviewlist',$db->query_array("select topicid,title,posterid,poster,views,replies,islock,istop,isgood from ".JIEQI_DB_PREFIX."_article_reviews where isgood=1 and ownerid = ".$bid." order by istop desc,isgood desc,replytime desc limit ".$sqlstart.",".$pagelistsize));
								break;
						case "new":
								$smartyObj->assign('reviewlist',$db->query_array("select topicid,title,posterid,poster,views,replies,islock,istop,isgood from ".JIEQI_DB_PREFIX."_article_reviews where ownerid = ".$bid." order by istop desc,posttime desc limit ".$sqlstart.",".$pagelistsize));
								break;
						case "lock":
								$smartyObj->assign('reviewlist',$db->query_array("select topicid,title,posterid,poster,views,replies,islock,istop,isgood from ".JIEQI_DB_PREFIX."_article_reviews where islock=1 and ownerid = ".$bid." order by istop desc,islock desc,replytime desc limit ".$sqlstart.",".$pagelistsize));
								break;
						default:
								$smartyObj->assign('reviewlist',$db->query_array("select topicid,title,posterid,poster,views,replies,islock,istop,isgood from ".JIEQI_DB_PREFIX."_article_reviews where ownerid = ".$bid." order by istop desc,replytime desc limit ".$sqlstart.",".$pagelistsize));
								break;
				}
				
				$tplpath = "book/reviews_list.tpl";
		}else{
				$smartydate = array("pagetitle" => $booktitle,
													"pagecontent" => $pagecontent,
													"tourl" => $tourl,
													"redirecturl" => $tourl,
														);
				$tplpath = "public.tpl";
		}
?>