Hongmu Notes
Home Program Notes EmpireCMS – Optimizing the database by removing the article description field
Program Notes Empire cms

EmpireCMS – Optimizing the database by removing the article description field

EmpireCMS – Optimizing the database by removing the article description field

Remove the `smalltext` summary field; then, for each article query, extract the first 80 characters as the article summary – this approach is suitable for websites where custom summaries are not required.

Supports querying specified data tables.

function:

function user_smalltext($id,$stb,$fontNume = 80,$tabe='news'){
    global $empire,$dbtbpre;
    $fr=$empire->fetch1("select newstext from {$dbtbpre}ecms_{$tabe}_data_{$stb} where id='{$id}'");
    //自定义处理
    if($tabe!='news'){
        
    }
    return mb_substr( strip_tags($fr['newstext']), 0, $fontNume, 'UTF-8');
}

List page call:

 隐藏内容:评论后查看
$smalltext =  user_smalltext($r[id],$r[stb],80);
$listtemp='<div class="col-sm-6 list-item-img-col">
			<div class="list-item-img-more">
				<p>'.$smalltext.'...</p>
				<em>点击查看详细信息</em>
			</div>
		</div>';

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Empire CMS database statement & SQL statement format

Empire CMS database statement & SQL statement format Program Notes Empire cms

Introduction to Imperial CMS extended SQL program writing, basic examples of Imperial CMS database statements & SQL statement formats: Note: The following examples are based on placing PHP files in the system root directory. Example 1: Connect to MYSQL program. (a.php)<?php require('e/class/connect.php'); //Introduce database configuration files and public function files requ…
👁 351
Empire CMS obtains the system COOKIE variable function getcvar()

Empire CMS obtains the system COOKIE variable function getcvar() Program Notes Empire cms

Get the system COOKIE variable function syntax: getcvar($var,$ecms) Description: $var: is the variable name $ecms: 0 is to set the foreground COOKIE variable, 1 is to set the background COOKIE variable. This parameter can be omitted and defaults to 0. Usage example: getcvar('mlusername'), get the user name of the front-end login member getcvar('loginu...
👁 295
Empire CMS smart label call field collection

Empire CMS smart label call field collection Program Notes Empire cms

Collect and classify all fields that support smart tag calls into Empire CMS smart tags: [e:loop={column ID/topic ID, number of items displayed, operation type, only display pictures with titles, additional SQL conditions, display sorting}] Template code content [/e:loop] Calling time: <?=date('m-d',$bqr[newstime])?> <?=dat…
👁 3749

Recommended reading

(PC + WAP) WeChat Mini Program Development Agency – Display and Sales; PBootCMS Website Template – Software Development Company Website Source Code Download – 0688

(PC + WAP) WeChat Mini Program Development Agency – Display and Sales; PBootCMS Website Template – Software Development Company Website Source Code Download – 0688 Practical Collection pbootcms Template

A PbootCMS website template designed specifically for showcasing the brand of software development and WeChat Mini Program development companies, supporting both PC and WAP devices. Its modern, tech-oriented design makes it ideal for IT and internet technology enterprises. The template includes built-in modules for displaying service offerings, development case studies, and technical team profiles, helping software companies efficiently acquire customers and build a strong industry reputation. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password:...
👁 46
Bilingual (Chinese/English) Outdoor Tent and Sleeping Bag Website Template – 0145

Bilingual (Chinese/English) Outdoor Tent and Sleeping Bag Website Template – 0145 Practical Collection Yiyou template

This bilingual (Chinese/English) EyouCMS template is ideal for businesses specializing in outdoor tent camps, tents, and sleeping bags. Its international outdoor design style effectively showcases outdoor gear products, tents, sleeping bags, and the company's competitive advantages in the export market. It helps outdoor equipment exporters promote their brands across global markets. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 45
WARNING: Skipping requests as it is not installed.

WARNING: Skipping requests as it is not installed. Language Notes python

This error message indicates that your Python environment lacks the requests library, and this library is called in your code, so Python cannot execute your code normally. The solution to this problem is to install the requests library. You can use the pip command on the command line to install: pip install requests If you are using Python3, you can use the pip3 command …
👁 2100
Responsive album-style wallpaper website template – 0788

Responsive album-style wallpaper website template – 0788 Practical Collection Yiyou template

This EyouCMS responsive template is ideal for photo albums, image galleries, and wallpaper websites. Its visually appealing design is perfect for showcasing exquisite images, wallpaper resources, photographic works, and photo album collections. It helps visual creative platforms attract users to browse and download content online. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (E...
👁 39
(PC + WAP) Property Management Website Template – pbootCMS Property Management & Security Website Source Code Download (0065)

(PC + WAP) Property Management Website Template – pbootCMS Property Management & Security Website Source Code Download (0065) Practical Collection pbootcms Template

This PbootCMS template is specifically designed for property management and security service companies, supporting both PC and WAP mobile devices. Its professional and sophisticated design effectively showcases property management services, security solutions, and corporate credentials. It helps property management firms build a strong online brand presence, enhance customer trust, and expand their business reach. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin...
👁 62
(Adaptive mobile version) Fire extinguisher – dry powder firefighting equipment; PbootCMS website template; Red firefighting equipment website source code download – 0689

(Adaptive mobile version) Fire extinguisher – dry powder firefighting equipment; PbootCMS website template; Red firefighting equipment website source code download – 0689 Practical Collection pbootcms Template

A PbootCMS red firefighting equipment website template for fire extinguishers and firefighting equipment, compatible with both PC and WAP devices. The eye-catching and professional design is ideal for showcasing firefighting equipment, firefighting devices, and safety solutions. It enables firefighting equipment manufacturers to display their products online, attracting both corporate and government procurement opportunities. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4...
👁 38