


Introduction to Empire CMS loop sub-column tag listsonclass_PHP tutorial
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>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The mobile settings of Empire CMS are located in the "Mobile Template" of the "Template Management" module. The specific steps include: enabling the template, selecting the application channel, editing the template content, and saving the settings.

The Empire CMS sitemap can be found by accessing the config.inc.php file and checking the dositemap settings. If set to "on", sitemap is enabled. The sitemap path is located in the sitemapurl setting and can be accessed via a browser or downloaded via FTP.

The ideal location for the Empire CMS template file is /e/template/default/skin/default/. Secondly, it can also be placed in /e/data/skins/ and /e/skin/. You need to pay attention to maintaining the folder structure and setting file permissions. and regular backups.

The Imperial CMS database configuration file is located in the website root directory e/config/db.inc.php. It contains the following configuration information: $dbhost: database server address $dbuser: database user name $dbpass: database password $dbname: database name $dbport :Database port $dbcharset: Database character set

Empire CMS template download location: Official template download: https://www.phome.net/template/ Third-party template website: https://www.dedecms.com/diy/https://www.0978.com.cn /https://www.jiaocheng.com/Installation method: Download template Unzip template Upload template Select template

The imperial cms Baidu active push plug-in is located in the root directory /e/api/baidu/push.php. The specific configuration steps are as follows: 1. Upload the plug-in file to the specified path. 2. Configure the "Baidu Active Push" option in the Imperial CMS background, including push address, API Key and push interval. 3. Get Baidu push information: Push address: https://data.zz.baidu.com/urls?site=YOUR_SITE&token=YOUR_API_KEY, API Key: log in to Baidu search resource platform to obtain. 4. Update the API Key regularly and set a reasonable push interval.

The automatic publishing interface of Empire CMS is located at /e/api/web/postinfo.php. The usage steps are as follows: visit /e/api/web/postinfo.php address and use HTTP POST to submit the article title, column ID, category ID, author and article The content and other data interfaces will return a response in JSON format, which contains the publishing results and article ID.

Yes, Empire CMS is a free and open source content management system (CMS). It is a lightweight CMS that is feature-rich and easy to use. Empire CMS is licensed under the GNU General Public License (GPL), which means it is free to download, install and use. For commercial use, it offers a paid version that offers additional features and support such as ad management, online payments, and premium technical support.
