Home CMS Tutorial Empire CMS The 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

Nov 30, 2019 pm 01:08 PM
Empire cms

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]
Copy after login

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]
Copy after login

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 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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Where are the settings for the mobile version of Empire CMS? Where are the settings for the mobile version of Empire CMS? Apr 17, 2024 pm 12:12 PM

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.

Where is the imperial cms website map? Where is the imperial cms website map? Apr 17, 2024 am 10:48 AM

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.

Where can I put the empire cms template file for easy use? Where can I put the empire cms template file for easy use? Apr 17, 2024 am 07:22 AM

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.

Where to find the empire cms database configuration file Where to find the empire cms database configuration file Apr 17, 2024 am 06:42 AM

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

Where is the imperial cms resource network template? Where is the imperial cms resource network template? Apr 17, 2024 am 10:00 AM

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

Where is the Baidu active push plug-in for Imperial CMS? Where is the Baidu active push plug-in for Imperial CMS? Apr 17, 2024 am 11:00 AM

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.

Where is the automatic publishing interface of Empire CMS? Where is the automatic publishing interface of Empire CMS? Apr 17, 2024 am 09:03 AM

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.

Is empire cms free? Is empire cms free? Apr 17, 2024 am 11:24 AM

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.

See all articles