Browse Source

20220414

pull/59/head
xiaoz 3 years ago
parent
commit
c205f223ec
  1. 63
      class/Api.php
  2. 108
      controller/admin.php
  3. 48
      controller/api.php
  4. 23
      controller/click.php
  5. 14
      controller/index.php
  6. 6
      data/update.log
  7. 3
      db/sql/20220414.sql
  8. 4
      static/js/jquery.min.js
  9. 1
      static/layui/css/layui.css
  10. 1
      static/layui/css/modules/code.css
  11. 1
      static/layui/css/modules/laydate/default/laydate.css
  12. BIN
      static/layui/css/modules/layer/default/icon-ext.png
  13. BIN
      static/layui/css/modules/layer/default/icon.png
  14. 1
      static/layui/css/modules/layer/default/layer.css
  15. BIN
      static/layui/css/modules/layer/default/loading-0.gif
  16. BIN
      static/layui/css/modules/layer/default/loading-1.gif
  17. BIN
      static/layui/css/modules/layer/default/loading-2.gif
  18. BIN
      static/layui/font/iconfont.eot
  19. 554
      static/layui/font/iconfont.svg
  20. BIN
      static/layui/font/iconfont.ttf
  21. BIN
      static/layui/font/iconfont.woff
  22. BIN
      static/layui/font/iconfont.woff2
  23. 5
      static/layui/layui.js
  24. 13559
      static/mdui/css/mdui.css
  25. 1
      static/mdui/css/mdui.css.map
  26. 6
      static/mdui/css/mdui.min.css
  27. 1
      static/mdui/css/mdui.min.css.map
  28. 201
      static/mdui/fonts/roboto/LICENSE.txt
  29. BIN
      static/mdui/fonts/roboto/Roboto-Black.woff
  30. BIN
      static/mdui/fonts/roboto/Roboto-Black.woff2
  31. BIN
      static/mdui/fonts/roboto/Roboto-BlackItalic.woff
  32. BIN
      static/mdui/fonts/roboto/Roboto-BlackItalic.woff2
  33. BIN
      static/mdui/fonts/roboto/Roboto-Bold.woff
  34. BIN
      static/mdui/fonts/roboto/Roboto-Bold.woff2
  35. BIN
      static/mdui/fonts/roboto/Roboto-BoldItalic.woff
  36. BIN
      static/mdui/fonts/roboto/Roboto-BoldItalic.woff2
  37. BIN
      static/mdui/fonts/roboto/Roboto-Light.woff
  38. BIN
      static/mdui/fonts/roboto/Roboto-Light.woff2
  39. BIN
      static/mdui/fonts/roboto/Roboto-LightItalic.woff
  40. BIN
      static/mdui/fonts/roboto/Roboto-LightItalic.woff2
  41. BIN
      static/mdui/fonts/roboto/Roboto-Medium.woff
  42. BIN
      static/mdui/fonts/roboto/Roboto-Medium.woff2
  43. BIN
      static/mdui/fonts/roboto/Roboto-MediumItalic.woff
  44. BIN
      static/mdui/fonts/roboto/Roboto-MediumItalic.woff2
  45. BIN
      static/mdui/fonts/roboto/Roboto-Regular.woff
  46. BIN
      static/mdui/fonts/roboto/Roboto-Regular.woff2
  47. BIN
      static/mdui/fonts/roboto/Roboto-RegularItalic.woff
  48. BIN
      static/mdui/fonts/roboto/Roboto-RegularItalic.woff2
  49. BIN
      static/mdui/fonts/roboto/Roboto-Thin.woff
  50. BIN
      static/mdui/fonts/roboto/Roboto-Thin.woff2
  51. BIN
      static/mdui/fonts/roboto/Roboto-ThinItalic.woff
  52. BIN
      static/mdui/fonts/roboto/Roboto-ThinItalic.woff2
  53. 393
      static/mdui/icons/material-icons/LICENSE.txt
  54. 1
      static/mdui/icons/material-icons/MaterialIcons-Regular.ijmap
  55. BIN
      static/mdui/icons/material-icons/MaterialIcons-Regular.woff
  56. BIN
      static/mdui/icons/material-icons/MaterialIcons-Regular.woff2
  57. 5976
      static/mdui/js/mdui.esm.js
  58. 1
      static/mdui/js/mdui.esm.js.map
  59. 6474
      static/mdui/js/mdui.js
  60. 1
      static/mdui/js/mdui.js.map
  61. 7
      static/mdui/js/mdui.min.js
  62. 1
      static/mdui/js/mdui.min.js.map
  63. 11
      templates/admin/click.php
  64. 4
      templates/admin/footer.php
  65. 2
      templates/admin/header.php
  66. 16
      templates/admin/left.php
  67. 63
      templates/admin/setting/site.php
  68. 64
      templates/admin/setting/theme.php
  69. 29
      templates/admin/setting/theme_detail.php
  70. 44
      templates/admin/setting/transition_page.php
  71. 28
      templates/admin/static/embed.js
  72. 9
      templates/baisuTwo/info.json
  73. 25
      templates/default/index.php
  74. 9
      templates/default/info.json

