用帝国cms的新闻系统,改做小说系统,其实很简单:用副标题保存目录。
1.内容页调用摘要
<td class="info_text">书名:<a href='[!--class.url--]'>《[!--class.name--]》</a> 作者:[!--writer--]</td>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="plpost">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="title">
<tr>
<td><strong>相关章节</strong></td>
<td align="right"><a href="<?=sys_ReturnBqClassname($navinfor,9)?>">[!--class.name--] 总目录</a></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="3"><?$jie=""?>
此处隐藏268个字。
回复评论可见if($jie!=$bqr[ftitle]){
echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$bqr[ftitle]."</td><tr>";
$jie=$bqr[ftitle];
}
?>
<tr><td>
<a href="<?=$bqsr[titleurl]?>" target="_self"><?=$bqr[title]?></a>
</td></tr>
[/e:loop]
<?
if($jie!=$navinfor[ftitle]){
echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$navinfor[ftitle]."</td><tr>";
$jie=$navinfor[ftitle];
}
?>
<tr><td><strong>[!--pagetitle--]</strong> (当前页面)</td></tr>
[e:loop={"select * from [!db.pre!]ecms_news where newstime>'$navinfor[newstime]' and classid='$navinfor[classid]' order by newstime asc limit 4",1,24,0}]
<?
if($jie!=$bqr[ftitle]){
echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$bqr[ftitle]."</td><tr>";
$jie=$bqr[ftitle];
}
?>
<tr><td>
<a href="<?=$bqsr[titleurl]?>" target="_self"><?=$bqr[title]?></a>
</td></tr>
[/e:loop]
</table>
</td>
</tr>
</table>
2.小说目录摘要
<h1>[!--class.name--]</h1>
<div class=daodu>[!--pagedes--]</div>
<table width="100%" border="0" cellspacing="1" cellpadding="3" id='myBook'>
<?$jie=""?>
[e:loop={'selfinfo',5000,0,0,'','newstime asc,id asc'}]
<?
if($jie!=$bqr[ftitle]){
if($jie<>"")echo "</ul></td></tr>";
echo "<tr><td bgColor=#e3e3e3 colSpan=4 align=middle>".$bqr[ftitle]."</td></tr><tr><td>";
$jie=$bqr[ftitle];
$hlsql=$empire->query("select max(length(title)) as hlmax from phome_ecms_news where classid='$bqr[classid]' and ftitle='$jie'");
$hlmax=$empire->fetch($hlsql);
$LmMax= $hlmax['hlmax'];
if($LmMax<31){echo "<ul class=bookml>";}elseif($LmMax<61){echo "<ul class=bookml1>";}else{echo "<ul>";}
}
?>
<li>
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a></li>
[/e:loop]
</td></tr>
</table>
3.样品示范
奇效方 - 中药方大全-偏方-秘方-药方大全 http://www.zhongyf.com/books/shiyongshu/qxf/