PHPCMS 同时调用多个栏目的文章标签

2012-11-05 浏览:1138
PHPCMS 同时调用多个栏目的文章标签
评论:(0)复制地址

PHPCMS 同时调用多个栏目的文章标签:

简洁版(不包含栏目名称):

               {pc:get sql="SELECT * FROM v9_news WHERE catid IN (20,21,22) order by id DESC" num="36" return="data"}
              {loop $data $r}
             <li>[<a href="{$CATEGORY[$r[catid]][url]}" target="_blank">{str_cut($CATEGORY[$r[catid]][catname],4)}</a>]<a href="{$r[url]}" title="{$r[title]}">{$r[title]}</a></li>
              {/loop}
              {/pc}

高级版(栏目名称):

{pc:get sql="SELECT `n`.`inputtime`,`n`.`url`,`n`.`title`,`c`.`catname`,`c`.`url` as `c_url` FROM `v9_news` as `n` left join `v9_category` as `c` on `n`.`catid` = `c`.`catid` where `c`.`catid` in (20,21,22) order by `n`.`id` desc" num="10" cache="3600" page="" dbsource="" return="data"}
{loop $data $key $val}
<li>[ <a href="{$val[c_url]}" target="_blank">{$val[catname]}</a> ]  <a href="{$val[url]}" title="{$val[title]}" target="_blank">{$val[title]}</a></li>
{/loop}
{/pc}
             

评论:(0)复制地址
发布:苗景云 | 分类:IT技术&设计 | Tags:PHPCMS

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。