增加模板 baisu
This commit is contained in:
parent
3e9e3cac72
commit
7523574fe5
|
@ -1,37 +1 @@
|
|||
## 模板说明
|
||||
|
||||
#### default
|
||||
|
||||
**主题说明:** 基于`5iux.github.io`开发
|
||||
|
||||
**二开说明:**
|
||||
|
||||
- 增加对六零导航页的适配
|
||||
- 修改部分css
|
||||
- 增加输入框焦点
|
||||
- 增加返回顶部
|
||||
- 优化部分内容
|
||||
|
||||
**演示截图:**
|
||||
|
||||

|
||||
|
||||
------
|
||||
|
||||
#### 5iux
|
||||
|
||||
**作者:** D.Young
|
||||
|
||||
**项目地址:** https://github.com/5iux/sou
|
||||
|
||||
**二开说明:**
|
||||
|
||||
- 增加对六零导航页的适配
|
||||
- 支持记住上次使用的搜索引擎
|
||||
- 优化部分内容
|
||||
|
||||

|
||||
|
||||
#### lylme
|
||||
|
||||
**作者:** 六零
|
||||
**模板目录**
|
|
@ -0,0 +1,35 @@
|
|||
# 六零导航页baisu主题
|
||||
六零导航页(LyLme Spage)`baisu`主题,基于[baisuTwo](https://gitee.com/LyLme/baisu-two)开发
|
||||
|
||||
## 注意
|
||||
|
||||
**该项目为主题模板文件,不支持直接使用,请前往[LyLme_Spage](https://gitee.com/LyLme/lylme_spage)载安装完整项目源码搭建**
|
||||
|
||||
## 截图
|
||||
|
||||
**baisu主题PC端截图**
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
**baisu主题手机端截图**
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## 天气插件
|
||||
|
||||
天气插件采用的是【和风天气】的标准版天气插件,可无限制免费试用,需要先注册和风天气账号,
|
||||
[和风天气账号注册](https://id.qweather.com/#/register);
|
||||
[和风天气创建插件页面](https://widget.qweather.com/create-standard)
|
||||
插件 选择【横版】、【款:240px】、【高:180px】;否则会出现样式偏移的问题。其他条件任选。
|
||||
生成代码后 除第一行`<div id="he-plugin-standard"></div>`外,其他代码复制到主题文件夹下`index.php`底部对应位置即可。
|
||||
|
||||
## 相关链接
|
||||
|
||||
* [OneNav官网](https://nav.rss.ink/)
|
||||
* [onenav作者](https://www.xiaoz.me/)
|
||||
* [baisuTwo](https://gitee.com/LyLme/baisu-two)
|
||||
* [LyLme_Spage](https://gitee.com/LyLme/lylme_spage)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,222 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
||||
<meta http-equiv="Cache-Control" content="no-transform">
|
||||
<meta name="applicable-device" content="pc,mobile">
|
||||
<meta name="MobileOptimized" content="width">
|
||||
<meta name="HandheldFriendly" content="true">
|
||||
<meta name="author" content="BaiSu" />
|
||||
<title><?php echo $conf['title']?></title>
|
||||
<meta name="keywords" content="<?php echo $conf['keywords']?>" />
|
||||
<meta name="description" content="<?php echo $conf['description']?>" />
|
||||
<link rel="icon" href="<?php echo $conf['logo']?>" type="image/x-icon">
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $templatepath;?>/css/style.css" />
|
||||
<link rel="stylesheet" href="<?php echo $cdnpublic ?>/assets/css/fontawesome-free5.13.0.css">
|
||||
<meta name="lsvn" content="<?php echo base64_encode($conf['version'])?>">
|
||||
</head>
|
||||
<body>
|
||||
<!--手机顶部 S-->
|
||||
<div class="m-header">
|
||||
<div class="logo">
|
||||
<a href="/"><?php echo explode("-", $conf['title'])[0];
|
||||
?></a>
|
||||
</div>
|
||||
<div class="navbar">
|
||||
<i class="iconfont icon-caidan"></i>
|
||||
</div>
|
||||
<div class="m-navlist-w">
|
||||
<div class="m-navlist">
|
||||
<?php
|
||||
//输出导航菜单
|
||||
$tagslists = $DB->query("SELECT * FROM `lylme_tags`");
|
||||
while ($taglists = $DB->fetch($tagslists)) {
|
||||
echo '<a href="' . $taglists["tag_link"] . '" class="list catlist"';
|
||||
if ($taglists["tag_target"] == 1) echo ' target="_blant"';
|
||||
echo '><b>' . $taglists["tag_name"] . '</b></a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--手机顶部 E-->
|
||||
<!--左侧分类栏 S-->
|
||||
<div class="index-nav">
|
||||
<div class="logo">
|
||||
<a href="/"><?php echo explode("-", $conf['title'])[0];
|
||||
?></a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="type-list">
|
||||
<?php
|
||||
$tagslists = $DB->query("SELECT * FROM `lylme_tags`");
|
||||
while ($taglists = $DB->fetch($tagslists)) {
|
||||
echo '
|
||||
<div class="list">
|
||||
<a href="' . $taglists["tag_link"] . '" class="list catlist"';
|
||||
if ($taglists["tag_target"] == 1) echo ' target="_blant"';
|
||||
echo '>' . $taglists["tag_name"] . '</a> </div> ';
|
||||
}
|
||||
?>
|
||||
<hr><p style="margin: 10px;color: #000;font-weight: bold;font-size:18px">分组</p>
|
||||
<?php
|
||||
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC");
|
||||
while ($group = $DB->fetch($groups)) {
|
||||
echo '<div class="list">
|
||||
<a href="#category-' . $group["group_id"] . '" class="list catlist">
|
||||
' . $group["group_icon"] . $group["group_name"] . '</a>
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!--左侧分类栏 E-->
|
||||
<!--中间主体 S-->
|
||||
<div class="index-main">
|
||||
<!--搜索 S-->
|
||||
<div class="search-main-w">
|
||||
<div class="date-main" style="background-image: url('<?php echo 'https://cdn.lylme.com/api/acg/';?>')">
|
||||
<time class="times" id="nowTime">00:00:00</time>
|
||||
<span class="dates" id="nowYmd">2022年01月01日</span>
|
||||
<div class="list">
|
||||
<span class="lunars" id="nowLunar">辛丑年十一月廿九
|
||||
</span>
|
||||
<span class="weeks" id="nowWeek">星期六</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="weather-main" id="he-plugin-standard"></div>
|
||||
</div>
|
||||
|
||||
<div class="search-main">
|
||||
<div class="search-input">
|
||||
<input type="text" class="kw" name="search" id="search" value="" class="kw" placeholder="请输入搜索内容" autocomplete="off" />
|
||||
<!--<button class="search-bendi"><i class="iconfont icon-sousuo"></i></button>-->
|
||||
</div>
|
||||
<div class="search-btnlist">
|
||||
<?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) {
|
||||
if(!$fso) {
|
||||
echo '<button class="search-btn" data-url="';
|
||||
if (checkmobile()&& $soulist["sou_waplink"] != NULL) {
|
||||
echo $soulist["sou_waplink"];
|
||||
} else {
|
||||
echo $soulist["sou_link"];
|
||||
}
|
||||
echo '">'. $soulist["sou_icon"] . $soulist["sou_name"] . '</button>
|
||||
<button class="search-change"><i class="iconfont icon-xiangxia"></i></button>
|
||||
<div class="search-lists hide"> ';
|
||||
$fso = true;
|
||||
}
|
||||
echo ' <div class="list" data-url="';
|
||||
if (checkmobile()&& $soulist["sou_waplink"] != NULL) {
|
||||
echo $soulist["sou_waplink"];
|
||||
} else {
|
||||
echo $soulist["sou_link"];
|
||||
}
|
||||
echo '">'. $soulist["sou_icon"] . $soulist["sou_name"] . '
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="list kongs"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul id="word" style="display:none">
|
||||
</ul>
|
||||
</div>
|
||||
<div class="search">
|
||||
<div class="list">
|
||||
<input type="text" name="search" id="search" value="" class="kw" placeholder="输入关键词进行搜索,回车键百度搜索" autocomplete="off" />
|
||||
<button><i class="iconfont icon-sousuo"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<!--搜索 E-->
|
||||
|
||||
|
||||
<div class="site-main">
|
||||
<?php
|
||||
if ($conf['yan'] != 'false') {
|
||||
$filename = ROOT.'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>';
|
||||
}
|
||||
}
|
||||
include'list.php';?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!--中间主体 E-->
|
||||
<!--底部版权 S-->
|
||||
<footer>
|
||||
<!--网站统计-->
|
||||
<?php if(!empty($conf['wztj'])) {
|
||||
echo '<p>'.$conf["wztj"].'</p>';
|
||||
}
|
||||
?>
|
||||
<!--备案信息-->
|
||||
<?php if(!empty($conf['icp'])) {
|
||||
echo '<p><img src="./assets/img/icp.png" width="16px" height="16px" /><a href="http://beian.miit.gov.cn/" rel="nofollow" class="icp nav-link" target="_blank" _mstmutation="1" _istranslated="1">'.$conf['icp'].'</a></p>';
|
||||
}
|
||||
?>
|
||||
<p>Theme By <a href="https://gitee.com/baisucode/baisu-two" target="_blank">BaiSu</a>. <?php echo $conf['copyright']?></p>
|
||||
</footer>
|
||||
<!--底部版权 E-->
|
||||
<!--返回顶部 S-->
|
||||
<div class="tool-list">
|
||||
<div class="scroll_top list">
|
||||
<i class="iconfont icon-top"></i>
|
||||
</div>
|
||||
</div>
|
||||
<!--返回顶部 E-->
|
||||
<?php if ($conf['tq']=='true'){?>
|
||||
<!--天气代码替换处 S-->
|
||||
<script type="text/javascript">
|
||||
WIDGET = {
|
||||
"CONFIG": {
|
||||
"layout": "1",
|
||||
"width": "240",
|
||||
"height": "180",
|
||||
"background": "1",
|
||||
"dataColor": "FFFFFF",
|
||||
"borderRadius": "6",
|
||||
"modules": "10",
|
||||
"key": "7423b182d5cb48239f19df9e25cdf320"
|
||||
//和风天气秘钥申请地址:https://widget.qweather.com/create-standard/
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script src="https://widget.qweather.net/standard/static/js/he-standard-common.js?v=2.0"></script>
|
||||
<!--天气代码替换处 E-->
|
||||
<?php }else{echo '<style>.search-main-w {display: none;} @media only screen and (max-width: 1200px){.search-main {padding-top:70px !important;}}</style>';}?>
|
||||
<!--iconfont-->
|
||||
<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>
|
||||
<!--JS-->
|
||||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-2-M/jquery/3.5.1/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.5.1/layer.js" type="application/javascript"></script>
|
||||
<script src="<?php echo $templatepath;?>/js/holmes.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="<?php echo $templatepath;?>/js/lunar.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="<?php echo $templatepath;?>/js/common.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="<?php echo $cdnpublic ?>/assets/js/svg.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<!--二开说明:-->
|
||||
<!--1. 当前主题使用基于baisuTwo主题开发,作者:baisu-->
|
||||
<!--2. 原项目地址https://gitee.com/baisucode/baisu-two-->
|
||||
<!--3. 二开作者:六零
|
||||
<!--4. 修改了适配LyLme Spage,修改了部分CSS,删除不适用与本项目的代码-->
|
|
@ -0,0 +1,224 @@
|
|||
var bodyH = $('.index-main').height();
|
||||
var winH = $(window).height() - 100;
|
||||
if(bodyH > winH) {
|
||||
$('footer').addClass('show');
|
||||
};
|
||||
|
||||
// layui.use(['dropdown', 'layer', 'form'], function() {
|
||||
// var dropdown = layui.dropdown,
|
||||
// layer = layui.layer,
|
||||
// form = layui.form,
|
||||
// $ = layui.jquery;
|
||||
// })
|
||||
//搜索引擎切换
|
||||
function searchChange() {
|
||||
$(".search-change").click(function() {
|
||||
$('.search-lists').toggleClass('hide');
|
||||
// console.log('1')
|
||||
});
|
||||
$(".search-lists .list").click(function() {
|
||||
var souurl = $(this).data('url');
|
||||
var text = $(this).html();
|
||||
$('.search-btn').html(text);
|
||||
$('.search-btn').attr('data-url', souurl);
|
||||
$('.search-lists').addClass('hide');
|
||||
console.log(souurl);
|
||||
|
||||
});
|
||||
$(".search-btn").click(function() {
|
||||
var url = $(this).attr('data-url');
|
||||
var kw = $('#search').val();
|
||||
if(kw !== "") {
|
||||
window.open(url + kw);
|
||||
} else {
|
||||
layer.msg('未输入搜索框关键词!', {
|
||||
time: 1000,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
searchChange();
|
||||
//回车键、本地搜索
|
||||
function keyClick() {
|
||||
$('body').keyup(function(e) {
|
||||
if(e.keyCode === 13) {
|
||||
var isFocus = $("#search").is(":focus");
|
||||
if(true == isFocus) {
|
||||
// console.log(isFocus);
|
||||
var url = $('.search-btn').attr('data-url');
|
||||
var kw = $('#search').val();
|
||||
if(kw !== "") {
|
||||
window.open(url + kw);
|
||||
} else {
|
||||
layer.msg('未输入搜索框关键词!', {
|
||||
time: 1000,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#search").focus(function(data, status) {
|
||||
$('.search-lists').addClass('hide');
|
||||
});
|
||||
$("#search").blur(function(data, status) {
|
||||
if($("#search").val() == '') {
|
||||
$(".site-name").removeClass("hidden");
|
||||
};
|
||||
});
|
||||
var h = holmes({
|
||||
input: '#search',
|
||||
find: '.urllist',
|
||||
placeholder: '<div class="empty">未搜索到匹配结果!</div>',
|
||||
mark: false,
|
||||
hiddenAttr: true,
|
||||
class: {
|
||||
visible: 'visible',
|
||||
hidden: 'hidden'
|
||||
},
|
||||
onFound(el) {
|
||||
$(".site-name").addClass("hidden");
|
||||
},
|
||||
onInput(el) {
|
||||
$(".site-name").addClass("hidden");
|
||||
},
|
||||
onVisible(el) {
|
||||
$(".site-name").removeClass("hidden");
|
||||
},
|
||||
onEmpty(el) {
|
||||
$(".site-name").removeClass("hidden");
|
||||
},
|
||||
});
|
||||
|
||||
}
|
||||
keyClick();
|
||||
|
||||
//锚点、返回顶部
|
||||
$("a.catlist").click(function() {
|
||||
$("html, body").animate({
|
||||
scrollTop: $($(this).attr("href")).offset().top - 5 + "px"
|
||||
}, 500);
|
||||
return false;
|
||||
});
|
||||
$('.scroll_top').click(function() {
|
||||
$('html,body').animate({
|
||||
scrollTop: '0px'
|
||||
}, 500);
|
||||
});
|
||||
$(window).scroll(function() {
|
||||
if($(window).scrollTop() >= 100) {
|
||||
$(".scroll_top").fadeIn(1000);
|
||||
} else {
|
||||
$(".scroll_top").stop(true, true).fadeOut(1000);
|
||||
}
|
||||
});
|
||||
|
||||
//时间
|
||||
function getNow(Mytime) {
|
||||
return Mytime < 10 ? '0' + Mytime : Mytime;
|
||||
}
|
||||
|
||||
function CurrentTime() {
|
||||
var myDate = new Date();
|
||||
//获取当前小时数(0-23)
|
||||
var h = myDate.getHours();
|
||||
//获取当前分钟数(0-59)
|
||||
var m = myDate.getMinutes();
|
||||
//获取当前秒数(0-59)
|
||||
var s = myDate.getSeconds();
|
||||
var nowTime = getNow(h) + ':' + getNow(m) + ":" + getNow(s);
|
||||
$('#nowTime').text(nowTime);
|
||||
setTimeout("CurrentTime()", 1000); //设定定时器,循环运行
|
||||
}
|
||||
CurrentTime();
|
||||
|
||||
var myDate = new Date();
|
||||
//获取当前年份
|
||||
var year = myDate.getFullYear();
|
||||
//获取当前月份
|
||||
var month = myDate.getMonth() + 1;
|
||||
//获取当前日期
|
||||
var date = myDate.getDate();
|
||||
var nowDate = year + ' 年 ' + getNow(month) + " 月 " + getNow(date) + " 日";
|
||||
$('#nowYmd').text(nowDate);
|
||||
|
||||
$('.date-main').click(function() {
|
||||
window.open('https://wannianli.tianqi.com/');
|
||||
});
|
||||
//获取农历
|
||||
var lunarD = Lunar.fromDate(myDate);
|
||||
// console.log(lunarD);
|
||||
var lunarNowDate = lunarD.getYearInGanZhi() + '年' + lunarD.getMonthInChinese() + "月" + lunarD.getDayInChinese();
|
||||
$('#nowLunar').text(lunarNowDate);
|
||||
|
||||
//获取星期
|
||||
var nowWeek = lunarD.getWeekInChinese();
|
||||
$('#nowWeek').text('星期' + nowWeek);
|
||||
|
||||
//手机端
|
||||
$(".navbar").click(function() {
|
||||
$(".m-navlist-w").slideToggle();
|
||||
$(this).toggleClass("hover");
|
||||
});
|
||||
$(".m-navlist a.list").click(function() {
|
||||
$(".m-navlist-w").slideUp();
|
||||
});
|
||||
|
||||
|
||||
$(function() {
|
||||
//当键盘键被松开时发送Ajax获取数据
|
||||
$('#search').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').val(word);
|
||||
$('#word').empty();
|
||||
$('#word').hide();
|
||||
//$("form").submit();
|
||||
$('.search-btn').trigger('click');//触发搜索事件
|
||||
})
|
||||
$(document).on('click', '.container,.banner-video,nav', function() {
|
||||
$('#word').empty();
|
||||
$('#word').hide();
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
$(function () {
|
||||
|
||||
//点击空白处隐藏弹出层。
|
||||
$(document).click(function(event){
|
||||
var _con = $('#word'); // 设置目标区域
|
||||
if(!_con.is(event.target) && _con.has(event.target).length === 0){ // Mark 1
|
||||
//$('#word').slideUp('slow'); //滑动消失
|
||||
$('#word').hide(300); //淡出消失
|
||||
}
|
||||
});
|
||||
})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------+
|
||||
// | LyLme Spage BaiSu Theme |
|
||||
// +----------------------------------------------------------+
|
||||
// | Copyright (c) 2022 LyLme |
|
||||
// +----------------------------------------------------------+
|
||||
// | File: list.php |
|
||||
// +----------------------------------------------------------+
|
||||
// | Authors: LyLme <admin@lylme.com> |
|
||||
// | date: 2022-05-01 |
|
||||
// +----------------------------------------------------------+
|
||||
$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 '<div class="site-name" id="category-'.$group["group_id"] .'">' . $group["group_icon"] . $group["group_name"] . '</div>
|
||||
<div class="site-list">';
|
||||
//输出分组图标和标题
|
||||
if ($link_num == 0) {
|
||||
echo ' <div class="list kongs"></div>
|
||||
<div class="list kongs"></div>
|
||||
<div class="list kongs"></div>
|
||||
<div class="list kongs"></div>' . "</div>";
|
||||
$i = 0;
|
||||
continue;
|
||||
}
|
||||
while ($link = $DB->fetch($group_links)) {
|
||||
// 循环每个链接
|
||||
// 返回指定分组下的所有字段
|
||||
if ($link_num > $i) {
|
||||
$i = $i + 1;
|
||||
echo "\n" . '
|
||||
<div class="list urllist" id="id_' . $link["id"] . '" data-id="' . $link["id"] . '" data-url="' . $link["url"] . '">
|
||||
<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 '<p class="name">'. $link["name"] . '</p><p class="desc"></p></a></div>';
|
||||
}
|
||||
if ($link_num == $i) {
|
||||
//判断当前分组链接循环完毕
|
||||
echo ' <div class="list kongs"></div>
|
||||
<div class="list kongs"></div>
|
||||
<div class="list kongs"></div>
|
||||
<div class="list kongs"></div>' . "\n</div>";
|
||||
//输出分类结束标签
|
||||
$i = 0;
|
||||
break;
|
||||
//重置$i为0跳出当前循环
|
||||
}
|
||||
}
|
||||
}
|
||||
$DB->close();
|
||||
?>
|
|
@ -0,0 +1,32 @@
|
|||
# OneNav主题
|
||||
onenav导航的主题
|
||||

|
||||

|
||||
|
||||
## 天气插件
|
||||
天气插件采用的是【和风天气】的标准版天气插件,可无限制免费试用,需要先注册和风天气账号,
|
||||
[和风天气账号注册](https://id.qweather.com/#/register);
|
||||
[和风天气创建插件页面](https://widget.qweather.com/create-standard)
|
||||
插件 选择【横版】、【款:240px】、【高:180px】;否则会出现样式偏移的问题。其他条件任选。
|
||||
生成代码后 除第一行`<div id="he-plugin-standard"></div>`外,其他代码复制到主题文件夹下`index.php`底部对应位置即可。
|
||||
|
||||
|
||||
## 一键添加
|
||||

|
||||
|
||||
在浏览器标签栏添加新标签
|
||||
标签名称栏随意填写
|
||||
标签地址栏,填写一下地址代码
|
||||
|
||||
```
|
||||
javascript: var url = location.href;
|
||||
var title = document.title;
|
||||
void(open('http://www.你的域名.com/index.php?c=admin&page=add_quick_tpl&url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title), "_blank", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, left=200,top=200,width=400, height=460"));
|
||||
```
|
||||
注意域名要替换成你的域名,然后保存即可。
|
||||
|
||||
|
||||
## 相关链接
|
||||
|
||||
* [OneNav官网](https://nav.rss.ink/)
|
||||
* [onenav作者](https://www.xiaoz.me/)
|
Loading…
Reference in New Issue