{if $n==1}{/if}{str_cut($r[description],112,'')}[reading more]
{/loop} {/pc}Usage of phpcms tag: 1. Display the column name and link of the specified catid; 2. Call the sub-column; 3. Get the news under the specified column; 4. Implement the paging function.
Usage of phpcms tag:
1. Display the column name and link of the specified catid{$CATEGORYS[25]['catname']} {$CATEGORYS[25]['url']}
Get the parent column id, get the parent column name$CATEGORY[$catid][ parentid]}
Parent column name:{$CATEGORYS[$CAT[parentid]][catname]}
The ellipsis that appears after removing the title restriction
{str_cut($r[title],36,'...')}
Formatting time 2011-05-06 11:22:33
{date('Y-m-d H:i:s',$r[inputtime])} {date('Y年m月d日',$r[inputtime])}
2. Call sub-column(need to be used in the column homepage template, and can also be used in the list page)
{pc:content action="category" catid="$catid" num="25" siteid="$siteid" order="listorder ASC"} {loop $data $r} {$r[catname]} | {/loop}{/pc}
3. Get the news under the specified column
(1) Here moreinfo="1" means that the main and secondary tables can be related directly using
{pc:content action="lists" catid="$catid" num="25" order="id DESC" return="info" moreinfo="1"} {loop $info $r} 更新日期:{date('Y年m月d日',$r[updatetime])} 作者:{$r[username]} 来源:{$r[copyfrom]} 点击率{$r[readpoint]} 网址{$r[url]} 文章标题 {$r['title']} 标题样式{title_style($v[style])} {/loop} {/pc}=====================
Copy after login
( 2) The sql universal statement can call the specified content more conveniently
{pc:get sql="select * from v9_news as a,v9_news_data as b where a.id=b.id and catid=34 and status=99 order by a.id desc"} {loop $data $v}
=====================
(3) The article is called from the specified position (position is recommended)
The starting position is 5, and 3 articles are called. Equivalent to the limit function.
{pc:content action="position" posid="27" order="listorder DESC" num="3" start="5"} {loop $info $r} {str_cut($r[description],115)}... {/loop} {/pc} 或{pc:content action="lists" catid="54" thumb="" order="listorder DESC" start="3" num="5"} thumb="" 不分类=====================
循环列表新闻{pc:content action="position" posid="9" order="listorder DESC" num="4"} {loop $data $r} {str_cut($r[title],36,'')}{date('Y-m-d H:i:s',$r[inputtime])}{if $n==1}{/if}{str_cut($r[description],112,'')}[reading more]
{/loop} {/pc}=====================
(4) There is a paging effect
{pc:get sql="select * from wecheweyounews where hour=$hour order by id desc" return="data" num="50" page="$page"}
4.
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"} {loop $data $r} {/loop} {/pc}
5. Paging
The front desk call num="50" refers to 50 records per page
{pc:get sql="select * from wecheweyounews where hour=$hour order by id desc" return="data" num="50" page="$page"}
Related learning recommendations :phpcms tutorial
The above is the detailed content of How to use phpcms tag?. For more information, please follow other related articles on the PHP Chinese website!