Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use phpcms tags

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to use phpcms tags, the editor feels very practical, so share with you to learn, I hope you can get something after reading this article, say no more, follow the editor to have a look.

The usage of the 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, realize the paging function.

Use of phpcms tags:

1. Display the column name and link {$CATEGORYS [25] ['catname']} {$CATEGORYS [25] [' url']} of the specified catid

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], 36J.)}

Format time 2011-05-06 11:22:33

{date ('Y-m-d inputtime iRH])} {date (' m / d / Y', $r [inputtime])}

2. Call the subcolumn (you need to use the template on the front page of the column, and you can also use it on 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 designated column

(1) here moreinfo= "1" means that the primary and secondary tables are associated and can be used directly.

{pc:content action= "lists" catid= "$catid" num= "25" order= "id DESC" return= "info" moreinfo= "1"} {loop $info $r} Update date: {date ('m / d / Y') {/ loop} {/ pc}

= {/ loop} {$pages} {/ pc}

4 、

{pc:content action= "position" posid= "1" order= "listorder DESC" thumb= "1" num= "5"} {loop $data $r}

{$r['title']}

{/ loop} {/ pc}

5. Paging

The foreground calls num= "50" to refer to 50 records per page

{pc:get sql= "select * from wecheweyounews where hour=$hour order by id desc" return= "data" num= "50" page= "$page"} {loop $data $r} {str_cut ($r ['username], 60)} (edit: {$r [username]}) {date ("Y-m-d") $r ['inputtime'])} {/ loop} {$pages} {/ pc}

The above is how to use the phpcms tag, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report