Browse Source

20220422

pull/61/head
xiaoz 3 years ago
parent
commit
0d057a59d3
  1. 20
      templates/admin/add_category.php
  2. 7
      templates/admin/add_link.php
  3. 9
      templates/admin/add_quick_tpl.php
  4. 34
      templates/admin/edit_category.php
  5. 2
      templates/admin/footer.php
  6. 6
      templates/admin/index.php
  7. 2
      templates/admin/left.php
  8. 52
      templates/admin/setting/api.php
  9. 9
      templates/admin/setting/site.php
  10. 4
      templates/admin/static/add_quick_tpl.css
  11. 71
      templates/admin/static/embed.js
  12. 1
      templates/baisuTwo/css/style.css
  13. 24
      templates/baisuTwo/index.php
  14. 4
      templates/baisuTwo/info.json
  15. 57
      templates/default/index.php
  16. 4
      templates/default/info.json
  17. 5
      templates/default/static/embed.js
  18. 13
      templates/default/static/style.css

20
templates/admin/add_category.php

@ -11,8 +11,8 @@
</div> </div>
</div> </div>
<!-- 说明提示框END --> <!-- 说明提示框END -->
<div class="layui-col-lg12"> <div class="layui-col-lg6">
<form class="layui-form"> <form class="layui-form layui-form-pane">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">分类名称</label> <label class="layui-form-label">分类名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -27,6 +27,20 @@
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label">父级分类</label>
<div class="layui-input-block">
<select name="fid" lay-verify="">
<option value="0"></option>
<?php foreach ($categorys as $key => $category) {
?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">权重</label> <label class="layui-form-label">权重</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -49,11 +63,9 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="add_category">添加</button> <button class="layui-btn" lay-submit lay-filter="add_category">添加</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div> </div>
</div>
</form> </form>
</div> </div>

7
templates/admin/add_link.php

@ -5,16 +5,15 @@
<!-- 内容主体区域 --> <!-- 内容主体区域 -->
<div class="layui-row content-body"> <div class="layui-row content-body">
<div class="layui-col-lg12"> <div class="layui-col-lg12">
<form class="layui-form"> <form class="layui-form layui-form-pane">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">URL</label> <label class="layui-form-label">URL</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="url" id = "url" name="url" required lay-verify="required|url" placeholder="请输入有效链接" autocomplete="off" class="layui-input"> <input id = "url" name="url" required lay-verify="required" placeholder="请输入有效链接" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<!-- 添加备用链接 --> <!-- 添加备用链接 -->
<div class="layui-col-lg12"> <div class="layui-col-lg12">
<form class="layui-form">
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">备用URL</label> <label class="layui-form-label">备用URL</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -64,13 +63,11 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="add_link">添加</button> <button class="layui-btn" lay-submit lay-filter="add_link">添加</button>
<!-- <button class="layui-btn" lay-submit lay-filter="get_link_info">识别</button> --> <!-- <button class="layui-btn" lay-submit lay-filter="get_link_info">识别</button> -->
<a href="javascript:;" class="layui-btn" onclick="get_link_info()">识别</a> <a href="javascript:;" class="layui-btn" onclick="get_link_info()">识别</a>
<button type="reset" class="layui-btn layui-btn-primary">重置</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div> </div>
</div>
</form> </form>
</div> </div>

9
templates/admin/add_quick_tpl.php

@ -11,13 +11,12 @@
<meta name="HandheldFriendly" content="true"> <meta name="HandheldFriendly" content="true">
<title>快速添加</title> <title>快速添加</title>
<link rel="stylesheet" type="text/css" href="templates/admin/static/add_quick_tpl.css" /> <link rel="stylesheet" type="text/css" href="templates/admin/static/add_quick_tpl.css" />
<link rel="stylesheet" type="text/css" href="https://libs.xiaoz.top/layui/v2.5.4/css/layui.css" /> <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css" />
</head> </head>
<body> <body>
<div class="quick-main"> <div class="quick-main">
<div class="title"> <div class="title">
<i class="iconfont icon--_tianjia"></i>快速添加当前连接 <i class="iconfont icon--_tianjia"></i>快速添加链接到OneNav
</div> </div>
<form class="layui-form"> <form class="layui-form">
<div class="list"> <div class="list">
@ -44,11 +43,11 @@
</div> </div>
<div class="li"> <div class="li">
是否私有 是否私有
<input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value = "1"> <input type="checkbox" lay-skin="switch" lay-text="是|否" name="property" value = "1" checked>
</div> </div>
</div> </div>
<div class="list"> <div class="list">
<textarea name="description" id = "description" placeholder="请输入站点描述(选填)" ></textarea> <textarea name="description" id = "description" style = "height:64px;" placeholder="请输入站点描述(选填)" ></textarea>
</div> </div>
<div class="list-3"> <div class="list-3">
<button class="close">关闭</button> <button class="close">关闭</button>

34
templates/admin/edit_category.php

@ -11,8 +11,8 @@
</div> </div>
</div> </div>
<!-- 说明提示框END --> <!-- 说明提示框END -->
<div class="layui-col-lg12"> <div class="layui-col-lg6">
<form class="layui-form"> <form class="layui-form layui-form-pane">
<div class="layui-form-item" style = "display:none;"> <div class="layui-form-item" style = "display:none;">
<label class="layui-form-label">分类ID</label> <label class="layui-form-label">分类ID</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -22,21 +22,39 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">分类名称</label> <label class="layui-form-label">分类名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="name" required lay-verify="required" value = '<?php echo $category['name']; ?>' placeholder="请输入分类名称" autocomplete="off" class="layui-input"> <input type="text" name="name" required lay-verify="required" value = '<?php echo $category_one['name']; ?>' placeholder="请输入分类名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">父级分类</label>
<div class="layui-input-block">
<select name="fid" lay-verify="">
<option value="<?php echo $category_one['fid']; ?>"><?php echo $category_one['fname']; ?></option>
<?php foreach ($categorys as $key => $category) {
if ( $category['id'] == $category_one['fid'] ) {
continue;
}
?>
<option value="<?php echo $category['id']; ?>"><?php echo $category['name']; ?></option>
<?php } ?>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">字体图标</label> <label class="layui-form-label">字体图标</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" name="font_icon" value = '<?php echo $category['font_icon']; ?>' placeholder="请输入字体图标,如:fa fa-bookmark-o" autocomplete="off" class="layui-input"> <input type="text" name="font_icon" value = '<?php echo $category_one['font_icon']; ?>' placeholder="请输入字体图标,如:fa fa-bookmark-o" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">权重</label> <label class="layui-form-label">权重</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="number" name="weight" min = "0" max = "999" value = "<?php echo $category['weight']; ?>" required lay-verify="required|number" placeholder="权重越高,排名越靠前,范围为0-999" autocomplete="off" class="layui-input"> <input type="number" name="weight" min = "0" max = "999" value = "<?php echo $category_one['weight']; ?>" required lay-verify="required|number" placeholder="权重越高,排名越靠前,范围为0-999" autocomplete="off" class="layui-input">
</div> </div>
</div> </div>
@ -44,22 +62,20 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">是否私有</label> <label class="layui-form-label">是否私有</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="checkbox" name="property" value = "1" lay-skin="switch" <?php echo $category['checked']; ?> lay-text="是|否"> <input type="checkbox" name="property" value = "1" lay-skin="switch" <?php echo $category_one['checked']; ?> lay-text="是|否">
</div> </div>
</div> </div>
<div class="layui-form-item layui-form-text"> <div class="layui-form-item layui-form-text">
<label class="layui-form-label">描述</label> <label class="layui-form-label">描述</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea name="description" placeholder="请输入内容" class="layui-textarea"><?php echo $category['description']; ?></textarea> <textarea name="description" placeholder="请输入内容" class="layui-textarea"><?php echo $category_one['description']; ?></textarea>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="edit_category">更新</button> <button class="layui-btn" lay-submit lay-filter="edit_category">更新</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button> <button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div> </div>
</div>
</form> </form>
</div> </div>

2
templates/admin/footer.php

@ -5,7 +5,7 @@
</div> </div>
<script src = 'static/js/jquery.min.js'></script> <script src = 'static/js/jquery.min.js'></script>
<script src = 'static/layui/layui.js'></script> <script src = 'static/layui/layui.js'></script>
<script src="static/js/md5.min.js"></script>
<script src="templates/admin/static/embed.js?v=<?php echo $version; ?>"></script> <script src="templates/admin/static/embed.js?v=<?php echo $version; ?>"></script>
</body> </body>
</html> </html>

6
templates/admin/index.php

@ -10,6 +10,9 @@
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">当前版本:<?php echo file_get_contents('version.txt'); ?></div> <div class = "admin-msg">当前版本:<?php echo file_get_contents('version.txt'); ?></div>
</div> </div>
<div class="layui-col-lg4">
<div class = "admin-msg">最新版本:<span><span id = "getting">获取中...</span><a href = "https://github.com/helloxz/onenav/releases" title = "下载最新版OneNav" target = "_blank" id="latest_version"></a></span></div>
</div>
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">QQ群1:147687134</div> <div class = "admin-msg">QQ群1:147687134</div>
</div> </div>
@ -34,6 +37,9 @@
<div class="layui-col-lg4"> <div class="layui-col-lg4">
<div class = "admin-msg">捐赠地址: <a href="https://dwz.ovh/donation" rel = "nofollow" target="_blank">https://dwz.ovh/donation</a></div> <div class = "admin-msg">捐赠地址: <a href="https://dwz.ovh/donation" rel = "nofollow" target="_blank">https://dwz.ovh/donation</a></div>
</div> </div>
<div class="layui-col-lg4">
<div class = "admin-msg">Chrome浏览器扩展: <a href="https://dwz.ovh/4kxn2" title = "适用于Chromium内核的浏览器扩展" rel = "nofollow" target="_blank">https://dwz.ovh/4kxn2</a></div>
</div>
<!-- 日志输出窗口 --> <!-- 日志输出窗口 -->
<div class="layui-col-lg12"> <div class="layui-col-lg12">

2
templates/admin/left.php

@ -23,7 +23,6 @@
</ul> </ul>
<!-- 系统设置 --> <!-- 系统设置 -->
</ul>
<ul class="layui-nav layui-nav-tree" lay-filter="test"> <ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed"> <li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">系统设置</a> <a class="" href="javascript:;">系统设置</a>
@ -31,6 +30,7 @@
<dd><a href="/index.php?c=admin&page=setting/site">站点设置</a></dd> <dd><a href="/index.php?c=admin&page=setting/site">站点设置</a></dd>
<dd><a href="/index.php?c=admin&page=setting/theme">主题设置</a></dd> <dd><a href="/index.php?c=admin&page=setting/theme">主题设置</a></dd>
<dd><a href="/index.php?c=admin&page=setting/transition_page">过渡页面</a></dd> <dd><a href="/index.php?c=admin&page=setting/transition_page">过渡页面</a></dd>
<dd><a href="/index.php?c=admin&page=setting/api">获取API</a></dd>
</dl> </dl>
</li> </li>
</ul> </ul>

52
templates/admin/setting/api.php

@ -0,0 +1,52 @@
<?php echo $transition_page['control']; ?>
<!-- API页面设置 -->
<?php require_once(dirname(__DIR__).'/header.php'); ?>
<?php include_once(dirname(__DIR__).'/left.php'); ?>
<div class="layui-body">
<!-- 内容主体区域 -->
<div class="layui-row content-body">
<!-- 说明提示框 -->
<div class="layui-col-lg12">
<div class="setting-msg">
API使用说明,请参考:<a href="https://dwz.ovh/viot5" target = "_blank" title = "OneNav API使用说明">https://dwz.ovh/viot5</a>
</div>
</div>
<!-- 说明提示框END -->
<div class="layui-col-lg6">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label" style = "width:130px;">用户名</label>
<div class="layui-input-inline">
<input style = "width:400px;" type="text" readonly="readonly" name="username" value = "<?php echo USER; ?>" autocomplete="off" placeholder="OneNav用户名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style = "width:130px;">SecretKey</label>
<div class="layui-input-inline">
<input style = "width:400px;" type="text" readonly="readonly" name="SecretKey" id = "SecretKey" value = "<?php echo $SecretKey; ?>" autocomplete="off" placeholder="OneNav SecretKey" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style = "width:130px;">Token</label>
<div class="layui-input-inline">
<input style = "width:400px;" type="text" name="token" id="token" readonly="readonly" autocomplete="off" placeholder="点击下方按钮可以计算Token" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="create_sk">生成SecretKey</button>
<button class="layui-btn" lay-submit="" lay-filter="change_sk">更换SecretKey</button>
<button class="layui-btn" lay-submit="" lay-filter="cal_token">计算Token</button>
</div>
</form>
</div>
</div>
</div>
<?php include_once(dirname(__DIR__).'/footer.php'); ?>

9
templates/admin/setting/site.php

@ -4,7 +4,7 @@
<?php include_once(dirname(__DIR__).'/left.php'); ?> <?php include_once(dirname(__DIR__).'/left.php'); ?>
<div class="layui-body"> <div class="layui-body">
<!-- 内容主体区域 --> <!-- 内容主体区域 -->
<div class="layui-row content-body"> <div class="layui-row content-body" style="padding-bottom: 3em;">
<!-- 说明提示框 --> <!-- 说明提示框 -->
<div class="layui-col-lg12"> <div class="layui-col-lg12">
<div class="setting-msg"> <div class="setting-msg">
@ -58,6 +58,13 @@
</div> </div>
</div> </div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">自定义footer</label>
<div class="layui-input-block">
<textarea name = "custom_footer" placeholder="自定义站点底部信息,请填写HTML代码" class="layui-textarea"><?php echo $site['custom_footer']; ?></textarea>
</div>
</div>
<div class="layui-form-item"> <div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="set_site">保存设置</button> <button class="layui-btn" lay-submit="" lay-filter="set_site">保存设置</button>
</div> </div>

4
templates/admin/static/add_quick_tpl.css

@ -59,8 +59,8 @@
box-sizing: content-box; box-sizing: content-box;
} }
.quick-main{ .quick-main{
width: 400px; width: 360px;
height: 460px; height: 420px;
margin: auto; margin: auto;
padding: 20px; padding: 20px;
background-color: white; background-color: white;

71
templates/admin/static/embed.js

@ -15,6 +15,7 @@ layui.use(['element','table','layer','form','upload'], function(){
,cols: [[ //表头 ,cols: [[ //表头
{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'} {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
,{field: 'name', title: '分类名称', width:160} ,{field: 'name', title: '分类名称', width:160}
,{field: 'fname', title: '父级分类', width:160}
,{field: 'add_time', title: '添加时间', width:160, sort: true,templet:function(d){ ,{field: 'add_time', title: '添加时间', width:160, sort: true,templet:function(d){
var add_time = timestampToTime(d.add_time); var add_time = timestampToTime(d.add_time);
return add_time; return add_time;
@ -291,6 +292,67 @@ layui.use(['element','table','layer','form','upload'], function(){
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
}); });
//生成token
form.on('submit(create_sk)', function(data){
if( data.field.SecretKey == '' ) {
$.post('/index.php?c=api&method=create_sk',data.field,function(data,status){
//如果添加成功
if(data.code == 0) {
$("#SecretKey").val(data.data);
layer.msg('SecretKey生成完毕!', {icon: 1});
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
}
else{
layer.msg('SecretKey已经存在!', {icon: 5});
}
//console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//更换token
form.on('submit(change_sk)', function(data){
if( data.field.SecretKey != '' ) {
$.post('/index.php?c=api&method=create_sk',data.field,function(data,status){
//如果添加成功
if(data.code == 0) {
$("#SecretKey").val(data.data);
layer.msg('SecretKey已更换!', {icon: 1});
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
}
else{
layer.msg('请先生成SecretKey!', {icon: 5});
}
//console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//计算token
form.on('submit(cal_token)', function(data){
if( (data.field.SecretKey != '') && (data.field.username != '' ) ) {
let username = data.field.username;
let sk = data.field.SecretKey;
let token = md5(username + sk);
$("#token").val(token);
layer.msg('token计算成功!', {icon: 1});
}
else{
layer.msg('SecretKey为空,请先生成!', {icon: 5});
}
//console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//添加链接 //添加链接
form.on('submit(add_link)', function(data){ form.on('submit(add_link)', function(data){
$.post('/index.php?c=api&method=add_link',data.field,function(data,status){ $.post('/index.php?c=api&method=add_link',data.field,function(data,status){
@ -526,3 +588,12 @@ function getQueryVariable(variable)
} }
return(false); return(false);
} }
//获取最新版本
function get_latest_version(){
$.get("https://git.xiaoz.me/xiaoz/onenav/raw/branch/main/version.txt",function(data,status){
$("#getting").hide();
$("#latest_version").text(data);
});
}
get_latest_version();

1
templates/baisuTwo/css/style.css

@ -1050,6 +1050,7 @@ footer a:hover {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;
} }
.m-navlist a.list i { .m-navlist a.list i {
display: block; display: block;

24
templates/baisuTwo/index.php

@ -15,7 +15,7 @@
<meta name="keywords" content="<?php echo $site['keywords']; ?>" /> <meta name="keywords" content="<?php echo $site['keywords']; ?>" />
<meta name="description" content="<?php echo $site['description']; ?>" /> <meta name="description" content="<?php echo $site['description']; ?>" />
<link rel="stylesheet" type="text/css" href="templates/<?php echo $template; ?>/css/style.css" /> <link rel="stylesheet" type="text/css" href="templates/<?php echo $template; ?>/css/style.css" />
<link rel="stylesheet" href="https://libs.xiaoz.top/font-awesome/4.7.0/css/font-awesome.css"> <link rel="stylesheet" href="static/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" type="text/css" href="static/layui/css/layui.css" /> <link rel="stylesheet" type="text/css" href="static/layui/css/layui.css" />
<?php echo $site['custom_header']; ?> <?php echo $site['custom_header']; ?>
</head> </head>
@ -54,16 +54,29 @@
<div class="type-list"> <div class="type-list">
<?php <?php
foreach ($categorys as $category) { foreach ($category_parent as $category) {
$font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> "; $font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> ";
?> ?>
<div class="list"> <div class="list">
<a class="catlist" href="#category-<?php echo $category['id']; ?>"> <a class="catlist" style="overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;" href="#category-<?php echo $category['id']; ?>">
<?php echo $font_icon; ?> <?php echo $font_icon; ?>
<?php echo htmlspecialchars_decode($category['name']); ?> <?php echo htmlspecialchars_decode($category['name']); ?>
</a> </a>
<span class="editFid" data-fid = "<?php echo $category['id']; ?>"><i class="iconfont icon-bianji"></i></span> <span class="editFid" data-fid = "<?php echo $category['id']; ?>"><i class="iconfont icon-bianji"></i></span>
</div> </div>
<!-- 遍历二级分类-->
<?php foreach (get_category_sub($category['id']) AS $category_sub){
?>
<div class="list" style="padding-left:1em;">
<a class="catlist" style="font-size:12px;font-weight: normal;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;" href="#category-<?php echo $category_sub['id']; ?>">
<i class="<?php echo $category_sub['font_icon']; ?>"></i>
<?php echo htmlspecialchars_decode($category_sub['name']); ?>
</a>
<span class="editFid" data-fid = "<?php echo $category_sub['id']; ?>"><i class="iconfont icon-bianji"></i></span>
</div>
<?php } ?>
<!-- 遍历二级分类END-->
<?php } ?> <?php } ?>
<div class="list add" id="addCat"> <div class="list add" id="addCat">
@ -216,11 +229,14 @@
<!--底部版权 S--> <!--底部版权 S-->
<footer> <footer>
<?php if( empty( $site['custom_footer']) ){ ?>
© 2022 BaiSu,Powered by © 2022 BaiSu,Powered by
<a target="_blank" href="https://github.com/helloxz/onenav" title="简约导航/书签管理器" rel="nofollow">OneNav</a> <a target="_blank" href="https://github.com/helloxz/onenav" title="简约导航/书签管理器" rel="nofollow">OneNav</a>
<br> The theme author is <br> The theme author is
<a href="https://gitee.com/baisucode/onenav" target="_blank">BaiSu</a> <a href="https://gitee.com/baisucode/onenav" target="_blank">BaiSu</a>
<?php }else{
echo $site['custom_footer'];
} ?>
</footer> </footer>
<!--底部版权 E--> <!--底部版权 E-->
<!--返回顶部 S--> <!--返回顶部 S-->

4
templates/baisuTwo/info.json

@ -2,8 +2,8 @@
"name":"百素主题2", "name":"百素主题2",
"description":"适用于OneNav的百素主题2", "description":"适用于OneNav的百素主题2",
"homepage":"https://gitee.com/baisucode/baisu-two", "homepage":"https://gitee.com/baisucode/baisu-two",
"version":"1.0.0", "version":"1.0.1",
"update":"2022/04/15", "update":"2022/04/22",
"author":"baisu", "author":"baisu",
"screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png" "screenshot":"https://img.rss.ink/imgs/2022/03/cba9f1946776a8f0.png"
} }

57
templates/default/index.php

@ -8,11 +8,11 @@
<meta name="keywords" content="<?php echo $site['keywords']; ?>" /> <meta name="keywords" content="<?php echo $site['keywords']; ?>" />
<meta name="description" content="<?php echo $site['description']; ?>" /> <meta name="description" content="<?php echo $site['description']; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel='stylesheet' href='/static/mdui/css/mdui.css'> <link rel='stylesheet' href='static/mdui/css/mdui.css'>
<link rel='stylesheet' href='https://libs.xiaoz.top/jQuery-contextMenu/2.9.2/jquery.contextMenu.min.css'> <link rel='stylesheet' href='static/jQuery-contextMenu/jquery.contextMenu.min.css'>
<link rel="stylesheet" href="https://libs.xiaoz.top/font-awesome/4.7.0/css/font-awesome.css"> <link rel="stylesheet" href="static/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="templates/<?php echo $template; ?>/static/style.css?v=<?php echo $version; ?>"> <link rel="stylesheet" href="templates/<?php echo $template; ?>/static/style.css?v=<?php echo $version; ?>">
<script src = '/static/mdui/js/mdui.min.js'></script> <script src = 'static/mdui/js/mdui.min.js'></script>
<?php echo $site['custom_header']; ?> <?php echo $site['custom_header']; ?>
</head> </head>
<body class = "mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-indigo mdui-theme-accent-pink mdui-loaded"> <body class = "mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-indigo mdui-theme-accent-pink mdui-loaded">
@ -84,17 +84,43 @@
<ul class="mdui-list"> <ul class="mdui-list">
<?php <?php
//遍历分类目录并显示 //遍历分类目录并显示
foreach ($categorys as $category) { foreach ($category_parent as $category) {
//var_dump($category); //var_dump($category);
$font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> "; $font_icon = empty($category['font_icon']) ? '' : "<i class='{$category['font_icon']}'></i> ";
?> ?>
<div class="mdui-collapse" mdui-collapse>
<div class="mdui-collapse-item">
<div class="mdui-collapse-item-header">
<a href="#category-<?php echo $category['id']; ?>"> <a href="#category-<?php echo $category['id']; ?>">
<li class="mdui-list-item mdui-ripple"> <li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-content category-name"><?php echo $font_icon; ?><?php echo htmlspecialchars_decode($category['name']); ?></div> <div class="mdui-list-item-content category-name"><?php echo $font_icon; ?><?php echo htmlspecialchars_decode($category['name']); ?></div>
<i class="mdui-collapse-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
</li> </li>
</a> </a>
</div>
<!-- 遍历二级分类 -->
<div class="mdui-collapse-item-body">
<ul>
<?php foreach (get_category_sub( $category['id'] ) AS $category_sub){
?>
<a href="#category-<?php echo $category_sub['id']; ?>">
<li class="mdui-list-item mdui-ripple" style="margin-left:-4.3em;">
<div class="mdui-list-item-content category_sub">
<i>
<i class="<?php echo $category_sub['font_icon']; ?>"></i><?php echo htmlspecialchars_decode($category_sub['name']); ?>
</i>
</div>
</li>
</a>
<?php } ?>
</ul>
</div>
<!-- 遍历二级分类END-->
<?php } ?> <?php } ?>
</div>
</div>
<a href="https://www.xiaoz.me/" target="_blank" title="小z博客"> <a href="https://www.xiaoz.me/" target="_blank" title="小z博客">
<li class="mdui-list-item mdui-ripple"> <li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-content category-name"><i class="fa fa-user-circle"></i> About</div> <div class="mdui-list-item-content category-name"><i class="fa fa-user-circle"></i> About</div>
@ -156,9 +182,10 @@
foreach ($links as $link) { foreach ($links as $link) {
//默认描述 //默认描述
$link['description'] = empty($link['description']) ? '作者很懒,没有填写描述。' : $link['description']; $link['description'] = empty($link['description']) ? '作者很懒,没有填写描述。' : $link['description'];
$id = $link['id'];
//var_dump($link); //var_dump($link);
?> ?>
<a href="/index.php?c=click&id=<?php echo $link['id']; ?>" target="_blank" title = "<?php echo $link['description']; ?>">
<div class="mdui-col-lg-3 mdui-col-md-4 mdui-col-xs-12 link-space" id = "id_<?php echo $link['id']; ?>" link-title = "<?php echo $link['title']; ?>" link-url = "<?php echo $link['url']; ?>"> <div class="mdui-col-lg-3 mdui-col-md-4 mdui-col-xs-12 link-space" id = "id_<?php echo $link['id']; ?>" link-title = "<?php echo $link['title']; ?>" link-url = "<?php echo $link['url']; ?>">
<!--定义一个卡片--> <!--定义一个卡片-->
<div class="mdui-card link-line mdui-hoverable"> <div class="mdui-card link-line mdui-hoverable">
@ -169,22 +196,18 @@
</div> </div>
<?php } ?> <?php } ?>
<!-- 角标END --> <!-- 角标END -->
<a href="/index.php?c=click&id=<?php echo $link['id']; ?>" target="_blank" title = "<?php echo $link['description']; ?>">
<div class="mdui-card-primary" style = "padding-top:16px;"> <div class="mdui-card-primary" style = "padding-top:16px;">
<div class="mdui-card-primary-title link-title"> <div class="mdui-card-primary-title link-title">
<img src="https://favicon.rss.ink/v1/<?php echo base64($link['url']); ?>" alt="HUAN" width="16" height="16"> <img src="https://favicon.rss.ink/v1/<?php echo base64($link['url']); ?>" alt="HUAN" width="16" height="16">
<span class="link_title"><?php echo $link['title']; ?></span> <span class="link_title"><?php echo $link['title']; ?></span>
</div> </div>
</div> </div>
</a>
<!-- 卡片的内容end --> <!-- 卡片的内容end -->
<div class="mdui-card-content mdui-text-color-black-disabled" style="padding-top:0px;"><span class="link-content"><?php echo $link['description']; ?></span></div> <div class="mdui-card-content mdui-text-color-black-disabled" style="padding-top:0px;"><span class="link-content"><?php echo $link['description']; ?></span></div>
</div> </div>
<!--卡片END--> <!--卡片END-->
</div> </div>
</a>
<?php } ?> <?php } ?>
<!-- 遍历链接END --> <!-- 遍历链接END -->
<?php } ?> <?php } ?>
@ -198,14 +221,18 @@
<!-- footer部分 --> <!-- footer部分 -->
<!-- 未经作者授权,请勿去掉版权,否则可能影响作者更新代码的积极性或直接放弃维护此项目。 --> <!-- 未经作者授权,请勿去掉版权,否则可能影响作者更新代码的积极性或直接放弃维护此项目。 -->
<footer> <footer>
<?php if(empty( $site['custom_footer']) ){ ?>
© 2022 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a> © 2022 Powered by <a target = "_blank" href="https://github.com/helloxz/onenav" title = "简约导航/书签管理器" rel = "nofollow">OneNav</a>.The author is <a href="https://www.xiaoz.me/" target="_blank" title = "小z博客">xiaoz.me</a>
<?php }else{
echo $site['custom_footer'];
} ?>
</footer> </footer>
<!-- footerend --> <!-- footerend -->
</body> </body>
<script src = '/static/js/jquery.min.js'></script> <script src = 'static/js/jquery.min.js'></script>
<script src="/static/layer/layer.js"></script> <script src="static/layer/layer.js"></script>
<script src = 'https://libs.xiaoz.top/jQuery-contextMenu/2.9.2/jquery.contextMenu.min.js'></script> <script src = 'static/jQuery-contextMenu/jquery.contextMenu.min.js'></script>
<script src = 'https://libs.xiaoz.top/clipBoard.js/clipBoard.min.js'></script> <script src = 'static/js/clipBoard.min.js'></script>
<script src = "templates/<?php echo $template; ?>/static/holmes.js"></script> <script src = "templates/<?php echo $template; ?>/static/holmes.js"></script>
<script src="templates/<?php echo $template; ?>/static/embed.js?v=<?php echo $version; ?>"></script> <script src="templates/<?php echo $template; ?>/static/embed.js?v=<?php echo $version; ?>"></script>
<script> <script>

4
templates/default/info.json

@ -2,8 +2,8 @@
"name":"OneNav默认主题", "name":"OneNav默认主题",
"description":"OneNav默认主题", "description":"OneNav默认主题",
"homepage":"https://www.xiaoz.me", "homepage":"https://www.xiaoz.me",
"version":"0.9.18", "version":"0.9.19",
"update":"2022/04/13", "update":"2022/04/22",
"author":"xiaoz<xiaoz93@outlook.com>", "author":"xiaoz<xiaoz93@outlook.com>",
"screenshot":"https://img.rss.ink/imgs/2022/03/42ed3ef2c4a50f6d.png" "screenshot":"https://img.rss.ink/imgs/2022/03/42ed3ef2c4a50f6d.png"
} }

5
templates/default/static/embed.js

@ -245,3 +245,8 @@ function on_search(){
// default: alert(event); // default: alert(event);
// } // }
// }); // });
//链接跳转
function goto(url) {
window.location.href = url;
}

13
templates/default/static/style.css

@ -146,3 +146,16 @@ footer a{
padding-top: 70px; padding-top: 70px;
margin-top: -70px; margin-top: -70px;
} */ } */
.category_sub{
font-size:14px;
margin-left:0px;
/*padding-left:8px;*/
}
.category_sub i{
padding-right:5px;
}
#drawer{
background-color: #FEFEFE;
box-shadow:1px 0 5px 0 #eeeeee;
}
Loading…
Cancel
Save