杰奇jieqicms一本书获取多个关键词
作者:互联网
杰奇(jieqicms)一本书获取多个关键词
能够实现一个ID的小说多个关键词页面!!
杰奇后台或phpmyadmin执行17mb.sql里面的代码
PC端:
添加文件:
/keywords.php
/kw.php
/modules/article/class/package_kw.php
/modules/article/templates/index_kw.html
/modules/article/reader.php合适位置添加代码:
$sql = "select * from 17mb_skeywords where aid = $aid limit 10";
$res=$query->execute($sql);
$arrKw = array();
$i = 0;
while ($v = $query->getRow()){
$arrKw[$i][id] = $v[id];
$arrKw[$i][keyword] = $v[keywords];
$i++;
}
$jieqiTpl->assign(17mb_kw,$arrKw);
/modules/article/templates/index.html需要显示链接的地方添加代码:
{?section name=i loop=$17mb_kw?}<a href="/mip/{?$17mb_kw[i].id?}/">{?$17mb_kw[i].keyword?}</a>{?/section?}
/modules/article/templates/index.html文件最后添加代码:
<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<script>$.post(/keywords.php,{aid:{?$articleid?}});</script>
添加伪静态规则:
RewriteRule ^mip/([0-9]+)/$ /kw.php?id=$1
手机端:
添加文件:
/keywords.php
/kw.php
/17mb/templates/kw.html
info.php合适位置添加代码:
$sql = "select * from 17mb_skeywords where aid = $aid limit 10 ";
$objectKw = $db->get_results($sql);
if($objectKw){
$arrKw = array();
$i = 0;
foreach($objectKw as $v){
$arrKw[$i][id] = $v->id;
$arrKw[$i][keyword] = $v->keywords;
$i++;
}
$tpl->assign(17mb_kw,$arrKw);
}
info.html需要显示链接的地方添加代码:杰奇(jieqicms)一本书获取多个关键词
{?section name=i loop=$17mb_kw?}<a href="/mip/{?$17mb_kw[i].id?}/">{?$17mb_kw[i].keyword?}</a>{?/section?}
info.html文件最后添加代码:
<script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<script>$.post(/keywords.php,{aid:{?$articleid?}});</script>
添加伪静态规则:
RewriteRule ^mip/([0-9]+)/$ /kw.php?id=$1
示例代码:
<section id="zjgx" class="fk">
<div class="xbk">最近更新小说</div>
<ul>
{?section name=i loop=$zjgx?}
<li><span>{?$smarty.section.i.rownum?}. <a href="/book/{?$zjgx[i].articleid?}.html">{?$zjgx[i].articlename?}</a> - <a href="/author/{?$zjgx[i].author?}" class="xszz">{?$zjgx[i].author?}</a></span><span class="xszk"><i>{?$zjgx[i].lastupdate?}</i></span></li>
<li class="zjgxjj"> {?$zjgx[i].intro?}</li>
<li class="xbk xxbk"></li>
{?/section?}
</ul>
</section>
标签:17mb,arrKw,关键词,添加,kw,杰奇,php,section,jieqicms 来源: https://www.cnblogs.com/kobayashilin/p/15000400.html