search
HomeCMS TutorialEmpire CMSThe usage of ecms smart tag e:loop is to obtain the required records by executing sql

The usage of ecms smart tag e:loop is to obtain the required records by executing sql

Under certain conditions, we require specified information to be displayed on a certain page of the website.

However, if this specification is hard-coded, it will not work. Future changes will be a big trouble;

At this time, the advantages of sql statements are highlighted. Using sql statements, you only need to change the numbers to completely replace the displayed content;
Recommended to learn "Empire cms tutorial

The code is as follows:

[e:loop={'select * from phome_ecms_news where id in (2452,2697,2299,2267)',4,24,0}]
<li><a href="<?=$bqsr[&#39;titleurl&#39;]?>">
<?=esub($bqr[title],28)?>
</a><span></span></li>
[/e:loop]

According to the specification of the sql statement, return the content information with ID numbers 2452, 2697, 2299, 2267, and the code behind The penultimate parameter is 24,
This is the execution of sql.
(The following content comes from the Internet to explain the usage of smart tags)
Instructions for using smart tags:
Smart tag (e:loop)
Format:
[e:loop={column ID/ Topic ID, display number, operation type, only display pictures with titles, additional SQL conditions, display sorting}]
Template code content
[/e:loop]
Example:

The code is as follows:

[e:loop={栏目ID/专题ID,显示条数,操作类型,只显示有标题图片,附加SQL条件,显示排序}]
<tr>
<td>
<a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a> (<?=date(&#39;Y-m-d&#39;,$bqr[newstime])?>)
</td>
</tr>
[/e:loop]

The specific operation type description is as follows:
Operation type description
0 Latest in each column
1 Popular in each column
2 Recommended in each column
9 Each column Comment ranking
12 Headline information of each column
15 Download ranking of each column
25 Rating ranking of each column
26 Voting ranking of each column
3 All information latest (default table)
4 All Popular information (default table)
5 All information recommendations (default table)
10 All information comment rankings (default table)
13 All information headlines (default table)
16 All information download rankings (default table) Table)
27 All information rating ranking (default table)
28 All information voting ranking (default table)
6 Topic latest information
7 Topic hot information
8 Topic recommendation information
11 Topic comment ranking
14 Topic headline
17 Each topic download ranking
29 Each topic rating ranking
30 Each topic voting ranking
18 Each table is the latest (column ID='table name')
19 Popularity of each table (column ID='table name')
20 Recommendation of each table (column ID='table name')
21 Comment ranking of each table (column ID='table name')
22 Headline information of each table (column ID='table name')
23 Download ranking of each table (column ID='table name')
31 Rating ranking of each table (column ID='table name')
32 Voting ranking of each table (column ID='table name')
24 Query by sql (column ID='sql statement')
The data table prefix is ​​available: "[!db.pre!]" express

The above is the detailed content of The usage of ecms smart tag e:loop is to obtain the required records by executing sql. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:www.word666.com/cms/. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.