Introduction to Empire CMS loop sub-column tag listsonclass_PHP tutorial

WBOY
Release: 2016-07-13 10:33:05
Original
1624 people have browsed it

Loop sub-column data label (listsonclass)

Tag name: Loop sub-column data tag (sys_ForSonclassData)

Format: [listsonclass] Column ID, number of displayed items, number of title interceptions, whether to display column name, operation type, template ID, only display images with titles, display number of columns[/listsonclass]

Parameter description:

  • Column ID: parent column ID, single is the parent category ID, multiple categories are available "," is opened, '0' is to display the information of all first-level columns.
  • Show number of records: Display the first few records.
  • Number of title interceptions: intercept a few characters.
  • Whether to display the column name: 0 means not to display, 1 means to display it.
  • Operation type: 0-column latest; 1-column popular; 2-column recommendation; 3-column comment ranking; 4-column headline; 5-column download ranking.
  • Label template ID: The label template ID used by this label.
  • Only display images with captions: 0 means no restrictions, 1 means only display information about images with captions.
  • Number of columns to display: 0 means no limit.
参数 参数说明
栏目ID 父栏目ID
单个为父类别ID
多类别可用","格开
'0'为显示所有一级栏目的信息
显示条数 显示前几条ā记录
标题截取数 截取几个字符
是否显示栏目名 0为不显示,1为显示
操作类型 0:栏目最新
1:栏目热门
2:栏目推荐
3:栏目评论排行
4:栏目头条
5:栏目下载排行
标签模板ID 此标签所用的标签模板ID
只显示有标题图片 0为不限制,1为只显示有标题图片的信息
显示栏目数 0为不限制
显示头条操作类型 0:不显示栏目头条
1:栏目内容简介
2:栏目推荐信息
3:栏目头条信息
4:栏目最新信息
头条标题截取数 截取几个字符
头条简介截取数 截取几个字符
头条只显示有标题图片 0为不限制,1为只显示有标题图片的信息
头条的模板变量
(标签模板的页面模板内容中使用)
[!--sonclass.id--]:信息ID
[!--sonclass.title--]:信息标题
[!--sonclass.oldtitle--]:信息标题(不截取字数)
[!--sonclass.titlepic--]:标题图片
[!--sonclass.titleurl--]:信息链接
[!--sonclass.text--]:信息简介

Example:

[listsonclass]9,2,14,0,0,7,0,2[/listsonclass]
栏目ID为9
显示条数为2
标题截取数为14个字符
是否显示栏目名0为不显示
操作类型为0
模板ID为7
只显示有标题图片0为不限制
显示栏目数为2
 

So how is this implemented programmatically? You can refer to the following:

<div class="sae_gl">
<?php
$bclassid=$GLOBALS[navclassid]; //取得本栏目id
//取得本栏目下的子栏目
?>
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='$bclassid' order by `classid` desc ",7,24,0}]
<?php
//这里是取得该分类下的有图片的最新数据
$commbook=$empire->fetch1("select title,titlepic,smalltext,titleurl,keyboard,groupid,classid,newspath,filename,id from phome_ecms_news where classid = ".$bqr[classid]." and titlepic!='' order by newstime desc limit 1");
$commbookurl=sys_ReturnBqTitleLink($commbook);
?>
  <div class="gl_01" <?php $i++;if($i%2==0){echo 'id="gl_01"';} ?> >
     <ol class="gl_c"><h3><?=$bqr[classname]?></h3><a href="<?=$public_r[newsurl].$bqr[classpath]?>">更多>></a></ol>
         <div class="yd">
         <dl>
           <dt><a href="<?=$commbookurl?>"><img src="<?=$commbook[titlepic]?>" width="108px" height="85px" /></a></dt>
           <dd><b><a href="<?=$commbookurl?>"><?=$commbook[title]?></a></b><a class="uus" href="#"><?=esub($commbook[smalltext],84)?></a></dd>
         </dl>
         <ol class="ga_ic">
     <?php
//取得该分类下的最新数据
    $newbook=$empire->query("select title,titlepic,smalltext,titleurl,keyboard,newstime,groupid,classid,newspath,filename,id from phome_ecms_news  where classid =".$bqr[classid]." order by newstime desc limit 5");
    
    while($r=$empire->fetch($newbook)) {
    ?>
    <li><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>">·<?=$r[title]?></a><span class="riq"><?=date('Y-m-d',$r[newstime])?></span></li>
    <?php
     }
     //显示5条
    ?>  
         </ol>
         </div>
         <div class="bj_t"></div>
  </div>
  [/e:loop]
</div>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/752555.htmlTechArticleLoop sub-column data label (listsonclass) Label name: Loop sub-column data label (sys_ForSonclassData) Format: [listsonclass] Column ID, number of displayed items, number of title interceptions, whether to display columns...
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