<?
		//$listuser -> checklogin($_Ge["member"]["uid"]);

		$iserror = 0;
				
		/*定义接口API*/
		if(!is_numeric($bid) or $bid<1){
				$iserror = 1;
				$url = array();
				$tourl = URL_book_index($url);
				$pagecontent = "<b>提醒：</b><br/>";
				$pagecontent .= "不存在的作品！<br/>";
				$pagecontent .= ">>".backurl()."<br/>";	
		}
		if($iserror == 0){
				$firstchapterid = $db->query_field("select chapterid from ".JIEQI_DB_PREFIX."_article_chapter where chaptertype = 0 and articleid=".$bid." order by chapterorder asc limit 0,1");
				if(!$firstchapterid){
						$iserror = 1;
						$url = array("bid" => $bid);
						$tourl = URL_book_chapter_list($url);
						$pagecontent = "<b>提醒：</b><br/>";
						$pagecontent .= "不存在的章节！<br/>";
						$pagecontent .= ">>".backurl()."<br/>";
				}
		}
		if($iserror == 0){
				$url = array("bid"=>$bid,"cid"=>$firstchapterid);
				header("location:".URL_book_chapter($url));
		}else{
				$smartydate = array("pagetitle" => "章节提醒",
													"pagecontent" => $pagecontent,
													"torul" => $tourl,
													"redirecturl" => $tourl,
													);
				$tplpath = "public.tpl";
		}
?>