Hongmu Notes
Home Program Notes How does Empire CMS call the sub-column under the specified parent column?
Program Notes Empire cms

How does Empire CMS call the sub-column under the specified parent column?

How does Empire CMS call the sub-column under the specified parent column?

In the code,

$Fclassid = 1;//Parent column ID
$SelectClassStyle = 'current';//Style when currently selected

 隐藏内容:评论后查看
<?php
//父栏目ID
$Fclassid = 1;
$SelectClassStyle = 'current';

// 查询一级菜单
$sql = $empire->query("select classid, sonclass, classname, islast, islist from {$dbtbpre}enewsclass where bclassid=$Fclassid and showclass=0 order by myorder asc");
if($Fclassid == $GLOBALS['navclassid']){$FclassStyle=$SelectClassStyle;}else{$FclassStyle='';}
?>
 <li class="<?=$FclassStyle?>"><a href="[!--news.url--]<?=$class_r[$Fclassid]['classpath']?>/ ">全部</a></li>
<?php 
while ($primaryMenu = $empire->fetch($sql)) {
    $classUrl = sys_ReturnBqClassname($primaryMenu, 9); 
    $topClass = '';

    // 判断是否为当前菜单
    if ($class_r[$GLOBALS['navclassid']]['classid'] == $primaryMenu['classid']) {
        $topClass = $SelectClassStyle;
    }
    
?>
<li class="<?=$topClass?>"><a href="<?=$classUrl?>"><?=$primaryMenu['classname']?></a></li>
<?}?>

微信赞赏

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…
👁 3748

Recommended reading

Flower garden planting display website template 0714

Flower garden planting display website template 0714 Practical Collection Yiyou template

An eyoucms website template targeting the flower garden planting and display industry. The design style is fresh and beautiful, and can display flower products, garden landscapes, planting techniques and brand stories. It helps flower and garden companies display products online and attract customers. Template display Installation instructions Website backend: /login.php Account: admin Password: admin Related articles Yiyou CMS installation FAQ summary Yiyou CMS (…
👁 60
Cable tray custom production website template 0090

Cable tray custom production website template 0090 Practical Collection Yiyou template

An eyoucms website template for cable tray customization manufacturing companies. The design style is professional and industrial, able to display bridge products, customized production services and engineering cases. It helps cable tray companies display their products online and attract power and construction customers. Template display Installation instructions Website backend: /login.php Account: admin Password: admin Related articles Yiyou CMS installation FAQ summary Yiyou CMS...
👁 29
(Adaptive mobile phone) HTML5 responsive pbootcms human resources website template management consulting service company website source code download 0646

(Adaptive mobile phone) HTML5 responsive pbootcms human resources website template management consulting service company website source code download 0646 Practical Collection pbootcms Template

A responsive human resources and consulting service PbootCMS website template that supports PC and WAP. The design style is professional and stable, and can display human resources services, management consulting and successful cases. Helps headhunting companies or management consulting agencies to establish a professional brand image online. Template display Installation instructions Website backend:/admin.php Account: admin Password: admin Unzip password: www.4s5.…
👁 36
(PC+WAP) Marble tile manufacturer pbootcms website template building materials decoration website source code download 0033

(PC+WAP) Marble tile manufacturer pbootcms website template building materials decoration website source code download 0033 Practical Collection pbootcms Template

This PbootCMS template is suitable for the marble tile and building materials decoration industry, and supports PC and WAP access. The design style is fashionable and elegant, which can highlight the texture and texture of ceramic tile products. The template includes core modules such as product classification, case display, and brand introduction. It is an ideal choice for building materials manufacturers or dealers to build official brand websites. Template display Installation instructions Website backend:/admin.php Account: admin Password: adm...
👁 31
PHP regular matches all href links

PHP regular matches all href links Language Notes PHP PHP collection

In HTML, links usually appear as <a> tags, whose href attribute represents the address of the link. You can use regular expressions to match <a> tags and extract the href attribute value within them. Here is an example regular expression: $pattern = '/<a\s[^>]*href=([\'"])(.*?…
👁 483
Flower gardening planting and picking website template 0715

Flower gardening planting and picking website template 0715 Practical Collection Yiyou template

This set of eyoucms templates is suitable for the flower horticulture planting and picking industry. The design style is fresh and natural, and can display flower products, horticulture planting, picking experience and brand stories. Helps gardening companies to display products online and attract family and leisure customers. Template display Installation instructions Website backend: /login.php Account: admin Password: admin Related articles Yiyou CMS installation FAQ summary Yiyou CMS...
👁 43