63
class/Api.php

@ -788,8 +788,16 @@ class Api { @@ -788,8 +788,16 @@ class Api {
}
//读取需要更新的SQL内容
try {
//读取一个SQL温江,并将单个SQL文件拆分成单条SQL语句循环执行
//读取一个SQL文件,并将单个SQL文件拆分成单条SQL语句循环执行
switch ($name) {
case '20220414.sql':
$sql_content = explode("\n",file_get_contents($sql_name));
break;
default:
$sql_content = explode(';',file_get_contents($sql_name));
break;
}
//计算SQL总数
$num = count($sql_content) - 1;
//初始数量设置为0
@ -828,6 +836,59 @@ class Api { @@ -828,6 +836,59 @@ class Api {
$this->err_msg(-2000,$e->getMessage());
}
}
/**
* 更新option
*/
public function set_option($key,$value = '') {
$key = htmlspecialchars(trim($key));
//如果key是空的
if( empty($key) ) {
$this->err_msg(-2000,'键不能为空!');
}
//鉴权
if( !$this->is_login() ) {
$this->err_msg(-1002,'Authorization failure!');
}
$count = $this->db->count("on_options", [
"key" => $key
]);
//如果数量是0,则插入,否则就是更新
if( $count === 0 ) {
try {
$this->db->insert("on_options",[
"key" => $key,
"value" => $value
]);
$data = [
"code" => 0,
"data" => "设置成功!"
];
exit(json_encode($data));
} catch (\Throwable $th) {
$this->err_msg(-2000,$th);
}
}
//更新数据
else if( $count === 1 ) {
try {
$this->db->update("on_options",[
"value" => $value
],[
"key" => $key
]);
$data = [
"code" => 0,
"data" => "设置已更新!"
];
exit(json_encode($data));
} catch (\Throwable $th) {
$this->err_msg(-2000,$th);
}
}
}
}

108
controller/admin.php

@ -82,6 +82,114 @@ if ( $page == 'imp_link' ) { @@ -82,6 +82,114 @@ if ( $page == 'imp_link' ) {
$category['checked'] = '';
}
}
//主题详情页面
if ( $page == 'setting/theme_detail' ) {
//获取主题名称
$name = @$_GET['name'];
//主题目录
$tpl_dir1 = dirname(__DIR__).'/templates/'.$name;
//备用主题目录
$tps_dir2 = dirname(__DIR__).'/data/templates/'.$name;
if( is_dir($tpl_dir1) ) {
$info = file_get_contents($tpl_dir1.'/info.json');
}
else{
$info = file_get_contents($tpl_dir2.'/info.json');
}
$theme = json_decode($info);
//var_dump($theme);
}
//主题设置页面
if( $page == 'setting/theme' ) {
//主题目录
$tpl_dir1 = dirname(__DIR__).'/templates/';
//备用主题目录
$tps_dir2 = dirname(__DIR__).'/data/templates/';
//声明两个空数组用来存放模板目录列表
$tpl_one = [];
$tps_two = [];
//遍历第一个目录
foreach ( scandir($tpl_dir1) as $value) {
//完整的路径
$path = $tpl_dir1.$value;
//如果是目录,则push到目录列表1
if( is_dir($path) ) {
switch ($value) {
case '.':
case '..':
case 'admin':
continue;
break;
default:
array_push($tpl_one,$value);
break;
}
}
else{
continue;
}
}
//如果第二个目录存在,则遍历
if( is_dir($tps_dir2) ) {
foreach ( scandir($tpl_dir2) as $value) {
//完整的路径
$path = $tpl_dir2.$value;
//如果是目录,则push到目录列表1
if( is_dir($path) ) {
switch ($value) {
case '.':
case '..':
case 'admin':
continue;
break;
default:
array_push($tpl_two,$value);
break;
}
}
else{
continue;
}
}
}
//合并目录
//现在$tpl_one是合并后的完整主题列表
array_merge($tpl_one,$tpl_two);
//读取主题里面的信息
//设置一个空数组
$data = [];
foreach ($tpl_one as $value) {
//如果文件存在
if( $tpl_dir1.$value.'/info.json' ) {
$data[$value]['info'] = json_decode(@file_get_contents( $tpl_dir1.$value.'/info.json' ));
}
else{
$data[$value]['info'] = json_decode(@file_get_contents( $tpl_dir2.$value.'/info.json' ));
}
}
$themes = $data;
//获取当前主题
$current_them = $db->get('on_options','value',[ 'key' => "theme" ]);
}
//站点设置页面
if( $page == 'setting/site' ) {
//获取当前站点信息
$site = $db->get('on_options','value',[ 'key' => "s_site" ]);
$site = unserialize($site);
}
//过渡页设置页面
if( $page == 'setting/transition_page' ) {
//获取当前站点信息
$transition_page = $db->get('on_options','value',[ 'key' => "s_transition_page" ]);
$transition_page = unserialize($transition_page);
}
//如果是退出
//如果页面是添加链接页面

48
controller/api.php

@ -236,3 +236,51 @@ function exe_sql($api) { @@ -236,3 +236,51 @@ function exe_sql($api) {
$data['name'] = htmlspecialchars(trim($_GET['name']));
$api->exe_sql($data);
}
//设置options表
function set_theme($api) {
$key = 'theme';
$value = htmlspecialchars($_POST['value']);
$api->set_option($key,$value);
}
//设置站点信息
function set_site($api) {
//获取传递过来的参数
//获取网站标题
$data['title'] = htmlspecialchars($_POST['title']);
//获取网站logo
$data['logo'] = htmlspecialchars($_POST['logo']);
//获取副标题
$data['subtitle'] = htmlspecialchars($_POST['subtitle']);
//获取关键词
$data['keywords'] = htmlspecialchars($_POST['keywords']);
//获取描述
$data['description'] = htmlspecialchars($_POST['description']);
//获取自定义header
$data['custom_header'] = $_POST['custom_header'];
//序列化存储
$value = serialize($data);
$api->set_option('s_site',$value);
}
//设置过渡页面
function set_transition_page($api) {
//获取传递过来的参数
//获取开关
$data['control'] = htmlspecialchars(trim($_POST['control']));
//获取游客停留时间
$data['visitor_stay_time'] = intval($_POST['visitor_stay_time']);
//获取管理员停留时间
$data['admin_stay_time'] = intval($_POST['admin_stay_time']);
//序列化存储
$value = serialize($data);
$api->set_option('s_transition_page',$value);
}

23
controller/click.php

@ -34,6 +34,14 @@ if( is_login() ) { @@ -34,6 +34,14 @@ if( is_login() ) {
$is_login = TRUE;
}
//查询过渡页设置
$transition_page = $db->get('on_options','value',[ 'key' => "s_transition_page" ]);
$transition_page = unserialize($transition_page);
//获取当前站点信息
$site = $db->get('on_options','value',[ 'key' => "s_site" ]);
$site = unserialize($site);
//link.id为公有,且category.id为公有
if( ( $link['property'] == 0 ) && ($category['property'] == 0) ){
//增加link.id的点击次数
@ -46,10 +54,16 @@ if( ( $link['property'] == 0 ) && ($category['property'] == 0) ){ @@ -46,10 +54,16 @@ if( ( $link['property'] == 0 ) && ($category['property'] == 0) ){
]);
//如果更新成功
if($update) {
//判断是否开启过渡页面
if ( ($transition_page['control'] == 'off') && ( empty($link['url_standby']) ) ){
//进行header跳转
//header('location:'.$link['url']);
header('location:'.$link['url']);
}
//如果备用链接不为空,或者开启了过渡页面
else if( !empty($link['url_standby']) || ($transition_page['control'] == 'on') ) {
#加载跳转模板
require('templates/admin/click.php');
}
exit;
}
}
@ -66,10 +80,15 @@ elseif( is_login() ) { @@ -66,10 +80,15 @@ elseif( is_login() ) {
//如果更新成功
if($update) {
//判断是否开启过渡页面
if ( ($transition_page['control'] == 'off') && ( empty($link['url_standby']) ) ){
//进行header跳转
//header('location:'.$link['url']);
header('location:'.$link['url']);
}
else if( !empty($link['url_standby']) || ($transition_page['control'] == 'on') ) {
#加载跳转模板
require('templates/admin/click.php');
}
exit;
}
}

14
controller/index.php

@ -118,12 +118,22 @@ else{ @@ -118,12 +118,22 @@ else{
// 载入前台首页模板
//查询主题设置
$template = $db->get("on_options","value",[
"key" => "theme"
]);
//获取当前站点信息
$site = $db->get('on_options','value',[ 'key' => "s_site" ]);
$site = unserialize($site);
//判断文件夹是否存在
if( is_dir('templates/'.TEMPLATE) ){
if( is_dir('templates/'.$template) ){
$tpl_dir = 'templates/';
}
else{
$tpl_dir = 'data/templates/';
}
require($tpl_dir.TEMPLATE.'/index.php');
require($tpl_dir.$template.'/index.php');
?>

6
data/update.log

@ -67,3 +67,9 @@ CREATE INDEX on_options_key_IDX ON on_options ("key"); @@ -67,3 +67,9 @@ CREATE INDEX on_options_key_IDX ON on_options ("key");
20220315
1. 修复一个任意文件漏洞
2. baisuTwo主题更新
20220414
1. 新增:站点信息、主题、过渡页面可直接通过后台设置
2. 主题新增 info.json 对主题进行描述
3. 移除自定义Javascript,改用站点设置的自定义header
4. 部分资源已经本地化

3
db/sql/20220414.sql

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
INSERT INTO on_options ("key", value, extend) VALUES('theme', 'default', NULL);
INSERT INTO on_options ("key", value, extend) VALUES('s_site', 'a:6:{s:5:"title";s:6:"OneNav";s:4:"logo";s:0:"";s:8:"subtitle";s:24:"开源书签管理程序";s:8:"keywords";s:107:"OneNav,OneNav导航,OneNav书签,开源导航,开源书签,简洁导航,云链接,个人导航,个人书签";s:11:"description";s:319:"OneNav是一款开源免费的书签(导航)管理程序,由xiaoz使用使用PHP + SQLite 3开发,界面简洁,安装简单,使用方便。OneNav可帮助你将浏览器书签集中式管理,解决跨设备、跨平台、跨浏览器之间同步和访问困难问题,做到一处部署,随处访问。";s:13:"custom_header";s:0:"";}', NULL);
INSERT INTO on_options ("key", value, extend) VALUES('s_transition_page', 'a:3:{s:7:"control";s:3:"off";s:17:"visitor_stay_time";i:5;s:15:"admin_stay_time";i:0;}', NULL);

4
static/js/jquery.min.js vendored

File diff suppressed because one or more lines are too long

1
static/layui/css/layui.css

File diff suppressed because one or more lines are too long

1
static/layui/css/modules/code.css

@ -0,0 +1 @@ @@ -0,0 +1 @@
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}

1
static/layui/css/modules/laydate/default/laydate.css

File diff suppressed because one or more lines are too long

BIN
static/layui/css/modules/layer/default/icon-ext.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
static/layui/css/modules/layer/default/icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1
static/layui/css/modules/layer/default/layer.css

File diff suppressed because one or more lines are too long

BIN
static/layui/css/modules/layer/default/loading-0.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
static/layui/css/modules/layer/default/loading-1.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

BIN
static/layui/css/modules/layer/default/loading-2.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/layui/font/iconfont.eot

Binary file not shown.

554
static/layui/font/iconfont.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 299 KiB

BIN
static/layui/font/iconfont.ttf

Binary file not shown.

BIN
static/layui/font/iconfont.woff

Binary file not shown.

BIN
static/layui/font/iconfont.woff2

Binary file not shown.

5
static/layui/layui.js vendored

File diff suppressed because one or more lines are too long

13559
static/mdui/css/mdui.css

File diff suppressed because it is too large Load Diff

1
static/mdui/css/mdui.css.map

File diff suppressed because one or more lines are too long

6
static/mdui/css/mdui.min.css vendored

File diff suppressed because one or more lines are too long

1
static/mdui/css/mdui.min.css.map

File diff suppressed because one or more lines are too long

201
static/mdui/fonts/roboto/LICENSE.txt

@ -0,0 +1,201 @@ @@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

BIN
static/mdui/fonts/roboto/Roboto-Black.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Black.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-BlackItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-BlackItalic.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Bold.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Bold.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-BoldItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-BoldItalic.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Light.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Light.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-LightItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-LightItalic.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Medium.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Medium.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-MediumItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-MediumItalic.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Regular.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Regular.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-RegularItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-RegularItalic.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Thin.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-Thin.woff2

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-ThinItalic.woff

Binary file not shown.

BIN
static/mdui/fonts/roboto/Roboto-ThinItalic.woff2

Binary file not shown.

393
static/mdui/icons/material-icons/LICENSE.txt

@ -0,0 +1,393 @@ @@ -0,0 +1,393 @@
Attribution 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More_considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution 4.0 International Public License ("Public License"). To the
extent this Public License may be interpreted as a contract, You are
granted the Licensed Rights in consideration of Your acceptance of
these terms and conditions, and the Licensor grants You such rights in
consideration of benefits the Licensor receives from making the
Licensed Material available under these terms and conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public licenses.
Notwithstanding, Creative Commons may elect to apply one of its public
licenses to material it publishes and in those instances will be
considered the "Licensor." Except for the limited purpose of indicating
that material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the public
licenses.
Creative Commons may be contacted at creativecommons.org.

1
static/mdui/icons/material-icons/MaterialIcons-Regular.ijmap

File diff suppressed because one or more lines are too long

BIN
static/mdui/icons/material-icons/MaterialIcons-Regular.woff

Binary file not shown.

BIN
static/mdui/icons/material-icons/MaterialIcons-Regular.woff2

Binary file not shown.

5976
static/mdui/js/mdui.esm.js

File diff suppressed because it is too large Load Diff

1
static/mdui/js/mdui.esm.js.map

File diff suppressed because one or more lines are too long

6474
static/mdui/js/mdui.js

File diff suppressed because it is too large Load Diff

1
static/mdui/js/mdui.js.map

File diff suppressed because one or more lines are too long

7
static/mdui/js/mdui.min.js vendored

File diff suppressed because one or more lines are too long

1
static/mdui/js/mdui.min.js.map

File diff suppressed because one or more lines are too long

11
templates/admin/click.php

@ -15,15 +15,22 @@ @@ -15,15 +15,22 @@
text-overflow:ellipsis;/*超出部分文字以...显示dsds*/
}
</style>
<?php echo $site['custom_header']; ?>
<?php
//不存在多个链接的情况,如果用户已经登录,则1s后跳转,不然等5s
if( empty($link['url_standby']) ) {
//游客停留时间
$visitor_stay_time = $transition_page['visitor_stay_time'];
//管理员停留时间
$admin_stay_time = $transition_page['admin_stay_time'];
if ($is_login) {
header("Refresh:1;url=".$link['url']);
//header("Refresh:1;url=".$link['url']);
header("Refresh:$admin_stay_time;url=".$link['url']);
}
else{
header("Refresh:5;url=".$link['url']);
header("Refresh:$visitor_stay_time;url=".$link['url']);
}
}

4
templates/admin/footer.php

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
© Copyright 2022.Powered by <a href="https://github.com/helloxz/onenav" rel = "nofollow" target="_blank">OneNav</a>.
</div>
</div>
<script src = 'https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js'></script>
<script src = 'https://libs.xiaoz.top/layui/v2.5.4/layui.js'></script>
<script src = 'static/js/jquery.min.js'></script>
<script src = 'static/layui/layui.js'></script>
<script src="templates/admin/static/embed.js?v=<?php echo $version; ?>"></script>
</body>

2
templates/admin/header.php

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>OneNav后台管理</title>
<link rel='stylesheet' href='https://libs.xiaoz.top/layui/v2.5.4/css/layui.css'>
<link rel='stylesheet' href='static/layui/css/layui.css'>
<link rel='stylesheet' href='templates/admin/static/style.css?v=<?php echo $version; ?>'>
</head>
<body class="layui-layout-body">

16
templates/admin/left.php

@ -22,14 +22,28 @@ @@ -22,14 +22,28 @@
</li>
</ul>
<!-- 系统设置 -->
</ul>
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">系统设置</a>
<dl class="layui-nav-child">
<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/transition_page">过渡页面</a></dd>
</dl>
</li>
</ul>
<!-- 系统设置END -->
<!-- <ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">高级功能</a>
<dl class="layui-nav-child">
<dd><a href="/index.php?c=admin&page=ext_js">自定义JavaScript</a></dd>
</dl>
</li>
</ul>
</ul> -->
</div>
</div>

63
templates/admin/setting/site.php

@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
<!-- 站点设置 -->
<!-- 主题设置 -->
<?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-lg6">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label">网站标题</label>
<div class="layui-input-block">
<input type="text" name="title" value = "<?php echo $site['title']; ?>" required lay-verify="required" autocomplete="off" placeholder="请输入网站标题" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网站logo</label>
<div class="layui-input-block">
<input type="text" name="logo" value = "<?php echo $site['logo']; ?>" autocomplete="off" placeholder="网站logo地址,部分主题可能不支持" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">副标题</label>
<div class="layui-input-block">
<input type="text" name="subtitle" value = "<?php echo $site['subtitle']; ?>" autocomplete="off" placeholder="请输入副标题" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网站关键词</label>
<div class="layui-input-block">
<input type="text" name="keywords" value = "<?php echo $site['keywords']; ?>" autocomplete="off" placeholder="输入网站关键词,用英文状态的逗号分隔" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">网站描述</label>
<div class="layui-input-block">
<textarea placeholder="网站描述,一般不超过200字符" name = "description" class="layui-textarea"><?php echo $site['description']; ?></textarea>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">自定义header</label>
<div class="layui-input-block">
<textarea name = "custom_header" placeholder="您可以自定义<header>...</header>之间的内容,如果您不清楚,请勿填写!" rows = "8" class="layui-textarea"><?php echo $site['custom_header']; ?></textarea>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="set_site">保存设置</button>
</div>
</form>
</div>
</div>
</div>
<?php include_once(dirname(__DIR__).'/footer.php'); ?>

64
templates/admin/setting/theme.php

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
<!-- 主题设置 -->
<?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="layui-row layui-col-space24">
<?php foreach ($themes as $key => $theme) {
//var_dump($theme['info']->name);
?>
<!-- 主题列表 -->
<div class="layui-col-lg2">
<fieldset style = "padding:1em;border:0px;height:180px;background-color:#EEEEEE;box-shadow: 2px 2px 3px #888888;color:#666666">
<legend style = "font-size:38px;"><?php echo $key; ?></legend>
<p><h1><?php echo $theme['info']->name ?></h1></p>
<p>版本:<?php echo $theme['info']->version ?></p>
<p>更新时间:<?php echo $theme['info']->update ?></p>
<br />
<p>
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" onclick = "set_theme('<?php echo $key; ?>')">使用</button>
<button type="button" class="layui-btn layui-btn-sm" onclick = "theme_detail('<?php echo $key; ?>')">详情</button>
<?php if( $current_them == $key ) { ?>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger">当前主题</button>
<?php } ?>
</div>
</p>
</fieldset>
</div>
<!-- 主题列表END -->
<?php } ?>
</div>
</div>
</div>
</div>
<?php include_once(dirname(__DIR__).'/footer.php'); ?>
<script>
layui.use('layer', function(){
var layer = layui.layer;
});
function theme_detail(name){
layer.open({
title: name,
type:2,
area: ['60%', '59%'],
content:'/index.php?c=admin&page=setting/theme_detail&name=' + name
});
}
function set_theme(name) {
$.post("/index.php?c=api&method=set_theme",{key:"theme",value:name},function(data,status){
if( data.code == 0 ) {
layer.msg(data.data, {icon: 1});
setTimeout(() => {
location.reload();
}, 2000);
}
else{
layer.msg(data.data, {icon: 5});
}
});
}
</script>

29
templates/admin/setting/theme_detail.php

@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
<!-- 主题详情页面 -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>OneNav后台管理</title>
<link rel='stylesheet' href='static/layui/css/layui.css'>
<link rel='stylesheet' href='templates/admin/static/style.css?v=v0.9.17-20220314'>
</head>
<body class="layui-fluid">
<div class="layui-row" style = "margin-top:1em;">
<div class="layui-col-sm9" style = "border-right:1px solid #e2e2e2;">
<div style = "margin-left:1em;margin-right:1em;">
<img src="<?php echo $theme->screenshot; ?>" alt="" style = "max-width:100%;">
</div>
</div>
<div class="layui-col-sm3">
<div style = "margin-left:1em;margin-right:1em;">
<h1><?php echo $theme->name; ?></h1>
<p>描述:<?php echo $theme->description; ?></p>
<p>版本:<?php echo $theme->version; ?></p>
<p>更新时间:<?php echo $theme->update; ?></p>
<p>作者:<?php echo $theme->author; ?></p>
<p>主页:<a style = "color:#01AAED;" href="<?php echo $theme->homepage; ?>" target="_blank" rel = "nofollow"><?php echo $theme->homepage; ?></a></p>
</div>
</div>
</div>
</body>
</html>

44
templates/admin/setting/transition_page.php

@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
<?php echo $transition_page['control']; ?>
<!-- 过渡页面设置 -->
<?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-lg6">
<form class="layui-form layui-form-pane" action="">
<div class="layui-form-item">
<label class="layui-form-label">过渡页</label>
<div class="layui-input-block">
<input type="radio" name="control" value="off" <?php echo ( $transition_page['control'] == 'off' ) ? "checked" : ''; ?> title="关闭">
<input type="radio" name="control" value="on" <?php echo ( $transition_page['control'] == 'on' ) ? "checked" : ''; ?> title="开启">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">访客停留时间</label>
<div class="layui-input-inline">
<input type="number" min="0" max="86400" lay-verify="required|number" name="visitor_stay_time" value = "<?php echo $transition_page['visitor_stay_time']; ?>" autocomplete="off" placeholder="访客停留时间,单位s" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">访客停留时间,单位秒</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">管理员停留时间</label>
<div class="layui-input-inline">
<input type="number" min="0" max="86400" lay-verify="required|number" name="admin_stay_time" value = "<?php echo $transition_page['admin_stay_time']; ?>" required lay-verify="required" autocomplete="off" placeholder="管理员停留时间,单位s" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">管理员停留时间,单位秒</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit="" lay-filter="set_transition_page">保存设置</button>
</div>
</form>
</div>
</div>
</div>
<?php include_once(dirname(__DIR__).'/footer.php'); ?>

28
templates/admin/static/embed.js

@ -220,6 +220,34 @@ layui.use(['element','table','layer','form','upload'], function(){ @@ -220,6 +220,34 @@ layui.use(['element','table','layer','form','upload'], function(){
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//保存站点设置
form.on('submit(set_site)', function(data){
$.post('/index.php?c=api&method=set_site',data.field,function(data,status){
if(data.code == 0) {
layer.msg(data.data, {icon: 1});
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//保存站点设置
form.on('submit(set_transition_page)', function(data){
$.post('/index.php?c=api&method=set_transition_page',data.field,function(data,status){
if(data.code == 0) {
layer.msg(data.data, {icon: 1});
}
else{
layer.msg(data.err_msg, {icon: 5});
}
});
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
});
//添加分类目录
form.on('submit(add_category)', function(data){
$.post('/index.php?c=api&method=add_category',data.field,function(data,status){

9
templates/baisuTwo/info.json

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
{
"name":"百素主题2",
"description":"百素主题2",
"homepage":"https://www.xiaoz.me",
"version":"1.0.0",
"update":"2022/04/13",
"author":"baisu",
"screenshot":"https://img.rss.ink/imgs/2022/03/42ed3ef2c4a50f6d.png"
}

25
templates/default/index.php

@ -2,18 +2,18 @@ @@ -2,18 +2,18 @@
<html lang="zh-ch" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title><?php echo $site_setting['title']; ?></title>
<title><?php echo $site['title']; ?> - <?php echo $site['subtitle']; ?></title>
<meta name="generator" content="EverEdit" />
<meta name="author" content="xiaoz<www.xiaoz.me>" />
<meta name="keywords" content="<?php echo $site_setting['keywords']; ?>" />
<meta name="description" content="<?php echo $site_setting['description']; ?>" />
<meta name="keywords" content="<?php echo $site['keywords']; ?>" />
<meta name="description" content="<?php echo $site['description']; ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel='stylesheet' href='https://libs.xiaoz.top/mdui/v1.0.1/css/mdui.min.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="https://libs.xiaoz.top/font-awesome/4.7.0/css/font-awesome.css">
<link rel="stylesheet" href="templates/<?php echo TEMPLATE; ?>/static/style.css?v=<?php echo $version; ?>">
<script src = 'https://libs.xiaoz.top/mdui/v1.0.1/js/mdui.min.js'></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/hotkeys-js@3.7.3/dist/hotkeys.min.js"></script> -->
<link rel="stylesheet" href="templates/<?php echo $template; ?>/static/style.css?v=<?php echo $version; ?>">
<script src = '/static/mdui/js/mdui.min.js'></script>
<?php echo $site['custom_header']; ?>
</head>
<body class = "mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-primary-indigo mdui-theme-accent-pink mdui-loaded">
<!--导航工具-->
@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
<!-- <button class="mdui-btn" mdui-drawer="{target: '#drawer'}"><i class="mdui-icon material-icons">home</i></button> -->
<span class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-drawer="{target: '#drawer', swipe: true}"><i class="mdui-icon material-icons">menu</i></span>
<!-- <a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">home</i></a> -->
<a href="/" class = "mdui-typo-headline" title = "<?php echo $site_setting['description'] ?>"><span class="mdui-typo-title"><?php echo $site_setting['logo']; ?></span></a>
<a href="/" class = "mdui-typo-headline" title = "<?php echo $site['description'] ?>"><span class="mdui-typo-title"><?php echo $site['title']; ?></span></a>
<div class="mdui-toolbar-spacer"></div>
<!-- 搜索框 -->
<!-- <div class="mdui-col-lg-3">
@ -202,14 +202,13 @@ @@ -202,14 +202,13 @@
</footer>
<!-- footerend -->
</body>
<script src = 'https://libs.xiaoz.top/jquery/2.2.4/jquery.min.js'></script>
<script src="/static//layer/layer.js"></script>
<script src = '/static/js/jquery.min.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 = 'https://libs.xiaoz.top/clipBoard.js/clipBoard.min.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/holmes.js"></script>
<script src="templates/<?php echo $template; ?>/static/embed.js?v=<?php echo $version; ?>"></script>
<script>
<?php echo $onenav['right_menu']; ?>
</script>
<?php echo $onenav['extend']; ?>
</html>

9
templates/default/info.json

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
{
"name":"OneNav默认主题",
"description":"OneNav默认主题",
"homepage":"https://www.xiaoz.me",
"version":"0.9.18",
"update":"2022/04/13",
"author":"xiaoz<xiaoz93@outlook.com>",
"screenshot":"https://img.rss.ink/imgs/2022/03/42ed3ef2c4a50f6d.png"
}
Loading…
Cancel
Save