IsLogin()) { $uid=""; } else { require_once("../config/db_fun.php"); $username=$cfg_ml->M_LoginID; $sql="select * from uc_members where username='$username'"; $rs=mysql_query($sql); if($row = mysql_fetch_array($rs)) { $username =$row["username"]; $type =$row["type"]; $uid =$row["uid"]; } } $bid=$_GET["bid"]; $tablename="care_story_books"; $sql="select * from care_story_books where bid='$bid'"; $rs=mysql_query($sql); if($row = mysql_fetch_array($rs)){ $catid =$row["catid"]; $ischeck =$row["ischeck"]; $status =$row["status"]; $bcatid =$row["bcatid"]; $booktype =$row["booktype"]; $freenum =$row["freenum"]; $bookname =$row["bookname"]; $shortname =$row["shortname"]; $author =$row["author"]; $description =$row["description"]; $notice =$row["notice"]; $zzjj =$row["zzjj"]; $body =$row["body"]; $vip =$row["vip"]; $jiejin =$row["jiejin"]; $litpic =$row["litpic"]; $keywords =$row["keywords"]; $piao =$row["piao"]; $fen =$row["pingfen"]; $hua =$row["flower"]; $cbs =$row["cbs"]; $price =$row["price"]; $body =str_replace("
","

",$body); $body =$body."

"; } else{echo "参数不能为空!";exit;} $tpl = new Template("templets/keyibook"); if($booktype==1) { $tpl->set_file('main', 'books_book.htm'); $tpl->set_file('header','head_ts.htm'); } if($booktype==0) { $tpl->set_file('main', 'books_book_yc.htm'); $tpl->set_file('header', 'head_yc.htm'); } $tpl->set_file('footer', 'foot.htm'); $tpl->set_block('main','zlist','blockz'); $tpl->set_block('zlist','jlist','blockj'); if ($ischeck==0) { echo ""; exit; } $tpl->set_var('uid',$uid); $tpl->set_var('username',$username); $tpl->set_var('keywords',$keywords); $tpl->set_var('notice',$notice); if($shortname!="") { $tpl->set_var('shortname',$shortname.":"); } $sql="select * from care_story_catalog where id='$catid'"; $rs=mysql_query($sql); if($row = mysql_fetch_array($rs)){ $classname =$row["classname"]; $tpl->set_var('classname',$classname); } $tpl->set_var("bid",$bid); $tpl->set_var("catid",$catid); if($status==0) { $status="连载中..."; } if($status==1) { $status="连载已完成"; } $tpl->set_var("status",$status); $tpl->set_var("body",$body); $tpl->set_var('bookname',$bookname); $tpl->set_var('catid',$catid); if ($price=="") { $tpl->set_var('price',"暂无"); } else { $tpl->set_var('price',$price."元"); } if ($author=="") { $tpl->set_var('author',"暂无"); } else { $author="".$author.""; $tpl->set_var('author',$author); } if ($cbs=="") { $tpl->set_var('cbs',"暂无"); } else { $cbs="".$cbs.""; $tpl->set_var('cbs',$cbs); } if($litpic=="") { $imgurl="/images/default.gif"; } else { $imgurl=$litpic; } $tpl->set_var('imgurl',$imgurl); $tpl->set_var('zzjj',$zzjj); $sql="Select id,chaptername,chapnum From care_story_chapter where bookid='$bid' order by chapnum asc"; $rs=mysql_query($sql); while($row = mysql_fetch_array($rs)){ $chapnum =$row["chapnum"]; $chaptername =$row["chaptername"]; $chap_id =$row["id"]; $sql_chap="Select * From care_story_content where chapterid='$chap_id' order by id asc"; $rs_chap=mysql_query($sql_chap); while($row_chap = mysql_fetch_array($rs_chap)) { $content_title =$row_chap["title"]; $sortid =$row_chap["sortid"]; $content_id =$row_chap["id"]; $tpl->set_var("content_id",$content_id); $tpl->set_var("sortid",$sortid); $tpl->set_var("content_title",$content_title); $tpl->parse('blockj','jlist',true); } $tpl->set_var("chapnum",$chapnum); $tpl->set_var("chaptername",$chaptername); $tpl->parse('blockz','zlist',true); $tpl->set_var('blockj'); } /* $sql="select * from care_story_content where bookid='$bid' order by addtime desc"; $rs=mysql_query($sql); if($row = mysql_fetch_array($rs)){ $new_title =$row["title"]; $new_id =$row["id"]; $new_sortid =$row["sortid"]; $tpl->set_var("new_title",$new_title); $tpl->set_var("new_id",$new_id); $tpl->set_var("new_sortid",$new_sortid); } */ $sql="select * from care_common_bind where bookid='$bid' and flag='cang'"; $rs=mysql_query($sql); $cang_num =mysql_num_rows($rs); $tpl->set_var("cang_num",$cang_num); $tpl->set_var("piao",$piao); $tpl->set_var("fen",$fen); $tpl->set_var("hua",$hua); $tpl->parse('header', 'header'); $tpl->parse('footer', 'footer'); $tpl->parse('mains', 'main'); $tpl->p('mains'); ?>