指定条目,指定栏目的代码
{pc:get sql="SELECT * FROM PRE_category where parentid=1225 order by listorder DESC" num="8" cache="3600"}
{loop $data $r}
<li>
<div class="list-img">
<a href="{$r['url']}" target="_blank">
{if $r[image]}<img src="{$r[image]}" width="120" height="160" alt="{$r[catname]}"/>{else} <img src="http://www.foshang.net/statics/images/book/book_nopic.jpg" width="120" height="160" alt="{$r[catname]}"/>{/if}
</a>
</div>
<div class="name">
<a href="{$r['url']}" target="_blank">{$r[catname]}</a>
</div>
<div class="author">{$r[author]}</div>
<div class="desc">{$r[description]}</div>
</li>
{/loop}
{/pc}
分页代码
{pc:get sql="SELECT * FROM PRE_category where catid in($arrchildid) order by listorder DESC" num="36" cache="3600" page="$page"}
<ul class="list-wp clearfix">
{loop $data $r}
<li>
<div class="list-img">
<a href="{$r['url']}" target="_blank">
{if $r[image]}<img src="{$r[image]}" width="120" height="160" alt="{$r[catname]}"/>{else} <img src="http://www.foshang.net/statics/images/book/book_nopic.jpg" width="120" height="160" alt="{$r[catname]}"/>{/if}
</a>
</div>
<div class="name">
<a href="{$r['url']}" target="_blank">{$r[catname]}</a>
</div>
<div class="author">{$r[author]}</div>
<div class="desc">{$r[description]}</div>
</li>
{/loop}
</ul>
<div id="pages" class="page_wrap">{$pages}</div>
{/pc}
相关文章
PHPCMS 统计栏目下子栏目数量的代码2024-11-12
PHPCMS V9 上传图片或附件后后台退出需要重新登录的解决办法2021-06-19
PHPCMS 推荐位输出组图的方法2020-12-30
PHPCMS内容页自定义下拉菜单循环输出数值的方法2020-12-17
PHPCMS v9 search模块搜索栏目名称二次开发2020-02-20
PHPCMS删除文章后数据库中仍有删除文章中的关键词解决办法2019-11-13
PHPCMS中TAG模板、COMMENT模板等不能使用{SITEURL($SITEID)}函数2019-11-13
PHPCMS V9编辑器中新增上传mp4视频(上传视频并插入HTML5的video标签)的功能2019-10-30
PHPCMS一些漏洞修复及解决方案2019-07-10
PHPCMS的产品筛选功能(通用)2019-04-09