
/////////////////////////// // 书库首页 // // ok // /////////////////////////// /* [Read8] index.php Version: 3.0 Name:首页 Web:
http://www.read8.net Copyright: 2001-2006 Read8 Technology Ltd. Last Modified: 2006-2-22 16:28 */ //缓存 $htmfile="./cache/index.htm"; if(file_exists($htmfile) && time()-filemtime($htmfile)<60) { readfile($htmfile); exit; }else { $obno=1; include_once "./include/init.php"; ob_start('callback'); function callback($call){ global $htmfile; writetofile($htmfile,$call); Return ob_gzhandler($call,1); } } getheader($seokeyword);//输出头部 $tpl = new Template('index'); $tpl->assign($Global['main_assign']); include_once AROOT.'cache/cache_bookmain.php'; $tpl->assign(array( 'ins_discuz_adrs' => $Global['ins_discuz_adrs'] && $Global['ins_discuz_creditrow'], 'C_bookallnum' => $_RCACHE['bookmain']['booknum'], 'G_MoneyTitle' => $Global['moneytitle'], )); //封面推荐 @include_once AROOT.'cache/cache_bookface.php'; $tpl->assign($_RCACHE['bookface']); unset($_RCACHE['bookface']); //书籍类型 $tpl->assign('Booktypeblock',$_RCACHE['booktype']); //首页公告 @include_once AROOT.'cache/cache_announce.php'; $tpl->assign('Announceblock',$_RCACHE['announce']); unset($_RCACHE['announce']); //-----------------显示vip---------------------// $wblock=array(); $sql="select b.book_id,book_title,chapter_time,book_updatetime,type_id,chapter_title,book_author,chapter_orderid,chapter_id,volume_name from ".__TAB_BOOK__." b LEFT JOIN ".__TAB_CHAPTER__." c ON c.chapter_id=b.book_newchapterid LEFT JOIN ".__TAB_VOLUME__." vl ON vl.volume_id=c.volume_id where chapter_new=1 order by book_updatetime desc limit ".$Global['indextiplist']; $result=$db->query($sql); while($rows=$db->fetch_row($result)) { $wblock[]=array( 'C_typename' => csubstr($_RCACHE['booktypebytid'][$rows['type_id']],0,4), 'C_bookid' => $rows['book_id'], 'C_booktitle' => $rows['book_title'], 'C_volumetitle' => $rows_volume['volume_name'], 'C_chapterid' => $rows['chapter_id'], 'C_orderid' => $rows['chapter_orderid'], 'C_typeid' => $rows['type_id'], 'C_chaptertitle' => $rows['chapter_title'], 'C_posttime' => date("n-j",$rows['chapter_time']), 'C_author' => $rows['book_author'], 'G_style' => $Global['style'], ); } $db->free_result($result);//释放mysql $tpl->assign('vipblock',$wblock); unset($wblock); //-----------------显示原创作品---------------------// $wblock=array(); $sql="select b.book_id,book_title,chapter_time,book_updatetime,type_id,chapter_title,book_author,chapter_orderid,volume_name from ".__TAB_BOOK__." b LEFT JOIN ".__TAB_CHAPTER__." c ON b.book_newchapterid=c.chapter_id LEFT JOIN ".__TAB_VOLUME__." vl ON vl.volume_id=c.volume_id where chapter_new=0 and b.book_attrib='原创作品' order by book_updatetime desc limit ".$Global['indextiplist']; $result=$db->query($sql); while($rows=$db->fetch_row($result)) { $wblock[]=array( 'C_typename' => csubstr($_RCACHE['booktypebytid'][$rows['type_id']],0,4), 'C_bookid' => $rows['book_id'], 'C_booktitle' => $rows['book_title'], 'C_volumetitle' => $rows['volume_name'], 'C_chapterid' => $rows['chapter_orderid'], 'C_chaptertitle' => $rows['chapter_title'], 'C_typeid' => $rows['type_id'], 'C_posttime' => date("n-j",$rows['chapter_time']), 'C_author' => $rows['book_author'], 'G_style' => $Global['style'], ); } $db->free_result($result);//释放mysql $tpl->assign('ycblock',$wblock); unset($wblock); //-----------------显示转载作品---------------------// $wblock=array(); $sql="select b.book_id,book_title,chapter_time,book_updatetime,type_id,chapter_title,book_author,chapter_orderid,volume_name from ".__TAB_BOOK__." b LEFT JOIN ".__TAB_CHAPTER__." c ON b.book_newchapterid=c.chapter_id LEFT JOIN ".__TAB_VOLUME__." vl ON vl.volume_id=c.volume_id where chapter_new=0 and b.book_attrib<>'原创作品' order by book_updatetime desc limit ".$Global['indextiplist']; $result=$db->query($sql); while($rows=$db->fetch_row($result)) { $wblock[]=array( 'C_typename' => csubstr($_RCACHE['booktypebytid'][$rows['type_id']],0,4), 'C_bookid' => $rows['book_id'], 'C_booktitle' => $rows['book_title'], 'C_volumetitle' => $rows['volume_name'], 'C_chapterid' => $rows['chapter_orderid'], 'C_chaptertitle' => $rows['chapter_title'], 'C_typeid' => $rows['type_id'], 'C_posttime' => date("n-j",$rows['chapter_time']), 'C_author' => $rows['book_author'], 'G_style' => $Global['style'], ); } $db->free_result($result);//释放mysql $tpl->assign('zzblock',$wblock); unset($wblock); //-----------------分类显示书籍---------------------// $wblock=array(); foreach($Global['indextypetoplist'] as $i=>$type){ $wblock[$i]["indextypeconlistname"]=$_RCACHE['booktypebytid'][$type]; $sql="select b.book_id,book_title,chapter_time,book_updatetime,type_id,chapter_title,book_author,chapter_orderid,volume_name from ".__TAB_BOOK__." b LEFT JOIN ".__TAB_CHAPTER__." c ON b.book_newchapterid=c.chapter_id LEFT JOIN ".__TAB_VOLUME__." vl ON vl.volume_id=c.volume_id where chapter_new=0 and b.type_id='$type' order by book_updatetime desc limit ".$Global['indextypetoplistnum']; $result=$db->query($sql); while($rows=$db->fetch_row($result)) { $wblock[$i]["indextypeconlist"][]=array( 'C_bookid' => $rows['book_id'], 'C_booktitle' => $rows['book_title'], 'C_volumetitle' => $rows['volume_name'], 'C_chapterid' => $rows['chapter_orderid'], 'C_chaptertitle' => strip_tags($rows['chapter_title']), 'C_typeid' => $rows['type_id'], 'C_posttime' => date("n-j",$rows['chapter_time']), 'C_author' => $rows['book_author'], 'G_style' => $Global['style'] ); } } $db->free_result($result);//释放mysql $tpl->assign("indextypetoplist",$wblock); unset($wblock); //排行榜导入 $theborders=array("Commendblock","Newbookhitblock","Newinlibbookblock","Readervotetopblock","Thisweektopblock","Thismonthtopblock","Allbooktopblock","Bookreviewblock","Cooperatesiteblock"); foreach($theborders as $val){ include_once AROOT."cache/cache_$val.php"; $tpl->assign($val,$$val); unset($$val); } $tpl->output(); include_once AROOT."include/footer.php";
网此
http://wwvv.2.page.tl/xiaoshuo/