How does Empire CMS get the current list ID?
The example in this article describes how Imperial CMS obtains the current list ID in a custom list. Share it with everyone for your reference, the details are as follows:
Recommended to study "Empire cms Tutorial"
When I was doing a project with Empire CMS today, I found that in the Empire customization list Unable to get the ID of the current custom list. After analyzing the source code of Empire, we found that the default value sent by Empire is 0. Let's briefly record how to implement "Empire CMS custom list to obtain the current list ID" by modifying the source code
Introduction to the project functions mentioned above:
Users have created a large number of items using the custom list function Custom lists, and then in these custom lists, the names of custom lists of the same category must be obtained, and specific CSS styles must be added to the style of the current column name.
Custom list template code snippet
The code is as follows:
[e:loop={'select listid,listname,filepath from [!db.pre!]enewsuserlist where classid=1',100,24}] <li<?=($bqr[listid]==$GLOBALS[navclassid]?' class="this"':'')?>><?=$bqr[listname]?></li> [/e:loop]
By default, the value of $GLOBALS[navclassid] is empty, so we only need to modify the program Assign the ID value of the current custom list to $GLOBALS[navclassid]
Empire source program modification
By analyzing the program running process with the phpxref tool, it is found that the function that generates the custom information list is ReUserlist(), ReUserlist() further calls the ListHtml() function to generate an information list, and passes in the $enews event as 4. At this point, the list ID can be passed in through the ListHtml() function.
Open (/e/class/functions.php) and find the function ListHtml (you can search function ListHtml for quick search) and find the following code
The code is as follows:
$GLOBALS['navclassid']=$classid;
Change to
The code is as follows:
$GLOBALS['navclassid']=$enews==4?$userlistr['listid']:$classid;
Save (note the file encoding issue)
Regenerate the custom list, the required functions have been implemented!
I hope this article will be helpful to everyone’s website programming based on Imperial CMS.
The above is the detailed content of How to get the current list ID in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

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

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

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
