增加 主题lylme

This commit is contained in:
LyLme 2022-03-19 22:11:12 +08:00
parent 0fc05722f7
commit 222b23cef9
5 changed files with 1116 additions and 0 deletions

View File

@ -0,0 +1,721 @@
#search-text
{
/* backdrop-filter: saturate(100%) blur(10px); */
border: 0;
width: 80%;
/*height: 60px; */
/* line-height: 50px; */
/* text-indent: 10px; */
font-size: 18px;
color: #222226;
/* border-radius: 15px; */
background: 0;
/* transition: 0.3s all linear; */
/* padding-left: 20px; */
/* box-shadow: 0px 2px 12px 0px rgb(34 34 38 / 10%); */
}
#search-lylme
{
text-align: initial;
backdrop-filter: saturate(100%) blur(10px);
border: 0;
width: 100%;
/*height: 60px;*/
line-height: 50px;
text-indent: 10px;
font-size: 18px;
color: #222226;
border-radius: 15px;
background: rgba(255, 255, 255, 0.5);
transition: 0.3s all linear;
padding-left: 10px;
box-shadow: 0px 2px 12px 0px rgb(34 34 38 / 10%);
}
#search-text::-webkit-input-placeholder
{
color: #555666;
font-size: 16px;
}
#search-submit
{
position: absolute;
top: 0;
right: 0;
background: none;
border: 0;
/* border-radius: 20px; */
width: auto;
/*height: 60px;*/
border-radius: 0 10px 10px 0;
outline: none;
/* background-color: #4e6ef2; */
}
#search-submit:hover
{
background-color: rgba(255, 255, 255, 0.342)
}
.search-box
{
justify-content: center;
align-items: center;
/*height: 60px;*/
}
#main
{
text-shadow: 0px 0px 3px rgb(0 0 0 / 70%);
text-align: center;
color: white;
font-weight: bold;
}
#show_time
{
font-size: 80px;
}
#show_date
{
margin-bottom: 16px;
font-size: 18px;
color: #fff;
}
#checke-so
{
display: inline;
}
a:hover
{
text-decoration: none !important;
font-weight: bold !important
}
a.icp
{
font-size: 12px;
color: #bbb;
text-align: center
}
.navbar .navbar-expand-lg .navbar-light .fixed-top
{
position: absolute;
z-index: 10000
}
.bottom-cover
{
background-image: linear-gradient(rgba(255,255,255,0) 0%,rgb(244 248 251 / 0.6) 50%,rgb(244 248 251) 100%)
}
.navbar-light .navbar-toggler
{
color: #fff !important
}
p.content
{
text-align: center;
padding: 5px 30px;
border-radius: 10px;
font-size: 12px;
color: #fff;
font-weight: 500
}
::-webkit-scrollbar
{
display: none
}
.back-to
{
bottom: 55px;
overflow: hidden;
position: fixed;
right: 10px;
width: 110px;
z-index: 999
}
.back-to .back-top
{
background: url("./images/top.png") no-repeat scroll 0 0 transparent;
display: block;
float: right;
height: 50px;
margin-left: 10px;
outline: 0 none;
text-indent: -9999em;
width: 50px
}
.back-to .back-top:hover
{
background-position: -50px 0
}
.mylist li.lylme-3 img
{
display: block;
width: 45px;
height: 45px;
padding: 8px;
background: #fff;
border: 1px solid #eee;
border-radius: 10px;
margin: 0 auto
}
h2.title
{
text-align: center;
color: #fff;
font-size: 36px;
font-weight: 600;
text-shadow: 1px 1px 8px #504b4b
}
body
{
font-size: 14px;
background: #95aec5;
overflow-x: hidden;
background-repeat: no-repeat;
background-attachment: fixed;
}
a
{
text-decoration: none
}
a:hover
{
text-decoration: none
}
svg.icon
{
width: 20px;
height: 20px;
margin: 0 5px 0 8px;
/* vertical-align: -0.15em; */
fill: currentColor;
overflow: hidden;
}
svg.sw
{
width: 16px;
height: 16px;
margin: 5px;
}
svg.lylme
{
width: 20px;
height: 20px;
}
ul#chso
{
position: inherit;
display: none;
top: 5px
}
.navbar-light .navbar-nav .nav-link
{
color: #fff !important;
font-size: 16px;
font-weight: bold;
text-shadow: 0px 1px 0px #000
}
#search
{
width: 100%;
margin: 0;
padding: 0 0 10px;
position: relative;
z-index: 2000;
border-radius: 5px
}
#search form
{
position: relative;
margin-top: 15px
}
#search button i
{
color: #ddd;
font-size: 18px
}
.search-group
{
text-align: center;
}
.s-current .search-type
{
padding-left: 0;
display: block
}
.s-current
{
display: block
}
#search-list
{
position: relative;
overflow-x: auto
}
#search-list::-webkit-scrollbar
{
display: none
}
.s-type
{
position: absolute;
top: 0;
left: 0;
z-index: 13;
width: 75px
}
.s-type:hover
{
height: auto
}
.s-type>span
{
display: block;
height: 31px;
width: 75px
}
.s-type-list
{
display: none;
position: absolute;
top: 31px;
padding: 9pt 0;
width: 70px;
background: #fff;
border-radius: 5px;
box-shadow: 0 9px 20px rgba(0,0,0,.16)
}
.s-type-list:before
{
position: absolute;
top: -1pc;
left: 20px;
content: '';
display: block;
width: 0;
height: 0;
border: 10px solid transparent;
border-bottom-color: #fff
}
.s-type-list label
{
display: block;
font-size: 15px;
text-align: center;
font-weight: normal;
margin-bottom: 0;
padding: 2px 0;
cursor: pointer;
transition: .3s
}
.s-type-list label:hover
{
background: rgba(136,136,136,.1)
}
.s-type-list .tile-lg
{
color: #fff;
width: 3pc;
height: 3pc;
font-size: 1.25rem;
line-height: 3rem;
border-radius: .3rem;
display: block;
margin: auto
}
.s-type:hover .s-type-list
{
display: block
}
.type-text
{
position: absolute;
left: 0;
width: 75px;
padding-left: 9pt;
font-size: 1pc;
line-height: 31px
}
.search-type
{
white-space: nowrap;
margin: 0
}
.search-type label
{
margin: 0
}
.search-type img
{
width: 14px;
height: 14px;
margin: 0 5px 0 8px;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
.search-type li
{
margin-bottom: 10px;
display: inline-block;
background: #ffffffAD !important;
background: rgba(255,255,255,70%);
border-radius: 10px
}
.search-type li label
{
display: inline-block;
padding: 0 11px;
font-size: 14px;
border-radius: 3px 3px 0 0;
cursor: pointer
}
.search-type input:checked+label,.search-type input:hover+label
{
background-color: #fff;
height: 50px;
border-radius: 10px
}
#word
{
backdrop-filter: blur(10px);
margin-top: 5px;
position: absolute;
list-style: none;
width: 100%;
background: rgba(259,259,259,0.6);
border-radius: 15px;
z-index: 20000;
padding: 15px 0px;
box-shadow: 0 0 5px #000
}
#word li
{
height: 35px;
padding: 0 5px;
text-indent: 30px;
background-size: 20px;
line-height: 35px;
cursor: pointer;
font-size: 16px;
border-radius: 5px
}
#word li:hover
{
background-color: #fffc
}
.set-check
{
position: absolute;
}
.set-check label
{
margin-left: 3px
}
.set-check input,.set-check label
{
opacity: 0;
transition: all .3s ease
}
.search-type li
{
height: 50px;
line-height: 50px;
list-style: none;
display: inline-block;
border-radius: 10px
}
.mylist
{
list-style: none;
position: relative;
z-index: 1000;
}
.mylist li.lylme-3
{
width: 100px;
transition: 0.3s all linear;
font-size: 14px;
overflow: hidden;
/* padding: 10px; */
box-shadow: 2px 2px 10px 0px rgb(0 0 0 / 40%);
backdrop-filter: saturate(100%) blur(30px);
margin: 10px;
/* display: flex; */
flex-direction: row;
border-radius: 15px;
}
.mylist li.lylme-3 svg
{
border-radius: 100%;
/* background-color: royalblue; */
/* margin-left: 10px; */
/* margin-right: 10px; */
display: block;
width: 45px;
height: 45px;
/* padding: 8px; */
/* background: #fff; */
/* border: 1px solid #eee; */
/* border-radius: 10px; */
margin: 25px auto;
}
.mylist li.lylme-3:hover
{
backdrop-filter: blur(0px);
transform: translateY(5px);
}
.mylist li.lylme-3 span
{
text-shadow: 0px 0px 3px rgb(0 0 0 / 70%);
margin-bottom: 10px;
width: 100%;
height: 26px;
line-height: 26px;
text-align: center;
font-size: 15px;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden
}
.mylist li a
{
color: #fff;
display: block
}
.mylist li.title
{
width: 100%;
min-width: auto;
/* margin: 0; */
height: 35px;
/* font-size: 16px; */
line-height: 33px;
/* padding: 0 20px 0 10px; */
/* border-bottom: 1px solid #eee; */
margin-bottom: 10px;
margin-top: 20px;
font-size: 17px;
color: white;
font-weight: 600;
}
.bottom-cover
{
width: 100%;
height: 50%;
position: absolute;
bottom: -1px;
z-index: 10
}
@media screen and (min-width:1200px)
{
.mylist li.lylme-3
{
min-width: 132px
}
}
@media screen and (min-width:992px) and (max-width:1200px)
{
.mylist li.lylme-3
{
min-width: 110px
}
}
@media screen and (max-width:992px)
{
#he-plugin-simple
{
display: none !important
}
#search-text
{
width: 60%;
}
.mylist li.lylme-3
{
width: 65px;
}
.search-group
{
padding-left: 0px
}
div#navbarsExample05
{
background: rgba(0,0,0,0.8);
padding: 10px 30px;
border-radius: 20px
}
}
@media screen and (max-width:767px)
{
#search-text
{
width: 60%;
}
.s-type-list label
{
padding: 5px 0
}
.search-list
{
height: 30px;
overflow-y: hidden;
white-space: nowrap
}
.search-group
{
padding-left: 0px
}
.mylist
{
border-radius: 8px
}
/*.mylist li.lylme-3{margin:5px 0 5px}*/
.mylist li.lylme-3 svg
{
width: 40px;
height: 40px;
}
.mylist li.lylme-3 span
{
font-size: 12px
}
}
.navbar-toggler svg
{
width: 24px;
height: 24px
}
.navbar-toggler .bi-list-nested
{
display: none
}
.navbar-toggler.collapsed .bi-list-nested
{
display: block
}
.navbar-toggler.collapsed .bi-x
{
display: none
}
.navbar-toggler .bi-x
{
display: block
}
#he-plugin-simple
{
z-index: 1000
}
::-webkit-scrollbar
{
width: 8px;
height: 8px;
border-radius: 4px
}
::-webkit-scrollbar-track
{
background: #eee;
border-radius: 0px
}
::-webkit-scrollbar-thumb
{
background: #ddd;
border-radius: 0px
}
::-webkit-scrollbar-thumb:hover
{
background: #ccc
}
::-webkit-scrollbar-corner
{
background: #ddd
}

20
template/lylme/footer.php Normal file
View File

@ -0,0 +1,20 @@
<?php if(basename($_SERVER['PHP_SELF']) == basename(__FILE__)) header("Location:/"); ?>
<script src="<?php echo $cdnpublic ?>/template/lylme/js/script.js"></script>
<script src="<?php echo $cdnpublic ?>/assets/js/svg.js"></script>
<div style="display:none;" class="back-to" id="toolBackTop">
<a title="返回顶部" onclick="window.scrollTo(0,0);return false;" href="#top" class="back-top"></a>
</div>
<div class="mt-5 mb-3 footer text-muted text-center">
<!--备案信息-->
<?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>'; } ?>
<!--版权信息-->
<p> <?php echo $conf['copyright']; ?></p>
<!--网站统计-->
<?php if($conf['wztj'] != NULL){echo $conf["wztj"];}?>
</div>
<script>
</script>
</body>
</html>

144
template/lylme/index.php Normal file
View File

@ -0,0 +1,144 @@
<!DOCTYPE html>
<html lang="zh-CN" element::-webkit-scrollbar {display:none}>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $conf['title']?></title>
<meta name="keywords" content="<?php echo $conf['keywords']?>">
<meta name="description" content="<?php echo $conf['description']?>">
<meta name="author" content="LyLme">
<link rel="icon" href="<?php echo $conf['logo']?>" type="image/x-icon">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="full-screen" content="yes">
<meta name="browsermode" content="application">
<meta name="x5-fullscreen" content="true">
<meta name="x5-page-mode" content="app">
<meta name="lsvn" content="Mi4w">
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-2-M/jquery/3.5.1/jquery.min.js" type="application/javascript"></script>
<link href="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap/4.5.3/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap/4.5.3/js/bootstrap.min.js" type="application/javascript"></script>
<link rel="stylesheet" href="<?php echo $cdnpublic ?>/template/lylme/css/style.css" type="text/css">
<link rel="stylesheet" href="<?php echo $cdnpublic ?>/assets/css/fontawesome-free5.13.0.css" type="text/css">
</head>
<body onload="FocusOnInput()" style="background-image: url(<?php echo background()?>);background-size: cover;">
<nav class="navbar navbar-expand-lg navbar-light fixed-top" style="position: absolute; z-index: 10000;">
<!--<a class="navbar-brand" href="/"><img src="./assets/img/logo.png" height="25" title="六零起始页"></a>-->
<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">
<svg class="icon" width="200" height="200"><use xlink:href="#icon-menus"></use></svg>
<span><svg class="bi bi-x" fill="currentColor" id="x"><use xlink:href="#icon-closes"></use></svg><span>
</button>
<div class="collapse navbar-collapse" id="navbarsExample05">
<ul class="navbar-nav mr-auto">
<?php
$tagslists = $DB->query("SELECT * FROM `lylme_tags`");
while ($taglists = $DB->fetch($tagslists)) {
echo '<li class="nav-item"><a class="nav-link" href="' . $taglists["tag_link"] . '"';
if ($taglists["tag_target"] == 1) echo ' target="_blant"';
echo '>' . $taglists["tag_name"] . '</a></li>
';
}
?>
<?php if ($conf['tq'] != 'false') {
echo '<div id="he-plugin-simple"></div>
<script src="https://widget.qweather.net/simple/static/js/he-simple-common.js?v=2.0"></script>';}?>
</ul>
</div>
</nav>
<!--topbar结束-->
<div class="container" style="margin-top:10vh; position: relative; z-index: 100;">
<div id="main">
<div id="show_time"></div>
<div id="show_date"></div>
</div>
<?php
if ($conf['yan'] != 'false') {
$filename = './assets/data/data.dat'; //随机一言文件路径
if (file_exists($filename)) {
$data = explode(PHP_EOL, file_get_contents($filename));
$result = str_replace(array(
"\r",
"\n",
"\r\n"
) , '', $data[array_rand($data) ]);
echo '<p class="content">' . $result;
}
}
?>
</p>
<!--搜索开始-->
<div id="search" class="s-search">
<div id="search-list" class="hide-type-list">
<div class="search-group group-a s-current">
<div class="search-box">
<div id="search-lylme">
<form action="https://www.baidu.com/s?wd=" method="get" target="_blank"
id="super-search-fm">
<div id="checke-so" onclick="lylme()">
<svg class="lylme" aria-hidden="true"><use xlink:href="#icon-icon_baidulogo"></use></svg>
<svg class="sw" id="lylme-up" style="display:inline" aria-hidden="true"><use xlink:href="#icon-up"></use></svg>
<svg class="sw" id="lylme-down" style="display:none" aria-hidden="true"><use xlink:href="#icon-down"></use></svg>
</div>
<input type="text" id="search-text" placeholder="百度一下,你就知道" style="outline:0"
autocomplete="off">
<button class="submit" id="search-submit" type="submit">
<svg style="width: 22px; height: 22px; margin: 0 20px 0 20px; color: #fff;"
class="icon" aria-hidden="true">
<use xlink:href="#icon-sousuo">
</use>
</svg>
<span>
</button>
</div>
</form>
</div>
</div>
</div>
<ul class="search-type" id="chso">
<?php
$soulists = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC");
while ($soulist = $DB->fetch($soulists)) {
if($soulist["sou_st"]==1){
echo ' <li>
<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"];}
echo '"data-placeholder="'.$soulist["sou_hint"].'">
<label for="type-'.$soulist["sou_alias"].'" style="font-weight:600">
'.$soulist["sou_icon"].'
<span style="color:'.$soulist["sou_color"].'">
'.$soulist["sou_name"].'
</span>
</label>
</li>
';
}
}
?>
</ul>
<div class="set-check hidden-xs">
<input type="checkbox" id="set-search-blank" class="bubble-3" autocomplete="off">
</div>
<ul id="word" style="display: none;">
</ul>
</div>
<?php
include "list.php";
include "footer.php";
?>

179
template/lylme/js/script.js Normal file
View File

@ -0,0 +1,179 @@
//天气插件
WIDGET={"CONFIG":{"modules":"12043","background":"5","tmpColor":"FFFFFF","tmpSize":"16","cityColor":"FFFFFF","citySize":"18","aqiColor":"FFFFFF","aqiSize":"16","weatherIconSize":"24","alertIconSize":"18","padding":"0px 0px 0px 0px","shadow":"0","language":"auto","fixed":"false","vertical":"center","horizontal":"center","right":"0","top":"0","key":"9d714f8dd6b94c7696f9cea8dc3ed1c5"}}
//输入框获取焦点
window.onload= function () {
var text=document.getElementById('search-text');
text.focus();
}
function lylme(){
var up = document.getElementById('lylme-up');
var down = document.getElementById('lylme-down');
var lylme = document.getElementById('chso');
var upsw = up.style.display;
var downsw = down.style.display;
if(upsw=='none'){
up.style.display='inline';
down.style.display='none';
lylme.style.display='none';
}
else{
up.style.display='none';
down.style.display='inline';
lylme.style.display='contents';
}
}
//关键词sug
$(function() {
//当键盘键被松开时发送Ajax获取数据
$('#search-text').keyup(function() {
var keywords = $(this).val();
if (keywords == '') { $('#word').hide(); return };
$.ajax({
url: 'https://suggestion.baidu.com/su?wd=' + keywords,
dataType: 'jsonp',
jsonp: 'cb', //回调函数的参数名(键值)key
// jsonpCallback: 'fun', //回调函数名(值) value
beforeSend: function() {
// $('#word').append('<li>正在加载。。。</li>');
},
success: function(data) {
$('#word').empty().show();
if (data.s == '') {
// $('#word').append('<div class="error">暂无 ' + keywords + ' 相关索引</div>');
$('#word').empty();
$('#word').hide();
}
$.each(data.s, function() {
$('#word').append('<li>' + this + '</li>');
})
},
error: function() {
$('#word').empty().show();
//$('#word').append('<div class="click_work">Fail "' + keywords + '"</div>');
$('#word').hide();
}
})
})
//点击搜索数据复制给搜索框
$(document).on('click', '#word li', function() {
var word = $(this).text();
$('#search-text').val(word);
$('#word').empty();
$('#word').hide();
//$("form").submit();
$('.submit').trigger('click');//触发搜索事件
})
$(document).on('click', '.container,.banner-video,nav', function() {
$('#word').empty();
$('#word').hide();
})
})
//显示日期和时间
function show() {
var date = new Date();
var y = date.getFullYear(); //获取年份
var m =date.getMonth()+1; //获取月份 返回0-11
var d = date.getDate(); // 获取日
var w = date.getDay(); //获取星期几 返回0-6 (0=星期天)
var ww = ' 星期'+'日一二三四五六'.charAt(new Date().getDay()) ;//星期几
var format = [
("0" + date.getHours()).substr(-2), ("0" + date.getMinutes()).substr(-2)
].join(":");
document.getElementById("show_date").innerHTML = y+"年"+m+"月"+d+"日 "+ww;
document.getElementById("show_time").innerHTML = format;
return show;
}
setInterval(show(), 500);
!
function() {
function g() {
h(), i(), j(), k()
}
function h() {
d.checked = s()
}
function i() {
var a = document.querySelector('input[name="type"][value="' + p() + '"]');
a && (a.checked = !0, l(a))
}
function j() {
v(u())
}
function k() {
w(t())
}
function l(a) {
for (var b = 0; b < e.length; b++) e[b].classList.remove("s-current");
a.parentNode.parentNode.parentNode.classList.add("s-current")
}
function m(a, b) {
window.localStorage.setItem("superSearch" + a, b)
}
function n(a) {
return window.localStorage.getItem("superSearch" + a)
}
function o(a) {
f = a.target, v(u()), w(a.target.value), m("type", a.target.value), c.focus(), l(a.target)
}
function p() {
var b = n("type");
return b || a[0].value
}
function q(a) {
m("newWindow", a.target.checked ? 1 : -1), x(a.target.checked)
}
function r(a) {
return a.preventDefault(), "" == c.value ? (c.focus(), !1) : (w(t() + c.value), x(s()), s() ? window.open(b.action, +new Date) : location.href = b.action, void 0)
}
function s() {
var a = n("newWindow");
return a ? 1 == a : !0
}
function t() {
return document.querySelector('input[name="type"]:checked').value
}
function u() {
return document.querySelector('input[name="type"]:checked').getAttribute("data-placeholder")
}
function v(a) {
c.setAttribute("placeholder", a);
document.getElementById('chso').style.display='none';
document.getElementById('lylme-up').style.display='inline';
document.getElementById('lylme-down').style.display='none';
}
function w(a) {
b.action = a
}
function x(a) {
a ? b.target = "_blank" : b.removeAttribute("target")
}
var y, a = document.querySelectorAll('input[name="type"]'),
b = document.querySelector("#super-search-fm"),
c = document.querySelector("#search-text"),
c = document.querySelector("#search-text"),
d = document.querySelector("#set-search-blank"),
e = document.querySelectorAll(".search-group"),
f = a[0];
for (g(), y = 0; y < a.length; y++) a[y].addEventListener("change", o);
d.addEventListener("change", q), b.addEventListener("submit", r)
}();
//返回顶部
(function(a){a.fn.scrollToTop=function(c){var d={speed:800};c&&a.extend(d,{speed:c});return this.each(function(){var b=a(this);a(window).scroll(function(){100<a(this).scrollTop()?b.fadeIn():b.fadeOut()});b.click(function(b){b.preventDefault();a("body, html").animate({scrollTop:0},d.speed)})})}})(jQuery);$(function(){ahtml='<a href="javascript:void(0)" id="toTop" style="display:none;position:fixed;bottom:66px;right:10px;width:45px;height:45px;border-radius:50%;overflow:hidden;background-image:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAWBAMAAADZWBo2AAAALVBMVEUAAAB5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl4rtNiAAAADnRSTlMARHe7Zu7dMxGIIqqZzHSj3DwAAAB/SURBVBjTYwADPgYk8OABgs2HLPUAjBA6+JAk4FJ8UJLqYLKxsQNTXhIDs/GWBoZCPcEFeop6CnyKvhMYGOQYGJIYmBL4BBgfgDjsrxi4nvMJsCSAOCChh3yHjjqAZV4wcDznO6TFANYTwsASwCfAAOFMFRCdAOd0v3vdAOIAANnHHKk0/kXuAAAAAElFTkSuQmCC\');background-repeat:no-repeat;background-position:center;z-index:999;cursor:pointer;border:1px solid #d8d8d8;box-sizing:border-box;opacity:0.9;"></a>';$("body").append(ahtml);$("#toTop").scrollToTop(300);});

52
template/lylme/list.php Normal file
View File

@ -0,0 +1,52 @@
<?php
// +----------------------------------------------------------+
// | LyLme Spage |
// +----------------------------------------------------------+
// | Copyright (c) 2022 LyLme |
// +----------------------------------------------------------+
// | File: list.php |
// +----------------------------------------------------------+
// | Authors: LyLme <admin@lylme.com> |
// | date: 2022-3-12 |
// +----------------------------------------------------------+
$links = $DB->query("SELECT * FROM `lylme_links`"); // 获取网站
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC"); // 获取分类
$i = 0;
while ($group = $DB->fetch($groups)) { //循环所有分组
$sql = "SELECT * FROM `lylme_links` WHERE `group_id` = " . $group['group_id'];
$group_links = $DB->query($sql);
$link_num = $DB->num_rows($group_links); // 获取返回字段条目数量
echo '<ul class="mylist row"><li class="title">' . $group["group_icon"] . '<sapn>' . $group["group_name"] . '</sapn></li>'; //输出分组图标和标题
if ($link_num == 0) {
echo '</ul>' . "\n";
$i = 0;
continue;
}
while ($link = $DB->fetch($group_links)) { // 循环每个链接
// 返回指定分组下的所有字段
if ($link_num > $i) {
$i = $i + 1;
echo "\n" . '<li class="lylme-3"><a rel="nofollow" href="' . $link["url"] . '" target="_blank">';
if ($link["icon"] == '') {
echo '<img src="/assets/img/default-icon.png" alt="默认' . $link["name"] . '" />';
} else if (!preg_match("/^<svg*/", $link["icon"])) {
echo '<img src="' . $link["icon"] . '" alt="' . $link["name"] . '" />';
} else {
echo $link["icon"];
}
echo '<span>' . $link["name"] . '</span></a></li>';
//输出图标和链接
}
if ($link_num == $i) {
//判断当前分组链接循环完毕
echo '</ul>' . "\n"; //输出分类结束标签
$i = 0;
break; //重置$i为0跳出当前循环
}
}
}
$DB->close();
?>