修正主题的一些bug

This commit is contained in:
liyukun 2021-11-06 01:23:38 +08:00
parent 3f385526a1
commit eb5bb4e907
4 changed files with 27 additions and 10 deletions

View File

@ -120,6 +120,10 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '',
{
switch ($type) {
case "all":
//获取顶级分类
return get_document_category_all(0, $row, $display);
break;
case 'top':
//获取顶级分类
return get_document_category_by_parent(0, $row, $display);
@ -175,7 +179,6 @@ function tpl_get_channel($type, $typeid, $row = 100, $where = '', $orderby = '',
return $tempArr;
break;
case 'root':
if (!$typeid) {
throw new Exception('请指定要获取的栏目分类id');
}
@ -254,6 +257,24 @@ function get_document_category_by_parent($pid, $row, $display = 1)
return $tempArr;
}
function get_document_category_all( $display = 1)
{
$documentCategoryList = get_document_category_list();
$tempArr = array();
foreach ($documentCategoryList as $item) {
if (($display ? $item['display'] == 1 : true)) {
if ($item['pid'] == 0){
$tempArr[$item['id']] = $item;
}else{
$tempArr[$item['pid']]['child'][] = $item;
}
}
}
return $tempArr;
}
/**
* 模板-获取上一篇和下一篇
* $get=上一篇|下一篇

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -62,10 +62,8 @@
<div class="menu-plane">
<nav class="menu-header-plane">
<ul id="menu-header-list" class="menu-header-list">
<li id="menu-item-128" class="menu-item current_page_item menu-item-128">
<a href="/" aria-current="page">首页</a>
</li>
{ape:channel type="top"}
<li id="menu-item-1" class="menu-item menu-item-1"><a href="/" aria-current="page">首页</a></li>
{ape:channel type="all"}
<li id="menu-item-{$field.id}" class="menu-item {notempty name="field['child']"}menu-item-has-children{/notempty} {:IsActiveNav($cid,$field['id'])?'current-menu-item':''} menu-item-{$field['id']}">
{notempty name="field['child']"}
<a href="#" aria-current="page">{$field['title']}</a>
@ -90,7 +88,7 @@
<div class="user-menu-pc-search" onclick="openSearch()" title="搜索">
<i class="fal fa-search"></i>
</div>
<span class="user-menu-main">
<span class="user-menu-main user-menu-main-notlogin">
<a href="login.html"><button class="login-btn-header">登录</button></a>
</span>
</div>