更新 v1.8.0版本

This commit is contained in:
LyLme 2023-12-18 02:14:14 +08:00
parent 2e14658639
commit b9bcc00a21
2 changed files with 59 additions and 1 deletions

View File

@ -66,4 +66,62 @@ function lists($htmls) {
}
}
}
function listjson()
{
global $DB;
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC");
// 获取分类
$i = 0;
$g = 0;
$arr = array();
//初始化循环次数
while ($group = $DB->fetch($groups)) {
//循环所有分组
if($group["group_status"] == '0') {
continue;
}
if(!in_array($group['group_pwd'], $_SESSION['list']) && !empty($group['group_pwd'])) {
//如果 分组加密未在认证列表 并且分组设置了密码(不显示分组)
continue;
}
$sql = "SELECT * FROM `lylme_links` WHERE `group_id` = " . $group['group_id'] . " ORDER BY `link_order` ASC;";
$group_links = $DB->query($sql);
$link_num = $DB->num_rows($group_links);
// 获取返回字段条目数量
$arr[$g] = array("id" => $group['group_id'],"title" => $group['group_name'],"icon" => $group['group_icon'],);
//输出分组图标和标题
while ($link = $DB->fetch($group_links)) {
// 循环每个链接
$arr[$g]['items'][] = array("id" => $link['id'],
"title" => $link['name'],
"alias" => 'link'.$link['id'],
"keyword" => $link['name'],
"category_id" => $group['group_id'],
"icon" => $link['icon'],
"url" =>$link['url'],
"out" => true);
// 返回指定分组下的所有字段
$lpwd = true;
if ($link_num > $i) {
$i = $i + 1;
if(!empty($group['group_pwd']) && !empty($link['link_pwd'])) {
//分组和链接同时加密
//忽略链接加密正常显示分组
} elseif(!in_array($link['link_pwd'], $_SESSION['list']) && !empty($link['link_pwd'])) {
//当前链接加密
$lpwd = false;
}
if($link['link_status'] && $lpwd) {
}
//输出图标和链接
}
}
$g++;
}
return $arr;
}
?>

View File

@ -32,7 +32,7 @@
<div class="m-navlist">
<?php
//输出导航菜单
$tagslists = $DB->query("SELECT * FROM `lylme_tags`");
$tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) {
echo '<a href="' . $taglists["tag_link"] . '" class="list catlist"';
if ($taglists["tag_target"] == 1) {