A way to make channelartlist tags support limit attributes in Dream Weaving
Editor to share with you how to weave dreams and make channelartlist tags support limit attributes. I believe most people don't know much about it, so share this article for your reference. I hope you will get a lot after reading this article. Let's learn about it together.
How to make channelartlist tags support the limit attribute?
Open file: includetaglibchannelartlist.lib.php
Recommended study: dream weaving cms
1. Set the
$attlist= 'typeid | 0 _ row | 20 _ ~ ~ _
Modify to
$attlist= 'typeid | 0 limit row | 20 Magi cacheid |, limit |'
2. Add before "$dsql- > SetQuery"
$limit= trim (preg_replace ('# limit#is',', $limit)); if ($thanks to') $limitsql= "LIMIT $limit"; else$limitsql= "LIMIT 0mnum"
3 、
$dsql- > SetQuery ("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `zmb_ arctype` WHERE $tpsqlORDER BY sortrank ASC LIMIT $totalnum")
Modify to
$dsql- > SetQuery ("SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM zmb_arctype WHERE $tpsql ORDER BY sortrank ASC $limitsql")
At this point, all the modifications have been completed, and the method of use
{dede:channelartlist limit='0,1'} {/ dede:channelartlist}
Limit: (starting ID starts from 0) indicates a limited range of records (for example, limit='1,2' means to start with a record with an ID of 1 and take 2 records
The above is all the contents of the method of weaving dreams to make the channelartlist tag support the limit attribute. Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!