phpcms v9 get调用标签拾掇

WBOY
Release: 2016-06-13 12:01:39
Original
871 people have browsed it

phpcms v9 get调用标签整理
常见的phpcms标签调用

1、调用本系统单条数据
(调用ID为1的信息,标题长度不超过25个汉字,显示更新日期):
{get sql="select * from phpcms_content where contentid=1" /}
标题:{str_cut($r[title], 50)} URL:{$r[url]} 
?更新日期:{date('Y-m-d', $r[updatetime])}


2、调用本系统多条数据
(调用栏目ID为1通过审核的10条信息,标题长度不超过25个汉字,显示更新日期):
{get sql="select * from phpcms_content where catid=1 and status=99 order by updatetime desc" rows="10"}
标题:{str_cut($r[title], 50)} URL:{$r[url]} 更新日期:{date('Y-m-d', $r[updatetime])}
{/get}


3、带分页
(调用栏目ID为1通过审核的10条信息,标题长度不超过25个汉字,显示更新日期,带分页):
{get sql="select * from phpcms_content where catid=1 and status=99 order by updatetime desc" rows="10" page="$page"}
标题:{str_cut($r[title], 50)} URL:{$r[url]} 更新日期:{date('Y-m-d', $r[updatetime])}
{/get}
分页:{$pages}

4、自定义返回变量
(调用栏目ID为1通过审核的10条信息,标题长度不超过25个汉字,显示更新日期,返回变量为 $v):
{get sql="select * from phpcms_content where catid=1 and status=99 order by updatetime desc" rows="10" return="v"}
标题:{str_cut($v[title], 50)} URL:{$v[url]} 更新日期:{date('Y-m-d', $v[updatetime])}
{/get}


5、调用同一帐号下的其他数据库
(调用数据库为bbs,分类ID为1的10个最新主题,主题长度不超过25个汉字,显示更新日期):
{get dbname="bbs" sql="select * from cdb_threads where fid=1 order by dateline desc" rows="10"}
主题:{str_cut($r[subject], 50)} URL:http://bbs.phpcms.cn/viewthread.php?tid={$r[tid]} 更新日期:{date('Y-m-d', $r[dateline])}
{/get}


6、调用外部数据
(调用数据源为bbs,分类ID为1的10个最新主题,主题长度不超过25个汉字,显示更新日期):
{get dbsource="bbs" sql="select * from cdb_threads where fid=1 order by dateline desc" rows="10"}
主题:{str_cut($r[subject], 50)} URL:http://bbs.phpcms.cn/viewthread.php?tid={$r[tid]} 更新日期:{date('Y-m-d', $r[dateline])}
{/get}
phpcms v9 get标签各种调用代码锦集

原文标题:phpcms v9 get调用标签整理
原文地址:http://www.abcde.cn/info/show-23-885-1.html
版权归网络时代所有,转载请注明出处

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!