多个推荐位代码:
{pc:get sql="SELECT * FROM v9_news WHERE id IN (SELECT id FROM v9_position_data WHERE posid in(2,3) and catid in(19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43)) order by id DESC" num="1" return="data"}
{loop $data $n $r}
<h1><a href="{$r[url]}" title="{$r[title]}" target="_blank"{title_style($r[style])}>{str_cut($r[title], 42,'')}</a></h1>
{/loop}
{/pc}
单个推荐位代码:
{pc:get sql="SELECT * FROM v9_news WHERE id IN (SELECT id FROM v9_position_data WHERE posid=‘2’ and catid in(19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43)) order by id DESC" num="1" return="data"}
{loop $data $n $r}
<h1><a href="{$r[url]}" title="{$r[title]}" target="_blank"{title_style($r[style])}>{str_cut($r[title], 42,'')}</a></h1>
{/loop}
{/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