增加菜单排序

This commit is contained in:
LyLme 2023-12-17 23:44:51 +08:00
parent b423b2a5e6
commit 43d649d9ec
8 changed files with 334 additions and 273 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
$title = '导航菜单管理'; $title = '导航菜单管理';
include './head.php'; include './head.php';
$tagsrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_tags`")); $tagsrows = $DB->num_rows($site->getTags());
?> ?>
<main class="lyear-layout-content"> <main class="lyear-layout-content">
@ -32,6 +32,11 @@ if ($set == 'add') {
<option selected="selected" value="1">1. 新窗口打开</option> <option selected="selected" value="1">1. 新窗口打开</option>
</select></div> </select></div>
<div class="form-group"> <div class="form-group">
<label>排序权重: (*必填) </label><br>
<input type="text" class="form-control" name="sort" value="10" required>
<small class="help-block">(*必填) 数字越小越靠前</small>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary btn-block" value="添加"></form> <input type="submit" class="btn btn-primary btn-block" value="添加"></form>
</div> </div>
<br/><a href="./tag.php"><<返回</a> <br/><a href="./tag.php"><<返回</a>
@ -62,6 +67,11 @@ if ($set == 'add') {
echo 'value="1">1. 新窗口打开</option> echo 'value="1">1. 新窗口打开</option>
</select></div> </select></div>
<div class="form-group"> <div class="form-group">
<label>排序权重: (*必填) </label><br>
<input type="text" class="form-control" name="sort" value="' . $row['sort'] . '" required>
<small class="help-block">(*必填) 数字越小越靠前</small>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary btn-block" value="修改"></form> <input type="submit" class="btn btn-primary btn-block" value="修改"></form>
</div> </div>
<br/><a href="./tag.php"><<返回</a> <br/><a href="./tag.php"><<返回</a>
@ -69,24 +79,30 @@ if ($set == 'add') {
} elseif ($set == 'add_submit') { } elseif ($set == 'add_submit') {
$name = $_POST['name']; $name = $_POST['name'];
$link = $_POST['link']; $link = $_POST['link'];
$sort = $_POST['sort'] ?: 10;
if ($_POST['target'] == true) { if ($_POST['target'] == true) {
$target = 1; $target = 1;
} else { } else {
$target = 0; $target = 0;
} }
if ($name == NULL or $link == NULL) { if ($name == null or $link == null) {
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>'; echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
} else { } else {
$sql = "INSERT INTO `lylme_tags` (`tag_id`, `tag_name`, `tag_link`, `tag_target`) VALUES (NULL, '" . $name . "', '" . $link . "', '" . $target . "');"; $sql = "INSERT INTO `lylme_tags` (`tag_id`, `tag_name`, `tag_link`, `tag_target`,`sort`) VALUES (NULL, '" . $name . "', '" . $link . "', '" . $target . "','" . $sort . "');";
if ($DB->query($sql)) { if ($DB->query($sql)) {
echo '<script>alert("添加导航菜单 ' . $name . ' 成功!");window.location.href="./tag.php";</script>'; echo '<script>alert("添加导航菜单 ' . $name . ' 成功!");window.location.href="./tag.php";</script>';
} else echo '<script>alert("添加导航菜单失败");history.go(-1);</script>'; } else {
echo '<script>alert("添加导航菜单失败");history.go(-1);</script>';
}
} }
} elseif ($set == 'edit_submit') { } elseif ($set == 'edit_submit') {
$id = $_GET['id']; $id = $_GET['id'];
$sort = $_POST['sort'] ?: 10;
$rows2 = $DB->query("select * from lylme_tags where tag_id='$id' limit 1"); $rows2 = $DB->query("select * from lylme_tags where tag_id='$id' limit 1");
$rows = $DB->fetch($rows2); $rows = $DB->fetch($rows2);
if (!$rows) echo '<script>alert("当前记录不存在!");history.go(-1);</script>'; if (!$rows) {
echo '<script>alert("当前记录不存在!");history.go(-1);</script>';
}
$name = $_POST['name']; $name = $_POST['name'];
$link = $_POST['link']; $link = $_POST['link'];
if ($_POST['target'] == true) { if ($_POST['target'] == true) {
@ -94,29 +110,35 @@ if ($set == 'add') {
} else { } else {
$target = 0; $target = 0;
} }
if ($name == NULL or $link == NULL) { if ($name == null or $link == null) {
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>'; echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
} else { } else {
$sql = "UPDATE `lylme_tags` SET `tag_name` = '" . $name . "', `tag_link` = '" . $link . "', `tag_target` = '" . $target . "' WHERE `lylme_tags`.`tag_id` = " . $id . ";"; $sql = "UPDATE `lylme_tags` SET `tag_name` = '" . $name . "', `tag_link` = '" . $link . "', `tag_target` = '" . $target . "', `sort` = '" . $sort . "' WHERE `lylme_tags`.`tag_id` = " . $id . ";";
if ($DB->query($sql)) echo '<script>alert("修改导航菜单 ' . $name . ' 成功!");window.location.href="./tag.php";</script>'; if ($DB->query($sql)) {
else echo '<script>alert("修改导航菜单失败!");history.go(-1);</script>'; echo '<script>alert("修改导航菜单 ' . $name . ' 成功!");window.location.href="./tag.php";</script>';
} else {
echo '<script>alert("修改导航菜单失败!");history.go(-1);</script>';
}
} }
} elseif ($set == 'delete') { } elseif ($set == 'delete') {
$id = $_GET['id']; $id = $_GET['id'];
$sql = "DELETE FROM lylme_tags WHERE tag_id='$id'"; $sql = "DELETE FROM lylme_tags WHERE tag_id='$id'";
if ($DB->query($sql)) echo '<script>alert("删除成功!");window.location.href="./tag.php";</script>'; if ($DB->query($sql)) {
else echo '<script>alert("删除失败!");history.go(-1);</script>'; echo '<script>alert("删除成功!");window.location.href="./tag.php";</script>';
} else {
echo '<script>alert("删除失败!");history.go(-1);</script>';
}
} else { } else {
echo '<div class="alert alert-info">系统共有 <b>' . $tagsrows . '</b> 个导航菜单<br/><a href="./tag.php?set=add" class="btn btn-primary">新增导航菜单</a></div>'; echo '<div class="alert alert-info">系统共有 <b>' . $tagsrows . '</b> 个导航菜单<br/><a href="./tag.php?set=add" class="btn btn-primary">新增导航菜单</a></div>';
?> ?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped"> <table class="table table-striped">
<thead><tr><th>名称</th><th>链接</th><th>操作</th></tr></thead> <thead><tr><th>排序权重</th><th>名称</th><th>链接</th><th>操作</th></tr></thead>
<tbody> <tbody>
<?php <?php
$rs = $DB->query("SELECT * FROM `lylme_tags`"); $rs = $site->getTags();
while ($res = $DB->fetch($rs)) { while ($res = $DB->fetch($rs)) {
echo '<tr><td>' . $res['tag_name'] . '</td><td>' . $res['tag_link'] . '</td><td><a href="./tag.php?set=edit&id=' . $res['tag_id'] . '" class="btn btn-info btn-xs">编辑</a>&nbsp;<a href="./tag.php?set=delete&id=' . $res['tag_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'确定删除 ' . $res['tag_name'] . ' \');">删除</a></td></tr>'; echo '<tr><td>' . $res['sort'] . '</td><td>' . $res['tag_name'] . '</td><td>' . $res['tag_link'] . '</td><td><a href="./tag.php?set=edit&id=' . $res['tag_id'] . '" class="btn btn-info btn-xs">编辑</a>&nbsp;<a href="./tag.php?set=delete&id=' . $res['tag_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'确定删除 ' . $res['tag_name'] . ' \');">删除</a></td></tr>';
} }
?> ?>
</tbody> </tbody>

View File

@ -71,7 +71,8 @@ if(!empty($background = background())) {
<select title="分组" class="form-control" name="group_id" required> <select title="分组" class="form-control" name="group_id" required>
<option value="">请选择</option> <option value="">请选择</option>
<?php <?php
while($grouplist = $DB->fetch($grouplists)) { $applygroup = $site->getGroups();
while($grouplist = $DB->fetch($applygroup)) {
echo ' echo '
<option value="' . $grouplist["group_id"] . '">' . $grouplist["group_name"] . '</option>'; <option value="' . $grouplist["group_id"] . '">' . $grouplist["group_name"] . '</option>';
} }

View File

@ -24,8 +24,10 @@
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-2-M/jquery/3.5.1/jquery.min.js"></script> <script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-2-M/jquery/3.5.1/jquery.min.js"></script>
</head> </head>
<?php if(!empty(background())) { <?php if(!empty(background())) {
echo '<body style="background: url('.background().') no-repeat center/cover;">';} echo '<body style="background: url(' . background() . ') no-repeat center/cover;">';
else{ echo '<body>';}?> } else {
echo '<body>';
}?>
<div id="menu"><i></i></div> <div id="menu"><i></i></div>
<div class="list closed"> <div class="list closed">
<?php <?php
@ -66,7 +68,7 @@ if ($conf['tq']) {
<div class="sou"> <div class="sou">
<div class="lylme"> <div class="lylme">
<?php <?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` WHERE `sou_st` = 1 ORDER BY `lylme_sou`.`sou_order` ASC"); $soulists = $site->getSou();
$json = array(); $json = array();
while ($soulist = $DB->fetch($soulists)) { while ($soulist = $DB->fetch($soulists)) {
echo '<div class="ss hide"><div class="lg">' . $soulist["sou_icon"] . '</div> echo '<div class="ss hide"><div class="lg">' . $soulist["sou_icon"] . '</div>
@ -93,10 +95,12 @@ if ($conf['yan'] == 'true') {
echo '<p class="content">' . yan() . '</p>'; echo '<p class="content">' . yan() . '</p>';
} }
$i = 0; $i = 0;
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while($taglists = $DB->fetch($tagslists)) { while($taglists = $DB->fetch($tagslists)) {
echo '<a class="nav-link" href="' . $taglists["tag_link"] . '"'; echo '<a class="nav-link" href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a>'; echo '>' . $taglists["tag_name"] . '</a>';
if($i < $DB->num_rows($tagslists) - 1) { if($i < $DB->num_rows($tagslists) - 1) {
$i++; $i++;

View File

@ -35,7 +35,9 @@
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $DB->query("SELECT * FROM `lylme_tags`");
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo '<a href="' . $taglists["tag_link"] . '" class="list catlist"'; echo '<a href="' . $taglists["tag_link"] . '" class="list catlist"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '><b>' . $taglists["tag_name"] . '</b></a>'; echo '><b>' . $taglists["tag_name"] . '</b></a>';
} }
?> ?>
@ -53,18 +55,21 @@ while ($taglists = $DB->fetch($tagslists)) {
<div class="type-list"> <div class="type-list">
<?php <?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo ' echo '
<div class="list"> <div class="list">
<a href="' . $taglists["tag_link"] . '" class="list catlist"'; <a href="' . $taglists["tag_link"] . '" class="list catlist"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a> </div> '; echo '>' . $taglists["tag_name"] . '</a> </div> ';
} }
?> ?>
<hr><p style="margin: 10px;color: #000;font-weight: bold;font-size:18px">分组</p> <hr><p style="margin: 10px;color: #000;font-weight: bold;font-size:18px">分组</p>
<?php <?php
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC");
$groups = $site->getGroups();
while ($group = $DB->fetch($groups)) { while ($group = $DB->fetch($groups)) {
echo '<div class="list"> echo '<div class="list">
<a href="#category-' . $group["group_id"] . '" class="list catlist"> <a href="#category-' . $group["group_id"] . '" class="list catlist">
@ -101,12 +106,12 @@ while ($group = $DB->fetch($groups)) {
</div> </div>
<div class="search-btnlist"> <div class="search-btnlist">
<?php <?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); $soulists = $site->getSou();
while ($soulist = $DB->fetch($soulists)) { while ($soulist = $DB->fetch($soulists)) {
if ($soulist["sou_st"] == 1) { if ($soulist["sou_st"] == 1) {
if(!$fso) { if(!$fso) {
echo '<button class="search-btn" data-url="'; echo '<button class="search-btn" data-url="';
if (checkmobile()&& $soulist["sou_waplink"] != NULL) { if (checkmobile() && $soulist["sou_waplink"] != null) {
echo $soulist["sou_waplink"]; echo $soulist["sou_waplink"];
} else { } else {
echo $soulist["sou_link"]; echo $soulist["sou_link"];
@ -117,7 +122,7 @@ while ($soulist = $DB->fetch($soulists)) {
$fso = true; $fso = true;
} }
echo ' <div class="list" data-url="'; echo ' <div class="list" data-url="';
if (checkmobile()&& $soulist["sou_waplink"] != NULL) { if (checkmobile() && $soulist["sou_waplink"] != null) {
echo $soulist["sou_waplink"]; echo $soulist["sou_waplink"];
} else { } else {
echo $soulist["sou_link"]; echo $soulist["sou_link"];
@ -198,7 +203,9 @@ include'list.php';?>
</script> </script>
<script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script> <script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
<!--天气代码替换处 E--> <!--天气代码替换处 E-->
<?php }else{echo '<style>.search-main-w {display: none;} @media only screen and (max-width: 1200px){.search-main {padding-top:70px !important;}}</style>';}?> <?php } else {
echo '<style>.search-main-w {display: none;} @media only screen and (max-width: 1200px){.search-main {padding-top:70px !important;}}</style>';
}?>
<!--iconfont--> <!--iconfont-->
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_3000268_oov6h4vru0h.css" /> <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_3000268_oov6h4vru0h.css" />
<script src="//at.alicdn.com/t/font_3000268_oov6h4vru0h.js" type="text/javascript" charset="utf-8"></script> <script src="//at.alicdn.com/t/font_3000268_oov6h4vru0h.js" type="text/javascript" charset="utf-8"></script>
@ -214,5 +221,5 @@ include'list.php';?>
<!--二开说明:--> <!--二开说明:-->
<!--1. 当前主题使用基于baisuTwo主题开发作者baisu--> <!--1. 当前主题使用基于baisuTwo主题开发作者baisu-->
<!--2. 原项目地址https://gitee.com/baisucode/baisu-two--> <!--2. 原项目地址https://gitee.com/baisucode/baisu-two-->
<!--3. 二开作者:六零 <!--3. 二开作者:六零-->
<!--4. 修改了适配LyLme Spage修改了部分CSS删除不适用与本项目的代码--> <!--4. 修改了适配LyLme Spage修改了部分CSS删除不适用与本项目的代码-->

View File

@ -23,7 +23,9 @@
<link rel="stylesheet" href="<?php echo $templatepath;?>/css/tag.css?v=20220611" type="text/css"> <link rel="stylesheet" href="<?php echo $templatepath;?>/css/tag.css?v=20220611" type="text/css">
</head> </head>
<body onload="FocusOnInput()"><div class="banner-video"> <body onload="FocusOnInput()"><div class="banner-video">
<?php if(!empty(background())){ echo '<img src="'.background().'">';}?> <?php if(!empty(background())) {
echo '<img src="' . background() . '">';
}?>
<div class="bottom-cover" style="background-image: linear-gradient(rgba(255, 255, 255, 0) 0%, rgb(244 248 251 / 0.6) 50%, rgb(244 248 251) 100%);"> <div class="bottom-cover" style="background-image: linear-gradient(rgba(255, 255, 255, 0) 0%, rgb(244 248 251 / 0.6) 50%, rgb(244 248 251) 100%);">
</div> </div>
@ -35,7 +37,7 @@
<ul> <ul>
<li data-lylme="search"><a>搜索</a><span></span></li> <li data-lylme="search"><a>搜索</a><span></span></li>
<?php <?php
$groups = $DB->query("SELECT * FROM `lylme_groups` WHERE `group_pwd` = 0 ORDER BY `group_order` ASC"); // 获取分类 $groups = $site->getGroups(); // 获取分类
while ($group = $DB->fetch($groups)) { //循环所有分组 while ($group = $DB->fetch($groups)) { //循环所有分组
echo '<li data-lylme="group_' . $group["group_id"] . '"><a>' . $group["group_name"] . '</a><span></span></li>' . "\n"; echo '<li data-lylme="group_' . $group["group_id"] . '"><a>' . $group["group_name"] . '</a><span></span></li>' . "\n";
@ -61,10 +63,12 @@ while ($group = $DB->fetch($groups)) { //循环所有分组
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<?php <?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"'; echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a></li> echo '>' . $taglists["tag_name"] . '</a></li>
'; ';
} }
@ -97,7 +101,7 @@ if ($conf['tq'] != 'false') {
<div class="search-group group-a s-current" style=" margin-top: 50px;"> <div class="search-group group-a s-current" style=" margin-top: 50px;">
<ul class="search-type"> <ul class="search-type">
<?php <?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); $soulists = $site->getSou();
while ($soulist = $DB->fetch($soulists)) { while ($soulist = $DB->fetch($soulists)) {
if ($soulist["sou_st"] == 1) { if ($soulist["sou_st"] == 1) {
echo ' <li> echo ' <li>

View File

@ -23,8 +23,10 @@
<link rel="stylesheet" href="<?php echo $cdnpublic ?>/assets/css/fontawesome-free5.13.0.css" type="text/css"> <link rel="stylesheet" href="<?php echo $cdnpublic ?>/assets/css/fontawesome-free5.13.0.css" type="text/css">
</head> </head>
<?php if(!empty(background())) { <?php if(!empty(background())) {
echo '<body onload="FocusOnInput()" style="background-image: url('.background().');background-size: cover;">';} echo '<body onload="FocusOnInput()" style="background-image: url(' . background() . ');background-size: cover;">';
else{ echo '<body onload="FocusOnInput()">';}?> } else {
echo '<body onload="FocusOnInput()">';
}?>
<nav class="navbar navbar-expand-lg navbar-light fixed-top" style="position: absolute; z-index: 10000;"> <nav class="navbar navbar-expand-lg navbar-light fixed-top" style="position: absolute; z-index: 10000;">
<button class="navbar-toggler collapsed" style="border: none; outline: none;"type="button" data-toggle="collapse" data-target="#navbarsExample05" aria-controls="navbarsExample05" aria-expanded="false" aria-label="Toggle navigation"> <button class="navbar-toggler collapsed" style="border: none; outline: none;"type="button" data-toggle="collapse" data-target="#navbarsExample05" aria-controls="navbarsExample05" aria-expanded="false" aria-label="Toggle navigation">
@ -35,17 +37,20 @@
<div class="collapse navbar-collapse" id="navbarsExample05"> <div class="collapse navbar-collapse" id="navbarsExample05">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<?php <?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"'; echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a></li> echo '>' . $taglists["tag_name"] . '</a></li>
'; ';
} }
?> ?>
<?php if ($conf['tq'] != 'false') { <?php if ($conf['tq'] != 'false') {
echo '<div id="he-plugin-simple"></div> echo '<div id="he-plugin-simple"></div>
<script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>';}?> <script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>';
}?>
</ul> </ul>
</div> </div>
@ -104,12 +109,16 @@ if ($conf['yan'] == 'true') {
</div> </div>
<ul class="search-type" id="chso"> <ul class="search-type" id="chso">
<?php <?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); $soulists = $site->getSou();
while ($soulist = $DB->fetch($soulists)) { while ($soulist = $DB->fetch($soulists)) {
if($soulist["sou_st"] == 1) { if($soulist["sou_st"] == 1) {
echo ' <li> echo ' <li>
<input hidden="" checked="" type="radio" name="type" id="type-' . $soulist["sou_alias"] . '" value="'; <input hidden="" checked="" type="radio" name="type" id="type-' . $soulist["sou_alias"] . '" value="';
if(checkmobile()&&$soulist["sou_waplink"]!=NULL){echo $soulist["sou_waplink"];}else{echo $soulist["sou_link"];} if(checkmobile() && $soulist["sou_waplink"] != null) {
echo $soulist["sou_waplink"];
} else {
echo $soulist["sou_link"];
}
echo '"data-placeholder="' . $soulist["sou_hint"] . '"> echo '"data-placeholder="' . $soulist["sou_hint"] . '">
<label for="type-' . $soulist["sou_alias"] . '" style="font-weight:600"> <label for="type-' . $soulist["sou_alias"] . '" style="font-weight:600">
' . $soulist["sou_icon"] . ' ' . $soulist["sou_icon"] . '

View File

@ -24,11 +24,13 @@
<nav> <nav>
<ul> <ul>
<?php <?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo ' echo '
<li><a href="' . $taglists["tag_link"] . '"'; <li><a href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a></li> echo '>' . $taglists["tag_name"] . '</a></li>
'; ';
} }

View File

@ -32,8 +32,10 @@
<link rel="stylesheet" href="<?php echo $templatepath;?>/css/style.css?v=20220510" type="text/css"> <link rel="stylesheet" href="<?php echo $templatepath;?>/css/style.css?v=20220510" type="text/css">
</head> </head>
<?php if(!empty(background())) { <?php if(!empty(background())) {
echo '<body onload="FocusOnInput()" style="background-image: url('.background().');background-size: cover;/**/margin: 0;padding: 0;background: linear-gradient(#3c65e1, #195bc1, #6011d5, #5d21a8, #53097d);min-height: 100vh;display: flex;justify-content: center;align-items: center;background-attachment: fixed;">';} echo '<body onload="FocusOnInput()" style="background-image: url(' . background() . ');background-size: cover;/**/margin: 0;padding: 0;background: linear-gradient(#3c65e1, #195bc1, #6011d5, #5d21a8, #53097d);min-height: 100vh;display: flex;justify-content: center;align-items: center;background-attachment: fixed;">';
else{ echo '<body onload="FocusOnInput()">';}?> } else {
echo '<body onload="FocusOnInput()">';
}?>
<!---左侧导航开始--> <!---左侧导航开始-->
<script> <script>
$(function(){ $(function(){
@ -50,7 +52,7 @@
<li><a href="#main"><svg class="icon" aria-hidden="true" width="200" height="200"><use xlink:href="#icon-sousuo"></use></svg><span>搜索</span></a></li> <li><a href="#main"><svg class="icon" aria-hidden="true" width="200" height="200"><use xlink:href="#icon-sousuo"></use></svg><span>搜索</span></a></li>
<?php <?php
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC"); $groups = $site->getGroups();
while ($group = $DB->fetch($groups)) { while ($group = $DB->fetch($groups)) {
echo '<li><a href="#category-' . $group["group_id"] . '">' . $group["group_icon"] . '<span>' . $group["group_name"] . '</span></a></li>'; echo '<li><a href="#category-' . $group["group_id"] . '">' . $group["group_icon"] . '<span>' . $group["group_name"] . '</span></a></li>';
} }
@ -71,17 +73,20 @@ echo '<li><a href="#category-' . $group["group_id"] . '">' . $group["group_icon"
<div class="collapse navbar-collapse" id="navbarsExample05"> <div class="collapse navbar-collapse" id="navbarsExample05">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<?php <?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`"); $tagslists = $site->getTags();
while ($taglists = $DB->fetch($tagslists)) { while ($taglists = $DB->fetch($tagslists)) {
echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"'; echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blank"'; if ($taglists["tag_target"] == 1) {
echo ' target="_blank"';
}
echo '>' . $taglists["tag_name"] . '</a></li> echo '>' . $taglists["tag_name"] . '</a></li>
'; ';
} }
?> ?>
<?php if ($conf['tq'] != 'false') { <?php if ($conf['tq'] != 'false') {
echo '<div id="he-plugin-simple"></div> echo '<div id="he-plugin-simple"></div>
<script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>';}?> <script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>';
}?>
</ul> </ul>
</div> </div>
@ -140,12 +145,16 @@ if ($conf['yan'] == 'true') {
</div> </div>
<ul class="search-type" id="chso"> <ul class="search-type" id="chso">
<?php <?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC"); $soulists = $site->getSou();
while ($soulist = $DB->fetch($soulists)) { while ($soulist = $DB->fetch($soulists)) {
if($soulist["sou_st"] == 1) { if($soulist["sou_st"] == 1) {
echo ' <li> echo ' <li>
<input hidden="" checked="" type="radio" name="type" id="type-' . $soulist["sou_alias"] . '" value="'; <input hidden="" checked="" type="radio" name="type" id="type-' . $soulist["sou_alias"] . '" value="';
if(checkmobile()&&$soulist["sou_waplink"]!=NULL){echo $soulist["sou_waplink"];}else{echo $soulist["sou_link"];} if(checkmobile() && $soulist["sou_waplink"] != null) {
echo $soulist["sou_waplink"];
} else {
echo $soulist["sou_link"];
}
echo '"data-placeholder="' . $soulist["sou_hint"] . '"> echo '"data-placeholder="' . $soulist["sou_hint"] . '">
<label for="type-' . $soulist["sou_alias"] . '" style="font-weight:600"> <label for="type-' . $soulist["sou_alias"] . '" style="font-weight:600">
' . $soulist["sou_icon"] . ' ' . $soulist["sou_icon"] . '
@ -189,12 +198,15 @@ lists($html);
</div> </div>
<div class="mt-5 mb-3 footer text-muted text-center"> <div class="mt-5 mb-3 footer text-muted text-center">
<!--备案信息--> <!--备案信息-->
<?php if($conf['icp'] != NULL){ <?php if($conf['icp'] != null) {
echo '<img src="./assets/img/icp.png" width="16px" height="16px" /><a href="http://beian.miit.gov.cn/" class="icp" target="_blank" _mstmutation="1" _istranslated="1">'.$conf['icp'].'</a>'; } ?> echo '<img src="./assets/img/icp.png" width="16px" height="16px" /><a href="http://beian.miit.gov.cn/" class="icp" target="_blank" _mstmutation="1" _istranslated="1">' . $conf['icp'] . '</a>';
} ?>
<!--版权信息--> <!--版权信息-->
<p> <?php echo $conf['copyright']; ?></p> <p> <?php echo $conf['copyright']; ?></p>
<!--网站统计--> <!--网站统计-->
<?php if($conf['wztj'] != NULL){echo $conf["wztj"];}?> <?php if($conf['wztj'] != null) {
echo $conf["wztj"];
}?>
</div> </div>
<script> <script>