mirror of
https://github.com/LyLme/lylme_spage.git
synced 2024-11-17 14:34:08 +08:00
优化 后台设置
This commit is contained in:
parent
38adf38d0d
commit
b0ff923693
@ -1,13 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 05:29:51
|
||||
* @FilePath: /lylme_spage/admin/about.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '关于页面设置';
|
||||
include './head.php';
|
||||
if ($_GET['set'] == 'conf_submit') {
|
||||
$set = isset($_GET['set'])?$_GET['set']:"";
|
||||
if ($set== 'conf_submit') {
|
||||
$about = $_POST['about'];
|
||||
saveSetting('about_content', $about);
|
||||
echo '<script>alert("修改成功!");window.location.href="./about.php";</script>';
|
||||
exit();
|
||||
}
|
||||
if ($_GET['set'] == 'default') {
|
||||
if ($set == 'default') {
|
||||
|
||||
saveSetting('about_content', "<h3>关于本站</h3>\r\n<p>感谢来访,本站致力于简洁高效的上网导航和搜索入口,安全快捷。</p>\r\n<p>如果您喜欢我们的网站,请将本站添加到收藏夹(快捷键<code>Ctrl+D</code>),并<a href=\"https://jingyan.baidu.com/article/4dc40848868eba89d946f1c0.html\" target=\"_blank\">设为浏览器主页</a>,方便您的下次访问,感谢支持。<p>\r\n<hr>\r\n<h3>本站承诺</h3>\r\n<p><strong>绝对不会收集用户的隐私信息</strong><p>\r\n<p>区别于部分导航网站,本站链接直接跳转目标,不会对链接处理再后跳转,不会收集用户的隐藏信息,包括但不限于点击记录,访问记录和搜索记录,请放心使用</p>\r\n<hr>\r\n<h3>申请收录</h3>\r\n<p>请点<a href=\"../apply\" target=\"_blank\">这里</a></p>\r\n<hr>\r\n<h3>联系我们</h3>\r\n<p>若您在使用本站时遇到了包括但不限于以下问题:</p>\r\n<li>图标缺失</li>\r\n<li>目标网站无法打开</li>\r\n<li>描述错误</li>\r\n<li>网站违规</li>\r\n<li>收录加急处理</li>\r\n<li>链接删除</li>\r\n<p><strong>请发邮件与我们联系</strong></p>\r\n<h5>联系邮箱</h5>\r\n<p><a href=\"mailto:无\">无</a></p>\r\n<h5>联系说明</h5>\r\n<p>为了您的问题能快速被处理,建议在邮件主题添加【反馈】【投诉】【推荐】【友链】</p>");
|
||||
echo '<script>alert("恢复默认成功!");window.location.href="./about.php";</script>';
|
||||
|
@ -1,52 +1,63 @@
|
||||
<?php
|
||||
|
||||
include_once("../include/common.php");
|
||||
if(isset($islogin) == 1) {
|
||||
if (isset($islogin) == 1) {
|
||||
} else {
|
||||
exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
}
|
||||
header('Content-Type:application/json');
|
||||
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
switch($set) {
|
||||
//修改分组
|
||||
switch ($set) {
|
||||
//审核
|
||||
case 'status':
|
||||
$id = $_POST['id'];
|
||||
$sw = $_POST['status'];
|
||||
$sql = "UPDATE `lylme_apply` SET `apply_status` = '" . $sw . "' WHERE `lylme_apply`.`apply_id` = " . $id . ";";
|
||||
if($sw == 1) {
|
||||
if ($DB->query($sql)) {
|
||||
$applyres = $DB->get_row("SELECT * FROM `lylme_apply` WHERE `apply_id` = " . $id);
|
||||
$name = strip_tags(daddslashes($applyres['apply_name']));
|
||||
$url = strip_tags(daddslashes($applyres['apply_url']));
|
||||
$icon = daddslashes($applyres['apply_icon']);
|
||||
$group_id = strip_tags(daddslashes($applyres['apply_group']));
|
||||
$desc = strip_tags(daddslashes($applyres['apply_desc']));
|
||||
$link_order = $DB->count('select MAX(id) from `lylme_links`') + 1;
|
||||
$sql1 = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $desc . " ', '" . $link_order . "');";
|
||||
if($DB->query($sql1)) {
|
||||
exit('{"code": "200","msg":"成功!网站已成功收录!"}');
|
||||
} else {
|
||||
exit('{"code": "-1","操作失败!原因:\n' . $DB->error() . '"}');
|
||||
$sw = $_POST['status'] == 1 ? 1 : 2;
|
||||
$ids = $_POST['id'];
|
||||
if (!is_array($ids)) {
|
||||
//转为数组
|
||||
$ids = array($ids);
|
||||
}
|
||||
$e = 0;
|
||||
foreach ($ids as $id) {
|
||||
if ($sw == 1) {
|
||||
//将通过的链接插入到数据库
|
||||
$applyres = $DB->get_row("SELECT * FROM `lylme_apply` WHERE `apply_status` = 0 ANd `apply_id` = $id");
|
||||
if (!empty($applyres)) {
|
||||
$name = strip_tags(daddslashes($applyres['apply_name']));
|
||||
$url = strip_tags(daddslashes($applyres['apply_url']));
|
||||
$icon = daddslashes($applyres['apply_icon']);
|
||||
$group_id = strip_tags(daddslashes($applyres['apply_group']));
|
||||
$link_order = $DB->count('select MAX(id) from `lylme_links`') + 1;
|
||||
$DB->query("INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '$name', '$group_id', '$url', '$icon', '', '$link_order');");
|
||||
}
|
||||
}
|
||||
} elseif($sw == 2) {
|
||||
if ($DB->query($sql)) {
|
||||
exit('{"code": "200","msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": "-1","操作失败!原因:\n' . $DB->error() . '"}');
|
||||
$sql = "UPDATE `lylme_apply` SET `apply_status` = '$sw' WHERE `apply_status` = 0 ANd `apply_id` = $id;";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": "-2","操作失败!-2"}');
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
//删除
|
||||
case 'delete':
|
||||
$id = $_POST['id'];
|
||||
$delsql = 'DELETE FROM `lylme_apply` WHERE apply_id =' . $id;
|
||||
if ($DB->query($delsql)) {
|
||||
exit('{"code": "200","msg":"操作成功!"}');
|
||||
$ids = $_POST['id'];
|
||||
if (!is_array($ids)) {
|
||||
$ids = array($ids);
|
||||
}
|
||||
$e = 0;
|
||||
foreach ($ids as $id) {
|
||||
if (!$DB->query("DELETE FROM `lylme_apply` WHERE apply_id = $id")) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": "-2","操作失败!-2"}');
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1,114 +1,176 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-13 17:25:21
|
||||
* @FilePath: /lylme_spage/admin/ajax_link.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
header('Content-Type:application/json');
|
||||
include_once("../include/common.php");
|
||||
if(isset($islogin)==1) {
|
||||
|
||||
|
||||
if (isset($islogin) == 1) {
|
||||
} else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
$submit = isset($_GET['submit']) ? $_GET['submit'] : null;
|
||||
switch($submit) {
|
||||
$e = 0;
|
||||
switch ($submit) {
|
||||
|
||||
//修改分组
|
||||
//修改分组
|
||||
case 'set_group':
|
||||
foreach($_POST['links'] as $lk=> $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `group_id` = '".$_POST['group_id']."' WHERE `lylme_links`.`id` = ".$lv.";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
foreach ($_POST['links'] as $lk => $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `group_id` = '" . $_POST['group_id'] . "' WHERE `lylme_links`.`id` = " . $lv . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
case 'allorder':
|
||||
//拖拽排序
|
||||
for ($i=0; $i<count($_POST["link_array"]); $i++) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_order` = '".$i."' WHERE `lylme_links`.`id` = ".$_POST["link_array"][$i].";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
//拖拽排序
|
||||
for ($i = 0; $i < count($_POST["link_array"]); $i++) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_order` = '" . $i . "' WHERE `lylme_links`.`id` = " . $_POST["link_array"][$i] . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
case 'pwd_link':
|
||||
//链接加密
|
||||
foreach($_POST['links'] as $lk=> $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_pwd` = '".$_POST['pwd_id']."' WHERE `lylme_links`.`id` = ".$lv.";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
//链接加密
|
||||
foreach ($_POST['links'] as $lk => $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_pwd` = '" . $_POST['pwd_id'] . "' WHERE `lylme_links`.`id` = " . $lv . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
case 'on':
|
||||
//链接启用
|
||||
foreach($_POST['links'] as $lk=> $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_status` = '1' WHERE `lylme_links`.`id` = ".$lv.";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
//链接启用
|
||||
foreach ($_POST['links'] as $lk => $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_status` = '1' WHERE `lylme_links`.`id` = " . $lv . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
case 'off':
|
||||
//链接禁用
|
||||
foreach($_POST['links'] as $lk=> $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_status` = '0' WHERE `lylme_links`.`id` = ".$lv.";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
//链接禁用
|
||||
foreach ($_POST['links'] as $lk => $lv) {
|
||||
$sql = "UPDATE `lylme_links` SET `link_status` = '0' WHERE `lylme_links`.`id` = " . $lv . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
case 'del':
|
||||
//链接删除
|
||||
foreach($_POST['links'] as $lk=> $lv) {
|
||||
$sql = "DELETE FROM `lylme_links` WHERE `lylme_links`.`id` = ".$lv.";";
|
||||
$DB->query($sql);
|
||||
}
|
||||
break;
|
||||
//链接删除
|
||||
foreach ($_POST['links'] as $lk => $lv) {
|
||||
$sql = "DELETE FROM `lylme_links` WHERE `lylme_links`.`id` = " . $lv . ";";
|
||||
if (!$DB->query($sql)) {
|
||||
$e++;
|
||||
}
|
||||
}
|
||||
if ($e == 0) {
|
||||
exit('{"code": 200,"msg":"操作成功!"}');
|
||||
} else {
|
||||
exit('{"code": 100,"msg":"错误,失败' . $e . '条"}');
|
||||
}
|
||||
break;
|
||||
|
||||
//获取链接信息
|
||||
case 'geturl':
|
||||
$url = $_GET['url'];
|
||||
$head = get_head($url);
|
||||
if(empty($head['title'])&&empty($head['icon']))exit('Unable to access');
|
||||
//download_img($url,head['icon']);
|
||||
header('Content-Type:application/json');
|
||||
exit(json_encode($head,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE)); //输出json
|
||||
break;
|
||||
//检测更新
|
||||
//获取链接信息
|
||||
case 'geturl':
|
||||
$url = $_GET['url'];
|
||||
$head = get_head($url);
|
||||
if (empty($head['title']) && empty($head['icon'])) exit('Unable to access');
|
||||
exit(json_encode($head, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); //输出json
|
||||
break;
|
||||
//检测更新
|
||||
case 'update':
|
||||
function zipExtract ($src, $dest) {
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($src)===true) {
|
||||
$zip->extractTo($dest);
|
||||
$zip->close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function deldir($dir) {
|
||||
if(!is_dir($dir))return false;
|
||||
$dh=opendir($dir);
|
||||
while ($file=readdir($dh)) {
|
||||
if($file!="." && $file!="..") {
|
||||
$fullpath=$dir."/".$file;
|
||||
if(!is_dir($fullpath)) {
|
||||
unlink($fullpath);
|
||||
} else {
|
||||
deldir($fullpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if(rmdir($dir)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$scriptpath=str_replace('\\','/',$_SERVER['SCRIPT_NAME']);
|
||||
$scriptpath = substr($scriptpath, 0, strrpos($scriptpath, '/'));
|
||||
$admin_path = substr($scriptpath, strrpos($scriptpath, '/')+1);
|
||||
$RemoteFile = $_POST['file'];
|
||||
$ZipFile = "lylme_spage-update.zip";
|
||||
copy($RemoteFile,$ZipFile) or die("无从更新服务器下载更新包文件!");
|
||||
if (zipExtract($ZipFile,ROOT)) {
|
||||
if($admin_path!='admin' && is_dir(ROOT.'admin')) {
|
||||
//修改后台地址
|
||||
deldir(ROOT.$admin_path);
|
||||
rename(ROOT.'admin',ROOT.$admin_path);
|
||||
}
|
||||
unlink($ZipFile);
|
||||
exit ('success');
|
||||
}
|
||||
else {
|
||||
unlink($ZipFile);
|
||||
exit('无法解压文件!请手动下载更新包解压');
|
||||
}
|
||||
break;
|
||||
function zipExtract($src, $dest)
|
||||
{
|
||||
$zip = new ZipArchive();
|
||||
if ($zip->open($src) === true) {
|
||||
$zip->extractTo($dest);
|
||||
$zip->close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function deldir($dir)
|
||||
{
|
||||
if (!is_dir($dir)) return false;
|
||||
$dh = opendir($dir);
|
||||
while ($file = readdir($dh)) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $dir . "/" . $file;
|
||||
if (!is_dir($fullpath)) {
|
||||
unlink($fullpath);
|
||||
} else {
|
||||
deldir($fullpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
if (rmdir($dir)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$scriptpath = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']);
|
||||
$scriptpath = substr($scriptpath, 0, strrpos($scriptpath, '/'));
|
||||
$admin_path = substr($scriptpath, strrpos($scriptpath, '/') + 1);
|
||||
$update = require('cache.php');
|
||||
if (!empty($update) && $update['switch']) {
|
||||
if (!$update['file'] == $_POST['file']) {
|
||||
exit('{"code": -1,"msg":"更新文件校验不通过!"}');
|
||||
}
|
||||
} else {
|
||||
exit('{"code": -99,"msg":"更新未经鉴权!"}');
|
||||
}
|
||||
$RemoteFile = $_POST['file'];
|
||||
$ZipFile = "lylme_spage-update.zip";
|
||||
copy($RemoteFile, $ZipFile) or die('{"code": 400,"msg":"无从更新服务器获取更新资源包!"}');
|
||||
if (zipExtract($ZipFile, ROOT)) {
|
||||
if ($admin_path != 'admin' && is_dir(ROOT . 'admin')) {
|
||||
//修改后台地址
|
||||
deldir(ROOT . $admin_path);
|
||||
rename(ROOT . 'admin', ROOT . $admin_path);
|
||||
}
|
||||
unlink($ZipFile);
|
||||
exit('{"code": 200,"msg":"更新成功"}');
|
||||
} else {
|
||||
unlink($ZipFile);
|
||||
exit('{"code": 10,"msg":"无法解压文件!请手动下载更新包解压"}');
|
||||
}
|
||||
break;
|
||||
default:
|
||||
exit('error');
|
||||
break;
|
||||
exit('{"code": -2,"msg":"error"}');
|
||||
break;
|
||||
}
|
33
admin/ajax_theme.php
Normal file
33
admin/ajax_theme.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 主题设置操作
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-04-12 22:39:49
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-13 17:22:28
|
||||
* @FilePath: /lylme_spage/admin/ajax_theme.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
|
||||
include_once("../include/common.php");
|
||||
if (isset($islogin) == 1) {
|
||||
} else {
|
||||
exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
}
|
||||
header('Content-Type:application/json');
|
||||
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
$data = isset($_POST) ? $_POST : null;
|
||||
if ($set == "save" && !empty($data)) {
|
||||
$theme_name = "theme_config_" . $conf['template'];
|
||||
// $data['status'] = isset($data['status']) && $data['status'] == "on" ? true : false;
|
||||
unset($data['file']);
|
||||
$data = json_encode($data);
|
||||
if (saveSetting($theme_name, $data, theme($conf['template'], 'theme_name') . "主题自定义设置")) {
|
||||
exit('{"code": 200,"msg":"保存成功"}');
|
||||
} else {
|
||||
exit('{"code": 0,"msg":"保存失败"}');
|
||||
}
|
||||
} else {
|
||||
exit('{"code": -1,"msg":"非法请求!"}');
|
||||
}
|
374
admin/apply.php
374
admin/apply.php
@ -1,32 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 申请收录
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-13 17:05:21
|
||||
* @FilePath: /lylme_spage/admin/apply.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '收录管理';
|
||||
include './head.php';
|
||||
$applyrows=$DB->num_rows($DB->query("SELECT * FROM `lylme_apply`"));
|
||||
$applyrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_apply`"));
|
||||
$grouplists = $DB->query("SELECT * FROM `lylme_groups`");
|
||||
?>
|
||||
<script src="../assets/js/svg.js"></script>
|
||||
<style>td img,td svg.icon {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
max-width: 35px;
|
||||
}
|
||||
pre{
|
||||
<style>
|
||||
td img,
|
||||
td svg.icon {
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
max-width: 35px;
|
||||
}
|
||||
|
||||
pre {
|
||||
line-height: 1 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$row2 = $DB->query("select * from lylme_apply where apply_id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
echo '<h4>修改链接信息</h4>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$row2 = $DB->query("select * from lylme_apply where apply_id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
echo '<h4>修改链接信息</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./apply.php?set=edit_submit&id=' . $id . '" method="POST">
|
||||
<div class="form-apply">
|
||||
@ -47,22 +59,22 @@ if ($set == 'edit') {
|
||||
<div class="form-group">
|
||||
<label>*分组:</label><br>
|
||||
<select class="form-control" name="apply_group">';
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['apply_group']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '" ' . $select . '>' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select>
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['apply_group']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '" ' . $select . '>' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select>
|
||||
</div>
|
||||
<div class="form-apply">
|
||||
<input type="submit" class="btn btn-primary btn-block" value="确定修改"></form>
|
||||
</div>
|
||||
<br/><a href="./apply.php"><<返回收录管理列表</a></div></div>';
|
||||
} elseif ($set == 'conf') {
|
||||
echo '<h4>修改收录设置</h4>
|
||||
} elseif ($set == 'conf') {
|
||||
echo '<h4>修改收录设置</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./apply.php?set=conf_submit" method="POST">
|
||||
<div class="form-group" id="apply">
|
||||
@ -70,19 +82,19 @@ if ($set == 'edit') {
|
||||
<label class="lyear-switch switch-solid switch-cyan">
|
||||
<select class="form-control" name="apply">
|
||||
<option ';
|
||||
if($conf['apply'] == 0) echo 'selected="selected"';
|
||||
echo 'value="0">开启-需要审核</option><option ';
|
||||
if($conf['apply'] == 1) echo 'selected="selected"';
|
||||
echo 'value="1">开启-无需审核</option><option ';
|
||||
if($conf['apply'] == 2) echo 'selected="selected"';
|
||||
echo 'value="2">关闭-关闭申请</option>
|
||||
if ($conf['apply'] == 0) echo 'selected="selected"';
|
||||
echo 'value="0">开启-需要审核</option><option ';
|
||||
if ($conf['apply'] == 1) echo 'selected="selected"';
|
||||
echo 'value="1">开启-无需审核</option><option ';
|
||||
if ($conf['apply'] == 2) echo 'selected="selected"';
|
||||
echo 'value="2">关闭-关闭申请</option>
|
||||
</select>
|
||||
</label>
|
||||
<small class="help-block">申请收录开关,地址:<code>'. siteurl().'/apply</code><br>前往<a href="/apply" target="_blank">申请收录</a>提交页</small>
|
||||
<small class="help-block">申请收录开关,地址:<code>' . siteurl() . '/apply</code><br>前往<a href="/apply" target="_blank">申请收录</a>提交页</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="apply_gg">收录页公告</label>
|
||||
<textarea width="200px" type="text" rows="5" class="form-control" name="apply_gg" placeholder="显示在收录页的公告">'.$conf['apply_gg'].'</textarea>
|
||||
<textarea width="200px" type="text" rows="5" class="form-control" name="apply_gg" placeholder="显示在收录页的公告">' . $conf['apply_gg'] . '</textarea>
|
||||
<small class="help-block">显示在收录页的公告<code>使用HTML代码编写</code></small>
|
||||
工具:<a href="https://www.lylme.com/html/" target="_blank">在线MD编辑器</a> 编辑后复制html代码粘贴
|
||||
</div>
|
||||
@ -90,171 +102,137 @@ echo 'value="2">关闭-关闭申请</option>
|
||||
<input type="submit" class="btn btn-primary btn-block" value="保存"></form>
|
||||
</div>
|
||||
<br/><a href="./apply.php"><<返回收录管理列表</a></div></div>';
|
||||
|
||||
}elseif ($set == 'conf_submit') {
|
||||
$apply= $_POST['apply'];
|
||||
$apply_gg= $_POST['apply_gg'];
|
||||
saveSetting('apply',$apply);
|
||||
saveSetting('apply_gg',$apply_gg);
|
||||
echo '<script>alert("修改成功!");window.location.href="./apply.php";</script>';
|
||||
}
|
||||
elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_apply where apply_id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if (!$rows) echo '<script>alert("当前记录不存在!");history.go(-1);</script>';
|
||||
$name = $_POST['apply_name'];
|
||||
$icon = $_POST['apply_icon'];
|
||||
$url = $_POST['apply_url'];
|
||||
$group = $_POST['apply_group'];
|
||||
if ($name == NULL) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "UPDATE `lylme_apply` SET `apply_name` = '" . $name . "', `apply_group` = '" . $group . "',`apply_icon` = '" . $icon . "',`apply_url` = '" . $url . "' WHERE `lylme_apply`.`apply_id` = '" . $id . "';";
|
||||
if ($DB->query($sql)) echo '<script>alert("修改 ' . $name . ' 成功!");window.location.href="./apply.php";</script>'; else echo '<script>alert("' . $sql . '修改失败!原因:\n'.$DB->error().'");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<pre>'.$conf['apply_gg'].'<br><a href="./apply.php?set=conf">修改</a></pre>';
|
||||
echo '<div class="alert alert-info">
|
||||
} elseif ($set == 'conf_submit') {
|
||||
$apply = $_POST['apply'];
|
||||
$apply_gg = $_POST['apply_gg'];
|
||||
saveSetting('apply', $apply);
|
||||
saveSetting('apply_gg', $apply_gg);
|
||||
echo '<script>alert("修改成功!");window.location.href="./apply.php";</script>';
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_apply where apply_id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if (!$rows) echo '<script>alert("当前记录不存在!");history.go(-1);</script>';
|
||||
$name = $_POST['apply_name'];
|
||||
$icon = $_POST['apply_icon'];
|
||||
$url = $_POST['apply_url'];
|
||||
$group = $_POST['apply_group'];
|
||||
if ($name == NULL) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "UPDATE `lylme_apply` SET `apply_name` = '" . $name . "', `apply_group` = '" . $group . "',`apply_icon` = '" . $icon . "',`apply_url` = '" . $url . "' WHERE `lylme_apply`.`apply_id` = '" . $id . "';";
|
||||
if ($DB->query($sql)) echo '<script>alert("修改 ' . $name . ' 成功!");window.location.href="./apply.php";</script>';
|
||||
else echo '<script>alert("' . $sql . '修改失败!原因:\n' . $DB->error() . '");history.go(-1);</script>';
|
||||
}
|
||||
} else {
|
||||
echo '<pre>' . $conf['apply_gg'] . '<br><a href="./apply.php?set=conf">修改</a></pre>';
|
||||
echo '<div class="alert alert-info">
|
||||
收录申请统计: <b>' . $applyrows . '</b> 次<br/>
|
||||
收录申请开关: <b>';
|
||||
|
||||
switch ($conf['apply']) {
|
||||
case 0:
|
||||
echo '开启-需要审核';
|
||||
break;
|
||||
case 1:
|
||||
echo '开启-无需审核';
|
||||
break;
|
||||
case 2:
|
||||
echo '关闭-关闭申请';
|
||||
break;
|
||||
}
|
||||
echo '</b> <a href="./apply.php?set=conf">修改设置</a><br>
|
||||
申请收录地址:<code>'. siteurl().'/apply</code> <a href="'. siteurl().'/apply" target="_blank">访问</a><br><br><sub>已审核的图标会被隐藏,点击图标可重新加载<br>部分网站图标一直处于加载或无法显示,可能原因:无法访问或跨域问题,建议建将图标本地化</sub></div>';
|
||||
switch ($conf['apply']) {
|
||||
case 0:
|
||||
echo '开启-需要审核';
|
||||
break;
|
||||
case 1:
|
||||
echo '开启-无需审核';
|
||||
break;
|
||||
case 2:
|
||||
echo '关闭-关闭申请';
|
||||
break;
|
||||
}
|
||||
echo '</b> <a href="./apply.php?set=conf">修改设置</a><br>
|
||||
申请收录地址:<code>' . siteurl() . '/apply</code> <a href="' . siteurl() . '/apply" target="_blank">访问</a><br><br><sub>已审核的图标会被隐藏,点击图标可重新加载<br>部分网站图标一直处于加载或无法显示,可能原因:无法访问或跨域问题,建议建将图标本地化</sub></div>';
|
||||
|
||||
?>
|
||||
<div class="table-responsive" id="applylist">
|
||||
<table class="table table-striped">
|
||||
<thead><tr><th>序号</th><th>图标</th><th>名称</th><th>链接</th><th>访问</th><th>分组</th><th>审核</th><th>操作</th><th>申请时间</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$rs = $DB->query("SELECT * FROM `lylme_apply` ORDER BY `lylme_apply`.`apply_time` DESC");
|
||||
$i=0;
|
||||
while ($res = $DB->fetch($rs)) {
|
||||
$i++;
|
||||
echo '<tr><td>';
|
||||
?>
|
||||
<div id="toolbar" class="toolbar-btn-action">
|
||||
<button id="btn_edit" type="button" class="btn btn-success btn-label" onclick="checked_status(1)">
|
||||
<label><i class="mdi mdi-check" aria-hidden="true"></i></label>通过</button>
|
||||
<button id="btn_edit" type="button" class="btn btn-warning btn-label" onclick="checked_status(2)">
|
||||
<label><i class="mdi mdi-block-helper" aria-hidden="true"></i></label>拒绝</button>
|
||||
<button id="btn_delete" type="button" class="btn btn-danger btn-label" onclick="checked_del()">
|
||||
<label><i class="mdi mdi-window-close" aria-hidden="true"></i></label>删除</button>
|
||||
|
||||
if($res["apply_status"]==0) {echo '<font color="#48b0f7"><b>'.$i.'</b></font>';}
|
||||
else{echo '<b>'.$i.'</b>';}
|
||||
echo '</td><td>';
|
||||
if($res["apply_status"]==0) {
|
||||
if(empty($res["apply_icon"])){
|
||||
echo '未提交图标';
|
||||
}
|
||||
else if (preg_match("/^<svg*/", $link["icon"])) {
|
||||
echo $link["icon"];
|
||||
}
|
||||
else{
|
||||
echo '<img class="lazy" src="https://cdn.lylme.com/admin/lyear/img/loading.gif" data-original="' . $res["apply_icon"] . '" />';
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo '<img class="lazys" title="获取" src="https://cdn.lylme.com/admin/lyear/img/get.png" data-original="' . $res["apply_icon"] . '"';
|
||||
}
|
||||
echo '</td><td>' . $res['apply_name'] . '</td><td>' . $res['apply_url'] .'</td><td><a class="btn btn-purple btn-xs" href="../include/go.php?url='. $res['apply_url'].'" target="_blank">访问</a></td><td>'.$DB->fetch($DB->query("SELECT * FROM `lylme_groups` WHERE `group_id` = " . $res['apply_group'])) ["group_name"].'
|
||||
|
||||
</div>
|
||||
<div class="table-responsive" id="applylist">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="checkbox-parent" id="check_all" onclick="check_all()"></th>
|
||||
<th>序号</th>
|
||||
<th>图标</th>
|
||||
<th>名称</th>
|
||||
<th>链接</th>
|
||||
<th>访问</th>
|
||||
<th>分组</th>
|
||||
<th>审核</th>
|
||||
<th>操作</th>
|
||||
<th>申请时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$rs = $DB->query("SELECT * FROM `lylme_apply` ORDER BY `lylme_apply`.`apply_time` DESC");
|
||||
$i = 0;
|
||||
while ($res = $DB->fetch($rs)) {
|
||||
$i++;
|
||||
echo '<tr><td><input type="checkbox" name="link-check" value="' . $res['apply_id'] . '"></td><td>';
|
||||
|
||||
if ($res["apply_status"] == 0) {
|
||||
echo '<font color="#48b0f7"><b>' . $i . '</b></font>';
|
||||
} else {
|
||||
echo '<b>' . $i . '</b>';
|
||||
}
|
||||
echo '</td><td>';
|
||||
if ($res["apply_status"] == 0) {
|
||||
if (empty($res["apply_icon"])) {
|
||||
echo '未提交图标';
|
||||
} else if (preg_match("/^<svg*/", $link["icon"])) {
|
||||
echo $link["icon"];
|
||||
} else {
|
||||
echo '<img class="lazy" src="https://cdn.lylme.com/admin/lyear/img/loading.gif" data-original="' . $res["apply_icon"] . '" />';
|
||||
}
|
||||
} else {
|
||||
echo '<img class="lazys" title="获取" src="https://cdn.lylme.com/admin/lyear/img/get.png" data-original="' . $res["apply_icon"] . '"';
|
||||
}
|
||||
echo '</td><td>' . $res['apply_name'] . '</td><td>' . $res['apply_url'] . '</td><td><a class="btn btn-purple btn-xs" href="../include/go.php?url=' . $res['apply_url'] . '" target="_blank">访问</a></td><td>' . $DB->fetch($DB->query("SELECT * FROM `lylme_groups` WHERE `group_id` = " . $res['apply_group']))["group_name"] . '
|
||||
</td><td>';
|
||||
if($res["apply_status"]==2) {
|
||||
echo '<font color="#f96868">已拒绝</font>';
|
||||
} else if($res["apply_status"]==1) {
|
||||
echo '<font color="#3c763d">已通过</font>';
|
||||
} else {
|
||||
echo '
|
||||
if ($res["apply_status"] == 2) {
|
||||
echo '<font color="#f96868">已拒绝</font>';
|
||||
} else if ($res["apply_status"] == 1) {
|
||||
echo '<font color="#3c763d">已通过</font>';
|
||||
} else {
|
||||
echo '
|
||||
<button class="btn btn-primary btn-xs" onclick="status(' . $res['apply_id'] . ',1)">通过</button>
|
||||
<button class="btn btn-cyan btn-xs" onclick="status(' . $res['apply_id'] . ',2)">拒绝</a>';
|
||||
}
|
||||
echo '</td><td>';
|
||||
if($res["apply_status"]==0) {echo '<a href="./apply.php?set=edit&id=' . $res['apply_id'] . '" class="btn btn-info btn-xs">编辑</a> ';}
|
||||
echo ' <button class="btn btn-xs btn-danger" onclick="deletes(' . $res['apply_id'] . ')">删除</button> </td>
|
||||
<td>'.$res['apply_time'].'</td>
|
||||
<button class="btn btn-warning btn-xs" onclick="status(' . $res['apply_id'] . ',2)">拒绝</a>';
|
||||
}
|
||||
echo '</td><td>';
|
||||
if ($res["apply_status"] == 0) {
|
||||
echo '<a href="./apply.php?set=edit&id=' . $res['apply_id'] . '" class="btn btn-info btn-xs">编辑</a> ';
|
||||
}
|
||||
echo ' <button class="btn btn-xs btn-danger" onclick="deletes(' . $res['apply_id'] . ')">删除</button> </td>
|
||||
<td>' . $res['apply_time'] . '</td>
|
||||
</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
}
|
||||
include './footer.php';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
}
|
||||
include './footer.php';
|
||||
?>
|
||||
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery.lazyload/1.9.1/jquery.lazyload.min.js" type="application/javascript"></script>
|
||||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.1.1/layer.min.js" type="application/javascript"></script>
|
||||
<script>
|
||||
function status(id,status){
|
||||
$.ajax({
|
||||
url:"ajax_apply.php?set=status",
|
||||
type:"POST",
|
||||
dataType:"json",
|
||||
data:{id:id,status:status},
|
||||
success:function(data){
|
||||
if(data.code == '200'){
|
||||
layer.msg(data.msg);
|
||||
$("#applylist").load(location.href+" #applylist>*","");
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
layer.msg(data.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function deletes(id){
|
||||
if(!confirm("确定删除?")){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url:"ajax_apply.php?set=delete",
|
||||
type:"POST",
|
||||
dataType:"json",
|
||||
data:{id:id},
|
||||
success:function(data){
|
||||
if(data.code == '200'){
|
||||
layer.msg(data.msg);
|
||||
$("#applylist").load(location.href+" #applylist>*","");
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
layer.msg(data.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
$("img.lazy").lazyload({
|
||||
threshold : 100
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$(".lazys").click(function(){
|
||||
$(this).attr('src','https://cdn.lylme.com/admin/lyear/img/loading.gif');
|
||||
$(this).lazyload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="/assets/admin/js/bootstrap-notify.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/lightyear.js"></script>
|
||||
<script src="/assets/admin/js/jquery.lazyload.min.js" type="application/javascript"></script>
|
||||
<script src="/assets/admin/js/layer.min.js" type="application/javascript"></script>
|
||||
<link href="/assets/admin/js/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="/assets/admin/js/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<script src="/assets/admin/js/apply.js"></script>
|
5
admin/css/bootstrap.min.css
vendored
5
admin/css/bootstrap.min.css
vendored
File diff suppressed because one or more lines are too long
1
admin/css/coloris.min.css
vendored
1
admin/css/coloris.min.css
vendored
@ -1 +0,0 @@
|
||||
.clr-picker{display:none;flex-wrap:wrap;position:absolute;width:200px;z-index:1000;border-radius:10px;background-color:#fff;justify-content:space-between;box-shadow:0 0 5px rgba(0,0,0,.05),0 5px 20px rgba(0,0,0,.1);-moz-user-select:none;-webkit-user-select:none;user-select:none}.clr-picker.clr-open{display:flex}.clr-dark{background-color:#444}.clr-gradient{position:relative;width:100%;height:100px;margin-bottom:15px;border-radius:3px 3px 0 0;background-image:linear-gradient(rgba(0,0,0,0),#000),linear-gradient(90deg,#fff,currentColor);cursor:pointer}.clr-marker{position:absolute;width:12px;height:12px;margin:-6px 0 0 -6px;border:1px solid #fff;border-radius:50%;background-color:currentColor;cursor:pointer}.clr-picker input[type=range]::-webkit-slider-runnable-track{width:100%;height:8px}.clr-picker input[type=range]::-webkit-slider-thumb{width:8px;height:8px;-webkit-appearance:none}.clr-picker input[type=range]::-moz-range-track{width:100%;height:8px;border:0}.clr-picker input[type=range]::-moz-range-thumb{width:8px;height:8px;border:0}.clr-hue{background-image:linear-gradient(to right,red 0,#ff0 16.66%,#0f0 33.33%,#0ff 50%,#00f 66.66%,#f0f 83.33%,red 100%)}.clr-alpha,.clr-hue{position:relative;width:calc(100% - 40px);height:8px;margin:5px 20px;border-radius:4px}.clr-alpha span{display:block;height:100%;width:100%;border-radius:inherit;background-image:linear-gradient(90deg,rgba(0,0,0,0),currentColor)}.clr-alpha input,.clr-hue input{position:absolute;width:calc(100% + 16px);height:16px;left:-8px;top:-4px;margin:0;background-color:transparent;opacity:0;cursor:pointer;appearance:none;-webkit-appearance:none}.clr-alpha div,.clr-hue div{position:absolute;width:16px;height:16px;left:0;top:0;margin:-4px 0 0 -8px;border:2px solid #fff;border-radius:50%;background-color:currentColor;box-shadow:0 0 1px #888;pointer-events:none}.clr-alpha div:before{content:'';position:absolute;height:100%;width:100%;left:0;top:0;border-radius:50%;background-color:currentColor}.clr-swatches{order:2;width:calc(100% - 40px);margin:0 20px}.clr-swatches div{display:flex;flex-wrap:wrap;padding-bottom:12px;justify-content:center}.clr-swatches button{position:relative;width:20px;height:20px;margin:0 8px 6px 0;border:0;border-radius:50%;color:inherit;text-indent:-1000px;white-space:nowrap;overflow:hidden;cursor:pointer}.clr-swatches button:last-child,.clr-swatches button:nth-child(6n){margin-right:0}.clr-swatches button:after{content:'';display:block;position:absolute;width:100%;height:100%;left:0;top:0;border-radius:inherit;background-color:currentColor;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.clr-dark .clr-swatches button:after{box-shadow:inset 0 0 0 1px rgba(255,255,255,.3)}input.clr-color{order:1;width:120px;height:32px;margin:15px 20px 15px 0;padding:0 15px;border:1px solid #ddd;border-radius:16px;color:#444;background-color:#fff;font-family:sans-serif;font-size:14px;text-align:left;box-shadow:none}.clr-dark input.clr-color{color:#fff;border-color:#777;background-color:#555}input.clr-color:focus{outline:0;border:1px solid #aaa}.clr-preview{position:relative;width:32px;height:32px;margin:15px 0 20px 20px;border:0;border-radius:50%;overflow:hidden;cursor:pointer}.clr-preview:after,.clr-preview:before{content:'';position:absolute;height:100%;width:100%;left:0;top:0;border:1px solid #fff;border-radius:50%}.clr-preview:after{border:0;background-color:currentColor;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1)}.clr-dark .clr-preview:after{box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}.clr-alpha div,.clr-color,.clr-hue div,.clr-marker{box-sizing:border-box}.clr-field{display:inline-block;position:relative;color:#000}.clr-field button{position:absolute;width:30px;height:100%;right:0;top:50%;transform:translateY(-50%);border:0;color:inherit;text-indent:-1000px;white-space:nowrap;overflow:hidden;pointer-events:none}.clr-field button:after{content:'';display:block;position:absolute;width:100%;height:100%;left:0;top:0;border-radius:inherit;background-color:currentColor;box-shadow:inset 0 0 1px rgba(0,0,0,.5)}.clr-alpha,.clr-alpha div,.clr-field button,.clr-preview:before,.clr-swatches button{background-image:repeating-linear-gradient(45deg,#aaa 25%,transparent 25%,transparent 75%,#aaa 75%,#aaa),repeating-linear-gradient(45deg,#aaa 25%,#fff 25%,#fff 75%,#aaa 75%,#aaa);background-position:0 0,4px 4px;background-size:8px 8px}.clr-marker:focus{outline:0}.clr-keyboard-nav .clr-alpha input:focus+div,.clr-keyboard-nav .clr-hue input:focus+div,.clr-keyboard-nav .clr-marker:focus{outline:0;box-shadow:0 0 0 2px #1e90ff,0 0 2px 2px #fff}
|
1
admin/css/materialdesignicons.min.css
vendored
1
admin/css/materialdesignicons.min.css
vendored
File diff suppressed because one or more lines are too long
4538
admin/css/style.min.css
vendored
4538
admin/css/style.min.css
vendored
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 2.1 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,4 +1,5 @@
|
||||
<script language="javascript">
|
||||
|
||||
function loginout(){
|
||||
if( confirm("你确实要退出吗?")){
|
||||
window.parent.location.href="login.php?logout";
|
||||
@ -8,10 +9,10 @@ return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
|
||||
<script type="text/javascript" src="js/main.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/perfect-scrollbar.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/main.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
<?php $DB->close(); ?>
|
@ -173,9 +173,9 @@ else {
|
||||
}
|
||||
include './footer.php';
|
||||
?>
|
||||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.1.1/layer.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="js/lightyear.js"></script>
|
||||
<script src="js/bootstrap-notify.min.js"></script>
|
||||
<link href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="js/group.js"></script>
|
||||
<script src="/assets/admin/js/layer.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/lightyear.js"></script>
|
||||
<script src="/assets/admin/js/bootstrap-notify.min.js"></script>
|
||||
<link href="/assets/admin/js/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="/assets/admin/js/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/group.js"></script>
|
@ -1,21 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 14:16:13
|
||||
* @FilePath: /lylme_spage/admin/head.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
include_once("../include/common.php");
|
||||
if(isset($islogin) == 1) {
|
||||
if (isset($islogin) == 1) {
|
||||
} else {
|
||||
exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title><?php echo $title . ' - ' . $conf['title'];?></title>
|
||||
<link rel="icon" href="/assets/img/logo.png" type="image/ico">
|
||||
<meta name="author" content="yinqi">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/materialdesignicons.min.css" rel="stylesheet">
|
||||
<link href="css/style.min.css" rel="stylesheet">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title><?php echo $title . ' - ' . $conf['title']; ?></title>
|
||||
<link rel="icon" href="/assets/img/logo.png" type="image/ico">
|
||||
<meta name="author" content="yinqi">
|
||||
<link href="/assets/admin/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/assets/admin/css/materialdesignicons.min.css" rel="stylesheet">
|
||||
<link href="/assets/admin/css/style.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<div class="lyear-layout-web">
|
||||
<div class="lyear-layout-container">
|
||||
@ -23,7 +33,7 @@ if(isset($islogin) == 1) {
|
||||
<aside class="lyear-layout-sidebar">
|
||||
<!-- logo -->
|
||||
<div id="logo" class="sidebar-header">
|
||||
<a href="/"><img src="/assets/img/logo-sidebar.png" alt="LyLme" title="返回首页" /></a>
|
||||
<a href="/"><img src="/assets/img/logo-sidebar.png" alt="LyLme" title="返回首页" /></a>
|
||||
</div>
|
||||
<div class="lyear-layout-sidebar-scroll">
|
||||
<nav class="sidebar-main">
|
||||
@ -33,20 +43,19 @@ if(isset($islogin) == 1) {
|
||||
<a href="javascript:void(0)"><i class="mdi mdi-palette"></i>网站配置</a>
|
||||
<ul class="nav nav-subnav">
|
||||
<li> <a href="./set.php">网站基本设置</a> </li>
|
||||
<li> <a href="./theme.php">网站主题设置</a> </li>
|
||||
<li> <a href="./about.php">关于页面设置</a> </li>
|
||||
<li> <a href="./user.php">修改账号密码</a> </li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item active"> <a href="./apply.php"><i class="mdi mdi-link"></i>收录管理 </a>
|
||||
<?php $applyrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_apply` WHERE `apply_status` = 0"));
|
||||
if($applyrows > 0) {
|
||||
echo'<style> .applyrow{width: 18px;height: 18px;top: 15px;right: 24px;font-size: 10px;font-weight: bold;color: #fff;background-color: red;border-radius: 100%;text-align: center;vertical-align: middle;position: absolute;line-height: 1.5;}</style>
|
||||
<?php $applyrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_apply` WHERE `apply_status` = 0"));
|
||||
if ($applyrows > 0) {
|
||||
echo '<style> .applyrow{width: 18px;height: 18px;top: 15px;right: 24px;font-size: 10px;font-weight: bold;color: #fff;background-color: red;border-radius: 100%;text-align: center;vertical-align: middle;position: absolute;line-height: 1.5;}</style>
|
||||
<div class="applyrow">' . $applyrows . '</div>';
|
||||
}
|
||||
?></li>
|
||||
<li class="nav-item nav-item-has-subnav">
|
||||
}
|
||||
?></li>
|
||||
<li class="nav-item active"> <a href="./theme.php"><i class="mdi mdi-seal"></i>主题设置</a></li>
|
||||
<li class="nav-item active"> <a href="./group.php"><i class="mdi mdi-folder"></i>分组管理</a></li>
|
||||
<li class="nav-item active"> <a href="./link.php"><i class="mdi mdi-web"></i>链接管理</a></li>
|
||||
<li class="nav-item active"> <a href="./tag.php"><i class="mdi mdi-cube"></i>导航菜单</a></li>
|
||||
@ -55,12 +64,12 @@ if($applyrows > 0) {
|
||||
<li class="nav-item active"> <a href="./update.php"><i class="mdi mdi-update"></i>检查更新</a> </li>
|
||||
<li class="nav-item active"> <a href="./wxplus.php"><i class="mdi mdi-wechat"></i>微信推送</a> </li>
|
||||
<li> <a href="javascript:loginout()"><i class="mdi mdi-logout"></i> 退出登录</a> </li>
|
||||
</ul>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="sidebar-footer">
|
||||
<p class="copyright">Copyright ©
|
||||
<?php echo(date('Y'));
|
||||
?> Powered by <br> <a href="https://gitee.com/LyLme/lylme_spage"><?php echo explode("-", $conf['title'])[0];?> </a></p>
|
||||
<?php echo (date('Y'));
|
||||
?> Powered by <br> <a href="https://github.com/LyLme/lylme_spage"><?php echo explode("-", $conf['title'])[0]; ?> </a></p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
@ -76,13 +85,13 @@ if($applyrows > 0) {
|
||||
<span class="lyear-toggler-bar"></span>
|
||||
</div>
|
||||
<span class="navbar-page-title"> <?php echo $title;
|
||||
?></span>
|
||||
?></span>
|
||||
</div>
|
||||
<ul class="topbar-right">
|
||||
<li class="dropdown dropdown-profile">
|
||||
<a href="javascript:void(0)" data-toggle="dropdown">
|
||||
<span><?php echo $conf['admin_user'];
|
||||
?><span class="caret"></span></span>
|
||||
?><span class="caret"></span></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li> <a href="./user.php"><i class="mdi mdi-lock-outline"></i> 修改密码</a> </li>
|
||||
@ -91,12 +100,14 @@ if($applyrows > 0) {
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown dropdown-skin">
|
||||
<span data-toggle="dropdown" class="icon-palette" aria-expanded="false"><i class="mdi mdi-palette"></i></span>
|
||||
<ul class="dropdown-menu dropdown-menu-right" data-stoppropagation="true">
|
||||
<li class="drop-title"><p>主题</p></li>
|
||||
<span data-toggle="dropdown" class="icon-palette" aria-expanded="false"><i class="mdi mdi-palette"></i></span>
|
||||
<ul class="dropdown-menu dropdown-menu-right" data-stoppropagation="true">
|
||||
<li class="drop-title">
|
||||
<p>主题</p>
|
||||
</li>
|
||||
<li class="drop-skin-li clearfix">
|
||||
<span class="inverse">
|
||||
<input type="radio" name="site_theme" value="default" id="site_theme_1" >
|
||||
<input type="radio" name="site_theme" value="default" id="site_theme_1">
|
||||
<label for="site_theme_1" onclick="theme('default')"></label>
|
||||
</span>
|
||||
<span>
|
||||
@ -105,24 +116,23 @@ if($applyrows > 0) {
|
||||
</span>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<script>
|
||||
function theme(theme){
|
||||
localStorage.setItem("theme", theme);
|
||||
}
|
||||
var themes = localStorage.getItem("theme");
|
||||
if(themes != "dark"){
|
||||
var themes = 'default';
|
||||
document.getElementById('site_theme_1').checked = true;
|
||||
}
|
||||
else{
|
||||
document.getElementById('site_theme_2').checked = true;
|
||||
}
|
||||
document.write('<body data-theme="'+themes+'">');
|
||||
function theme(theme) {
|
||||
localStorage.setItem("theme", theme);
|
||||
}
|
||||
var themes = localStorage.getItem("theme");
|
||||
if (themes != "dark") {
|
||||
var themes = 'default';
|
||||
document.getElementById('site_theme_1').checked = true;
|
||||
} else {
|
||||
document.getElementById('site_theme_2').checked = true;
|
||||
}
|
||||
document.write('<body data-theme="' + themes + '">');
|
||||
</script>
|
||||
<!--End 头部信息-->
|
@ -1,4 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 后台首页
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-09 02:09:02
|
||||
* @FilePath: /lylme_spage/admin/index.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '后台管理';
|
||||
include './head.php';
|
||||
$last = date("Ym");
|
||||
@ -177,7 +186,7 @@ if (!empty($update)) {
|
||||
include './footer.php';
|
||||
?>
|
||||
<!--图表插件-->
|
||||
<script type="text/javascript" src="js/Chart.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/Chart.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(e) {
|
||||
var $dashChartBarsCnt = jQuery('.js-chartjs-bars')[0].getContext('2d'),
|
||||
|
18962
admin/js/Chart.js
vendored
18962
admin/js/Chart.js
vendored
File diff suppressed because it is too large
Load Diff
2
admin/js/bootstrap-notify.min.js
vendored
2
admin/js/bootstrap-notify.min.js
vendored
File diff suppressed because one or more lines are too long
7
admin/js/bootstrap.min.js
vendored
7
admin/js/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
6
admin/js/coloris.min.js
vendored
6
admin/js/coloris.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,146 +0,0 @@
|
||||
function listTable(query){
|
||||
var url = window.document.location.href.toString();
|
||||
var queryString = url.split("?")[1];
|
||||
query = query || queryString;
|
||||
layer.closeAll();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'table_group.php?'+query,
|
||||
dataType : 'html',
|
||||
cache : false,
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
$("#listTable").html(data);
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//载入页面
|
||||
$(document).ready(function(){
|
||||
if($("#listTable").length>0){
|
||||
listTable()
|
||||
}
|
||||
});
|
||||
$(document).on('click', '.sort-up', function(){
|
||||
//上移
|
||||
if($(this).parents('tr').prevAll().length > 0){
|
||||
$(this).parents('tr').prev().before($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
}).on('click', '.sort-down', function(){
|
||||
//下移
|
||||
if($(this).parents('tr').nextAll().length > 0){
|
||||
$(this).parents('tr').next().after($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
});
|
||||
//保存排序
|
||||
function save_order(){
|
||||
var groups =[];
|
||||
var $inputArr = $('input[name="group_id"]');
|
||||
$inputArr.each(function(){
|
||||
groups.push($(this).val());
|
||||
});
|
||||
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"group.php?set=sort",
|
||||
method:"POST",
|
||||
data:{groups:groups},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//启用分组
|
||||
function on_group(id){
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"group.php?set=on",
|
||||
method:"POST",
|
||||
data:{group_id:id},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//禁用分组
|
||||
function off_group(id){
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"group.php?set=off",
|
||||
method:"POST",
|
||||
data:{group_id:id},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//删除分组
|
||||
function del_group(id) {
|
||||
$.confirm({
|
||||
title: '警告',
|
||||
content: '删除分组会<b>同时删除该分组下的所有链接</b>,该操作不可逆!<br><font color="red">是否继续?</font>',
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
buttons: {
|
||||
tryAgain: {
|
||||
text: '确定',
|
||||
btnClass: 'btn-red',
|
||||
action: function(){
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"group.php?set=del",
|
||||
method:"POST",
|
||||
data:{
|
||||
group_id:id
|
||||
},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
close: {
|
||||
text: '取消'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
3
admin/js/jquery.dragsort-0.5.2.min.js
vendored
3
admin/js/jquery.dragsort-0.5.2.min.js
vendored
File diff suppressed because one or more lines are too long
4
admin/js/jquery.min.js
vendored
4
admin/js/jquery.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,88 +0,0 @@
|
||||
var lightyear = function(){
|
||||
|
||||
/**
|
||||
* 页面loading
|
||||
*/
|
||||
var pageLoader = function($mode) {
|
||||
var $loadingEl = jQuery('#lyear-loading');
|
||||
$mode = $mode || 'show';
|
||||
if ($mode === 'show') {
|
||||
if ($loadingEl.length) {
|
||||
$loadingEl.fadeIn(250);
|
||||
} else {
|
||||
jQuery('body').prepend('<div id="lyear-loading"><div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span></div></div>');
|
||||
}
|
||||
} else if ($mode === 'hide') {
|
||||
if ($loadingEl.length) {
|
||||
$loadingEl.fadeOut(250);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* 页面小提示
|
||||
* @param $msg 提示信息
|
||||
* @param $type 提示类型:'info', 'success', 'warning', 'danger'
|
||||
* @param $delay 毫秒数,例如:1000
|
||||
* @param $icon 图标,例如:'fa fa-user' 或 'glyphicon glyphicon-warning-sign'
|
||||
* @param $from 'top' 或 'bottom'
|
||||
* @param $align 'left', 'right', 'center'
|
||||
* @param $url 跳转链接 例如: https://www.xxxx.com
|
||||
* @author CaiWeiMing <314013107@qq.com>
|
||||
*/
|
||||
var tips = function ($msg, $type, $delay, $icon, $from, $align, $url) {
|
||||
$type = $type || 'info';
|
||||
$delay = $delay || 1000;
|
||||
$from = $from || 'top';
|
||||
$align = $align || 'center';
|
||||
$enter = $type == 'danger' ? 'animated shake' : 'animated fadeInUp';
|
||||
$url = $url || url;
|
||||
jQuery.notify({
|
||||
icon: $icon,
|
||||
message: $msg
|
||||
},
|
||||
{
|
||||
element: 'body',
|
||||
type: $type,
|
||||
allow_dismiss: true,
|
||||
newest_on_top: true,
|
||||
showProgressbar: false,
|
||||
placement: {
|
||||
from: $from,
|
||||
align: $align
|
||||
},
|
||||
offset: 20,
|
||||
spacing: 10,
|
||||
z_index: 10800,
|
||||
delay: $delay,
|
||||
//timer: 1000,
|
||||
animate: {
|
||||
enter: $enter,
|
||||
exit: 'animated fadeOutDown'
|
||||
}
|
||||
});
|
||||
if($url!=''){
|
||||
setTimeout(function(){
|
||||
window.location.href=$url;
|
||||
},$delay);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var url = '';
|
||||
|
||||
return {
|
||||
// 页面小提示
|
||||
notify : function ($msg, $type, $delay, $icon, $from, $align, $url) {
|
||||
tips($msg, $type, $delay, $icon, $from, $align, $url);
|
||||
},
|
||||
url : function ($url){
|
||||
url=$url;
|
||||
},
|
||||
// 页面加载动画
|
||||
loading : function ($mode) {
|
||||
pageLoader($mode);
|
||||
}
|
||||
};
|
||||
}();
|
433
admin/js/link.js
433
admin/js/link.js
@ -1,433 +0,0 @@
|
||||
//请求页面
|
||||
function listTable(query){
|
||||
var url = window.document.location.href.toString();
|
||||
var queryString = url.split("?")[1];
|
||||
query = query || queryString;
|
||||
layer.closeAll();
|
||||
var ii = layer.load(2, {shade:[0.1,'#fff']});
|
||||
$.ajax({
|
||||
type : 'GET',
|
||||
url : 'table_link.php?'+query,
|
||||
dataType : 'html',
|
||||
cache : false,
|
||||
success : function(data) {
|
||||
layer.close(ii);
|
||||
$("#listTable").html(data);
|
||||
$("#link").dragsort({
|
||||
dragBetween: true,
|
||||
dragSelector: "td.lylme",
|
||||
dragEnd: showbutton,
|
||||
placeHolderTemplate: "<tr></tr>",
|
||||
});
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//载入页面
|
||||
$(document).ready(function(){
|
||||
if($("#listTable").length>0){
|
||||
listTable()
|
||||
}
|
||||
});
|
||||
|
||||
//获取选中
|
||||
function get_check(){
|
||||
var chk_value =[];
|
||||
$('input[name="link-check"]:checked').each(function(){
|
||||
chk_value.push($(this).val());
|
||||
});
|
||||
return chk_value;
|
||||
}
|
||||
|
||||
//多选启用
|
||||
function on_link(){
|
||||
if(get_check().length == 0){
|
||||
$.alert("未选择链接");
|
||||
return false;
|
||||
}
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=on",
|
||||
method:"POST",
|
||||
data:{links:get_check()},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//多选禁用
|
||||
function off_link(){
|
||||
if(get_check().length == 0){
|
||||
$.alert("未选择链接");
|
||||
return false;
|
||||
}
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=off",
|
||||
method:"POST",
|
||||
data:{links:get_check()},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//获取网站信息
|
||||
function geturl(){
|
||||
var url = $("input[name=\'url\']").val();
|
||||
if(!url){
|
||||
layer.msg('链接地址不能为空');
|
||||
return false;
|
||||
}
|
||||
$('#loading').css("display","flex");
|
||||
if (!/^http[s]?:\/\/+/.test(url)&&url!="") {
|
||||
var url = "http://"+url;
|
||||
$("input[name=\'url\']").val(url);
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=geturl",
|
||||
type:"GET",
|
||||
dataType:"json",
|
||||
data:{url:url},
|
||||
success:function(data){
|
||||
$("input[name=\'name\']").val(data.title);
|
||||
if(!data.title && !data.icon){
|
||||
layer.msg('获取失败,请手动填写');
|
||||
}
|
||||
else if(!data.icon){
|
||||
layer.msg('未获取到网站图标');
|
||||
}
|
||||
layer.msg('正则抓取目标网站图标...');
|
||||
downloadimg(data.icon,url);
|
||||
$('#loading').css("display","none");
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('获取失败,目标网站无法访问或防火墙限制!');
|
||||
$('#loading').css("display","none");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//抓取网站图标
|
||||
function downloadimg(url,referer){
|
||||
$.ajax({
|
||||
url:"/include/file.php",
|
||||
type:"POST",
|
||||
dataType:"json",
|
||||
data:{url:url,referer:referer},
|
||||
success:function(data){
|
||||
if(data.code == '200'){
|
||||
layer.msg(data.msg);
|
||||
$("textarea[name=\'icon\']").val(data.url);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
layer.msg(data.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//上传图标
|
||||
function uploadimg(e) {
|
||||
var formData = new FormData();
|
||||
formData.append("file", $("#file")[0].files[0]);
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/include/file.php',
|
||||
data: formData,
|
||||
timeout: 20000,
|
||||
cache: false,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType:"JSON",
|
||||
success:function(data){
|
||||
if(data.code == '200'){
|
||||
layer.msg(data.msg);
|
||||
$("textarea[name=\'icon\']").val(data.url);
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
layer.msg(data.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
//多选删除
|
||||
function del_link(id){
|
||||
var link_id = [];
|
||||
link_id.push(id);
|
||||
link_id = id ? link_id :get_check();
|
||||
if(link_id.length == 0){
|
||||
$.alert("未选择链接");
|
||||
return false;
|
||||
}
|
||||
$.alert({
|
||||
title: '警告',
|
||||
content: '确定要删除吗?删除后不可恢复',
|
||||
buttons: {
|
||||
confirm: {
|
||||
text: '删除',
|
||||
btnClass: 'btn-danger',
|
||||
action: function(){
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=del",
|
||||
method:"POST",
|
||||
data:{
|
||||
links:link_id
|
||||
},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: '取消'
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//全选
|
||||
function check_all(){
|
||||
var ischecked = $("#check_all").prop('checked');
|
||||
if(ischecked == true){
|
||||
$('[name="link-check"]').prop('checked',true);
|
||||
}else{
|
||||
$('[name="link-check"]').prop('checked',false);
|
||||
}
|
||||
}
|
||||
|
||||
//拖拽排序
|
||||
$(document).ready(function(){
|
||||
$("#link").dragsort({ itemSelector: "tr",
|
||||
dragEnd: showbutton,
|
||||
dragBetween: true, dragSelector: "tr",placeHolderTemplate: "<tr></tr>" });
|
||||
});
|
||||
|
||||
//显示保存
|
||||
function showbutton() {
|
||||
$("#save_order").show();
|
||||
}
|
||||
|
||||
//保存拖拽排序
|
||||
function save_order(){
|
||||
var link_array =[];
|
||||
var $inputArr = $('input[name="link-check"]');
|
||||
$inputArr.each(function(){
|
||||
link_array.push($(this).val());
|
||||
});
|
||||
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=allorder",
|
||||
method:"POST",
|
||||
data:{link_array:link_array},
|
||||
success:function(data){
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//点击排序
|
||||
$(document).on('click', '.sort-up', function(){
|
||||
//上移一行
|
||||
if($(this).parents('tr').prevAll().length > 0){
|
||||
$(this).parents('tr').prev().before($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
}).on('click', '.sort-down', function(){
|
||||
//下移一行
|
||||
if($(this).parents('tr').nextAll().length > 0){
|
||||
$(this).parents('tr').next().after($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
}).on('click', '.sort-goup', function(){
|
||||
//移到顶部
|
||||
if($(this).parents('tr').prevAll().length > 0){
|
||||
$(this).parents('tbody').children("tr:first-child").before($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
}).on('click', '.sort-godown', function(){
|
||||
//移到底部
|
||||
if($(this).parents('tr').nextAll().length > 0){
|
||||
$(this).parents('tbody').children("tr:last-child").after($(this).parents('tr').prop('outerHTML'));
|
||||
$(this).parents('tr').remove();
|
||||
save_order();
|
||||
}
|
||||
})
|
||||
|
||||
//移到分组
|
||||
function edit_group(mv_group) {
|
||||
if(get_check().length == 0){
|
||||
$.alert("未选择链接");
|
||||
return false;
|
||||
}
|
||||
$.confirm({
|
||||
title: '移动分组',
|
||||
content: mv_group,
|
||||
buttons: {
|
||||
formSubmit: {
|
||||
text: '移动',
|
||||
btnClass: 'btn-blue',
|
||||
action: function () {
|
||||
var group_id = this.$content.find('.group_id').val();
|
||||
if(!group_id){
|
||||
$.alert('请选择要移动到的分组');
|
||||
return false;
|
||||
}
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=set_group",
|
||||
method:"POST",
|
||||
data:{links:get_check(),group_id:group_id},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: '取消'
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//链接加密
|
||||
function pwd_link(pwd_list) {
|
||||
if(get_check().length == 0){
|
||||
$.alert("未选择链接");
|
||||
return false;
|
||||
}
|
||||
$.confirm({
|
||||
title: '加密链接',
|
||||
content: pwd_list,
|
||||
buttons: {
|
||||
formSubmit: {
|
||||
text: '加密',
|
||||
btnClass: 'btn-blue',
|
||||
action: function () {
|
||||
var pwd_id = this.$content.find('.pwd_id').val();
|
||||
if(!pwd_id){
|
||||
$.alert('请选择添加到的加密组');
|
||||
return false;
|
||||
}
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=pwd_link",
|
||||
method:"POST",
|
||||
data:{links:get_check(),pwd_id:pwd_id},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('操作成功!', 'success', 1000);
|
||||
listTable();
|
||||
return true;
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
text: '取消'
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
//点击排序(弃用)
|
||||
// function sort(id,mod,gid){
|
||||
// lightyear.loading('show');
|
||||
// $.ajax({
|
||||
// url:"ajax_link.php?submit=order",
|
||||
// method:"POST",
|
||||
// data:{id:id,mod:mod,gid:gid},
|
||||
// success:function(data){
|
||||
// lightyear.loading('hide');
|
||||
// lightyear.notify('操作成功!', 'success', 1000);
|
||||
// listTable();
|
||||
// return true;
|
||||
// },
|
||||
// error:function(data){
|
||||
// layer.msg('服务器错误');
|
||||
// lightyear.loading('hide');
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
function pwd_links(){
|
||||
$.alert({
|
||||
title: '分组已加密',
|
||||
content: '当前分组已设置为加密,若想单独设置链接加密,请先删除该分组的加密',
|
||||
});
|
||||
}
|
||||
$(document).on('click', '.tips', function(){
|
||||
$.alert({
|
||||
title: '提示',
|
||||
content: '<hr><h4>拖动排序</h4><li>在电脑端可以拖拽链接的<b>名称</b>进行排序,拖拽完成后点击“保存排序”即可生效</li><hr><h4>链接加密</h4><li>加密后的链接地址在本页面显示为<font color="#f96197">粉色</font>,以便标识</li><li>加密分组后该分组下的链接单独设置的加密将失效,删除分组的加密后即可恢复</li><li><b>加密后链接只能使用密码登录后方可查看</b></li>',
|
||||
});
|
||||
});
|
161
admin/js/main.min.js
vendored
161
admin/js/main.min.js
vendored
@ -1,161 +0,0 @@
|
||||
;
|
||||
|
||||
jQuery( function() {
|
||||
$("body").on('click','[data-stopPropagation]',function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// 滚动条
|
||||
const ps = new PerfectScrollbar('.lyear-layout-sidebar-scroll', {
|
||||
swipeEasing: false,
|
||||
suppressScrollX: true
|
||||
});
|
||||
|
||||
// 侧边栏
|
||||
$(document).on('click', '.lyear-aside-toggler', function() {
|
||||
$('.lyear-layout-sidebar').toggleClass('lyear-aside-open');
|
||||
$("body").toggleClass('lyear-layout-sidebar-close');
|
||||
|
||||
if ($('.lyear-mask-modal').length == 0) {
|
||||
$('<div class="lyear-mask-modal"></div>').prependTo('body');
|
||||
} else {
|
||||
$( '.lyear-mask-modal' ).remove();
|
||||
}
|
||||
});
|
||||
|
||||
// 遮罩层
|
||||
$(document).on('click', '.lyear-mask-modal', function() {
|
||||
$( this ).remove();
|
||||
$('.lyear-layout-sidebar').toggleClass('lyear-aside-open');
|
||||
$('body').toggleClass('lyear-layout-sidebar-close');
|
||||
});
|
||||
|
||||
// 侧边栏导航
|
||||
$(document).on('click', '.nav-item-has-subnav > a', function() {
|
||||
$subnavToggle = jQuery( this );
|
||||
$navHasSubnav = $subnavToggle.parent();
|
||||
$topHasSubNav = $subnavToggle.parents('.nav-item-has-subnav').last();
|
||||
$subnav = $navHasSubnav.find('.nav-subnav').first();
|
||||
$viSubHeight = $navHasSubnav.siblings().find('.nav-subnav:visible').outerHeight();
|
||||
$scrollBox = $('.lyear-layout-sidebar-scroll');
|
||||
$navHasSubnav.siblings().find('.nav-subnav:visible').slideUp(500).parent().removeClass('open');
|
||||
$subnav.slideToggle( 300, function() {
|
||||
$navHasSubnav.toggleClass( 'open' );
|
||||
|
||||
// 新增滚动条处理
|
||||
var scrollHeight = 0;
|
||||
pervTotal = $topHasSubNav.prevAll().length,
|
||||
boxHeight = $scrollBox.outerHeight(),
|
||||
innerHeight = $('.sidebar-main').outerHeight(),
|
||||
thisScroll = $scrollBox.scrollTop(),
|
||||
thisSubHeight = $(this).outerHeight(),
|
||||
footHeight = 121;
|
||||
|
||||
if (footHeight + innerHeight - boxHeight >= (pervTotal * 48)) {
|
||||
scrollHeight = pervTotal * 48;
|
||||
}
|
||||
if ($subnavToggle.parents('.nav-item-has-subnav').length == 1) {
|
||||
$scrollBox.animate({scrollTop: scrollHeight}, 300);
|
||||
} else {
|
||||
// 子菜单操作
|
||||
if (typeof($viSubHeight) != 'undefined' && $viSubHeight != null) {
|
||||
scrollHeight = thisScroll + thisSubHeight - $viSubHeight;
|
||||
$scrollBox.animate({scrollTop: scrollHeight}, 300);
|
||||
} else {
|
||||
if ((thisScroll + boxHeight - $scrollBox[0].scrollHeight) == 0) {
|
||||
scrollHeight = thisScroll - thisSubHeight;
|
||||
$scrollBox.animate({scrollTop: scrollHeight}, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 提示
|
||||
if($('[data-toggle="tooltip"]')[0]) {
|
||||
$('[data-toggle="tooltip"]').tooltip({
|
||||
"container" : 'body',
|
||||
});
|
||||
}
|
||||
|
||||
// 弹出框
|
||||
if($('[data-toggle="popover"]')[0]) {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
}
|
||||
|
||||
// 标签
|
||||
$('.js-tags-input').each(function() {
|
||||
var $this = $(this);
|
||||
$this.tagsInput({
|
||||
height: $this.data('height') ? $this.data('height') : '38px',
|
||||
width: '100%',
|
||||
defaultText: $this.attr("placeholder"),
|
||||
removeWithBackspace: true,
|
||||
delimiter: [',']
|
||||
});
|
||||
});
|
||||
|
||||
// 时间选择
|
||||
jQuery('.js-datetimepicker').each(function() {
|
||||
var $input = jQuery(this);
|
||||
$input.datetimepicker({
|
||||
format: $input.data('format') ? $input.data('format') : false,
|
||||
useCurrent: $input.data('use-current') ? $input.data('use-current') : false,
|
||||
locale: moment.locale('' + ($input.data('locale') ? $input.data('locale') : '') + ''),
|
||||
showTodayButton: $input.data('show-today-button') ? $input.data('show-today-button') : false,
|
||||
showClear: $input.data('show-clear') ? $input.data('show-clear') : false,
|
||||
showClose: $input.data('show-close') ? $input.data('show-close') : false,
|
||||
sideBySide: $input.data('side-by-side') ? $input.data('side-by-side') : false,
|
||||
inline: $input.data('inline') ? $input.data('inline') : false,
|
||||
});
|
||||
});
|
||||
|
||||
// 日期选择
|
||||
jQuery('.js-datepicker').each(function() {
|
||||
var options = {
|
||||
weekStart: 1,
|
||||
autoclose: typeof($(this).data('auto-close')) != 'undefined' ? $(this).data('auto-close') : true,
|
||||
language: 'zh-CN', // 默认简体中文
|
||||
multidateSeparator: ', ', // 默认多个日期用,分隔
|
||||
format: $(this).data('date-format') ? $(this).data('date-format') : 'yyyy-mm-dd',
|
||||
};
|
||||
|
||||
if ( $(this).prop("tagName") != 'INPUT' ) {
|
||||
options.inputs = [$(this).find('input:first'), $(this).find('input:last')];
|
||||
}
|
||||
|
||||
$(this).datepicker(options);
|
||||
});
|
||||
|
||||
// 颜色选取
|
||||
jQuery('.js-colorpicker').each(function() {
|
||||
var $colorpicker = jQuery(this);
|
||||
var $colorpickerMode = $colorpicker.data('colorpicker-mode') ? $colorpicker.data('colorpicker-mode') : 'hex';
|
||||
var $colorpickerinline = $colorpicker.data('colorpicker-inline') ? true: false;
|
||||
$colorpicker.colorpicker({
|
||||
'format': $colorpickerMode,
|
||||
'inline': $colorpickerinline
|
||||
});
|
||||
});
|
||||
|
||||
// 复选框全选
|
||||
$("#check-all").change(function () {
|
||||
if ($boxname = $(this).data('name')) {
|
||||
$(this).closest('table').find("input[name='" + $boxname + "']").prop('checked', $(this).prop("checked"));
|
||||
} else {
|
||||
$(this).closest('table').find(".lyear-checkbox input[type='checkbox']").prop('checked', $(this).prop("checked"));
|
||||
}
|
||||
});
|
||||
|
||||
// 设置主题配色
|
||||
setTheme = function(input_name, data_name) {
|
||||
$("input[name='"+input_name+"']").click(function(){
|
||||
$('body').attr(data_name, $(this).val());
|
||||
});
|
||||
}
|
||||
setTheme('site_theme', 'data-theme');
|
||||
setTheme('logo_bg', 'data-logobg');
|
||||
setTheme('header_bg', 'data-headerbg');
|
||||
setTheme('sidebar_bg', 'data-sidebarbg');
|
||||
|
||||
});
|
6
admin/js/perfect-scrollbar.min.js
vendored
6
admin/js/perfect-scrollbar.min.js
vendored
File diff suppressed because one or more lines are too long
298
admin/link.php
298
admin/link.php
@ -1,19 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-09 02:10:23
|
||||
* @FilePath: /lylme_spage/admin/link.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '链接管理';
|
||||
include './head.php';
|
||||
$grouplists = $DB->query("SELECT * FROM `lylme_groups`");
|
||||
$pwd_lists = $DB->query("SELECT * FROM `lylme_pwd`");
|
||||
?>
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'add') {
|
||||
echo '<h4>新增链接</h4>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'add') {
|
||||
echo '<h4>新增链接</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./link.php?set=add_submit" method="POST">
|
||||
<div class="form-group">
|
||||
@ -44,26 +53,26 @@ if ($set == 'add') {
|
||||
<div class="form-group">
|
||||
<label>*分组:</label><br>
|
||||
<select class="form-control" name="group_id">';
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['group_id']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '">' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select></div>
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['group_id']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '">' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select></div>
|
||||
<div class="form-group">
|
||||
<input type="submit" class="btn btn-primary btn-block" value="添加"></form>
|
||||
</div>
|
||||
<br/><a href="./link.php"><<返回</a>
|
||||
</div></div>';
|
||||
} elseif ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$row2 = $DB->query("select * from lylme_links where id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
preg_match_all('/<font color=[\"|\']+(.*?)[\"|\']>/i', $row['name'], $color);
|
||||
echo '<h4>修改链接信息</h4>
|
||||
} elseif ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$row2 = $DB->query("select * from lylme_links where id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
preg_match_all('/<font color=[\"|\']+(.*?)[\"|\']>/i', $row['name'], $color);
|
||||
echo '<h4>修改链接信息</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./link.php?set=edit_submit&id=' . $id . '" method="POST">
|
||||
<div class="form-group">
|
||||
@ -93,32 +102,32 @@ if ($set == 'add') {
|
||||
<div class="form-group">
|
||||
<label>*分组:</label><br>
|
||||
<select class="form-control" name="group_id">';
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['group_id']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '" ' . $select . '>' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select>
|
||||
while ($grouplist = $DB->fetch($grouplists)) {
|
||||
if ($grouplist["group_id"] == $row['group_id']) {
|
||||
$select = 'selected="selected"';
|
||||
} else {
|
||||
$select = '';
|
||||
}
|
||||
echo '<option value="' . $grouplist["group_id"] . '" ' . $select . '>' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}
|
||||
echo '</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>链接加密:</label><br>
|
||||
<select class="form-control" required name="link_pwd">';
|
||||
$pwd_lists = $DB->query("SELECT * FROM `lylme_pwd`");
|
||||
while ($pwd_list = $DB->fetch($pwd_lists)) {
|
||||
if($row['link_pwd'] == $pwd_list["pwd_id"]) {
|
||||
$sel = 'selected="selected"';
|
||||
} else {
|
||||
$sel = '';
|
||||
}
|
||||
echo '<option value="' . $pwd_list["pwd_id"] . '" ' . $sel . ' >' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . ' | 密码[' . $pwd_list["pwd_key"] . ']</option>';
|
||||
}
|
||||
if(empty($row['link_pwd'])) {
|
||||
$sele = 'selected="selected"';
|
||||
}
|
||||
echo '
|
||||
$pwd_lists = $DB->query("SELECT * FROM `lylme_pwd`");
|
||||
while ($pwd_list = $DB->fetch($pwd_lists)) {
|
||||
if ($row['link_pwd'] == $pwd_list["pwd_id"]) {
|
||||
$sel = 'selected="selected"';
|
||||
} else {
|
||||
$sel = '';
|
||||
}
|
||||
echo '<option value="' . $pwd_list["pwd_id"] . '" ' . $sel . ' >' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . ' | 密码[' . $pwd_list["pwd_key"] . ']</option>';
|
||||
}
|
||||
if (empty($row['link_pwd'])) {
|
||||
$sele = 'selected="selected"';
|
||||
}
|
||||
echo '
|
||||
<option value="0" ' . $sele . '>0 - 不加密</option></select>
|
||||
<small class="help-block"><code>注意:对链接所在的分组加密后,单独设置的链接加密将会失效</code><br>
|
||||
加密后只能通过输入密码访问,使用该功能先配置加密组
|
||||
@ -130,64 +139,64 @@ if ($set == 'add') {
|
||||
<br/><a href="./link.php"><<返回</a>
|
||||
</div></div>
|
||||
';
|
||||
} elseif ($set == 'add_submit') {
|
||||
$color = $_POST['color'];
|
||||
$name = $_POST['name'];
|
||||
if(empty($color)) {
|
||||
$name1 = $name;
|
||||
} else {
|
||||
$name1 = '<font color="' . $color . '">' . $name . '</font>';
|
||||
}
|
||||
$url = $_POST['url'];
|
||||
$icon = $_POST['icon'];
|
||||
$group_id = $_POST['group_id'];
|
||||
$link_order = $linksrows + 1;
|
||||
if ($name == null or $url == null) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name1 . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $name . "', '" . $link_order . "');";
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("添加链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("添加链接失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_links where id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if (!$rows) {
|
||||
exit('<script>alert("当前记录不存在!");history.go(-1);</script>');
|
||||
}
|
||||
$color = $_POST['color'];
|
||||
$name = $_POST['name'];
|
||||
if(empty($color)) {
|
||||
$name1 = $name;
|
||||
} else {
|
||||
$name1 = '<font color="' . $color . '">' . $name . '</font>';
|
||||
}
|
||||
$url = $_POST['url'];
|
||||
$icon = $_POST['icon'];
|
||||
$link_pwd = $_POST['link_pwd'];
|
||||
$group_id = $_POST['group_id'];
|
||||
if ($name == null or $url == null) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "UPDATE `lylme_links` SET `name` = '" . $name1 . "', `url` = '" . $url . "', `icon` = '" . $icon . "', `group_id` = '" . $group_id . "', `link_pwd` = " . $link_pwd . " WHERE `lylme_links`.`id` = '" . $id . "';";
|
||||
// exit($sql);
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("修改链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("修改链接失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
// } elseif ($set == 'delete') {
|
||||
// $id = $_GET['id'];
|
||||
// $sql = "DELETE FROM lylme_links WHERE id='$id'";
|
||||
// if ($DB->query($sql)) echo '<script>alert("删除成功!");window.location.href="./link.php";</script>';
|
||||
// else echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
} else {
|
||||
echo '<div id="listTable"></div>
|
||||
} elseif ($set == 'add_submit') {
|
||||
$color = $_POST['color'];
|
||||
$name = $_POST['name'];
|
||||
if (empty($color)) {
|
||||
$name1 = $name;
|
||||
} else {
|
||||
$name1 = '<font color="' . $color . '">' . $name . '</font>';
|
||||
}
|
||||
$url = $_POST['url'];
|
||||
$icon = $_POST['icon'];
|
||||
$group_id = $_POST['group_id'];
|
||||
$link_order = $linksrows + 1;
|
||||
if ($name == null or $url == null) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "INSERT INTO `lylme_links` (`id`, `name`, `group_id`, `url`, `icon`, `link_desc`,`link_order`) VALUES (NULL, '" . $name1 . "', '" . $group_id . "', '" . $url . "', '" . $icon . "', '" . $name . "', '" . $link_order . "');";
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("添加链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("添加链接失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_links where id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if (!$rows) {
|
||||
exit('<script>alert("当前记录不存在!");history.go(-1);</script>');
|
||||
}
|
||||
$color = $_POST['color'];
|
||||
$name = $_POST['name'];
|
||||
if (empty($color)) {
|
||||
$name1 = $name;
|
||||
} else {
|
||||
$name1 = '<font color="' . $color . '">' . $name . '</font>';
|
||||
}
|
||||
$url = $_POST['url'];
|
||||
$icon = $_POST['icon'];
|
||||
$link_pwd = $_POST['link_pwd'];
|
||||
$group_id = $_POST['group_id'];
|
||||
if ($name == null or $url == null) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "UPDATE `lylme_links` SET `name` = '" . $name1 . "', `url` = '" . $url . "', `icon` = '" . $icon . "', `group_id` = '" . $group_id . "', `link_pwd` = " . $link_pwd . " WHERE `lylme_links`.`id` = '" . $id . "';";
|
||||
// exit($sql);
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("修改链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("修改链接失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
// } elseif ($set == 'delete') {
|
||||
// $id = $_GET['id'];
|
||||
// $sql = "DELETE FROM lylme_links WHERE id='$id'";
|
||||
// if ($DB->query($sql)) echo '<script>alert("删除成功!");window.location.href="./link.php";</script>';
|
||||
// else echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
} else {
|
||||
echo '<div id="listTable"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -195,40 +204,47 @@ if ($set == 'add') {
|
||||
</div>
|
||||
</main>
|
||||
';
|
||||
}
|
||||
include './footer.php';
|
||||
?>
|
||||
<script type="text/javascript" src="js/jquery.dragsort-0.5.2.min.js"></script>
|
||||
<link href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.1.1/layer.min.js" type="application/javascript"></script>
|
||||
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<!--选色器-->
|
||||
<link rel="stylesheet" type="text/css" href="css/coloris.min.css" />
|
||||
<script type="text/javascript" src="js/coloris.min.js"></script>
|
||||
<script type="text/javascript">Coloris( {
|
||||
el:'.coloris',swatches:['#000000','#555555','#666666','#264653','#2a9d8f','#f4a261','#e76f51','#ff0000','#d62828','#023e8a','#0077b6','#0096c7']
|
||||
});
|
||||
</script>
|
||||
<style>.clr-alpha {display: none !important;}</style>
|
||||
<script type="text/javascript">
|
||||
select_color();
|
||||
function select_color() {
|
||||
var fontcolor = $('input[name="color"]').val();
|
||||
$('#urlname').css("color",fontcolor);
|
||||
}
|
||||
</script>
|
||||
<!--选色器-->
|
||||
<!--消息提示-->
|
||||
<script src="js/bootstrap-notify.min.js"></script>
|
||||
<script type="text/javascript" src="js/lightyear.js"></script>
|
||||
<script type="text/javascript" src="js/link.js"></script>
|
||||
<script type="text/javascript">
|
||||
//分组移动
|
||||
var mv_group ='<form action="" class="formName">' + '<select class="form-control group_id" required><option value="">请选择分组...</option>'+'<?php while ($grouplist = $DB->fetch($grouplists)) {
|
||||
echo '<option value="' . $grouplist["group_id"] . '">' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
}?>'+ '</select>';
|
||||
//链接加密
|
||||
var pwd_list = '<form action="" class="formName">' + '<select class="form-control pwd_id" required>'+'<?php while ($pwd_list = $DB->fetch($pwd_lists)) {
|
||||
echo '<option value="' . $pwd_list["pwd_id"] . '">' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . '</option>';
|
||||
}?>'+ '<option value="0">0 - 取消加密</option></select><br><a href="./pwd.php" target="_blank">管理加密组</a>';
|
||||
</script>
|
||||
}
|
||||
include './footer.php';
|
||||
?>
|
||||
<script type="text/javascript" src="/assets/admin/js/jquery.dragsort-0.5.2.min.js"></script>
|
||||
<link href="/assets/admin/js/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="/assets/admin/js/layer.min.js" type="application/javascript"></script>
|
||||
<script src="/assets/admin/js/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<!--选色器-->
|
||||
<link rel="stylesheet" type="text/css" href="/assets/admin/css/coloris.min.css" />
|
||||
<script type="text/javascript" src="/assets/admin/js/coloris.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
Coloris({
|
||||
el: '.coloris',
|
||||
swatches: ['#000000', '#555555', '#666666', '#264653', '#2a9d8f', '#f4a261', '#e76f51', '#ff0000', '#d62828', '#023e8a', '#0077b6', '#0096c7']
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.clr-alpha {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
select_color();
|
||||
|
||||
function select_color() {
|
||||
var fontcolor = $('input[name="color"]').val();
|
||||
$('#urlname').css("color", fontcolor);
|
||||
}
|
||||
</script>
|
||||
<!--选色器-->
|
||||
<!--消息提示-->
|
||||
<script src="/assets/admin/js/bootstrap-notify.min.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/lightyear.js"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/link.js"></script>
|
||||
<script type="text/javascript">
|
||||
//分组移动
|
||||
var mv_group = '<form action="" class="formName">' + '<select class="form-control group_id" required><option value="">请选择分组...</option>' + '<?php while ($grouplist = $DB->fetch($grouplists)) {
|
||||
echo '<option value="' . $grouplist["group_id"] . '">' . $grouplist["group_id"] . ' - ' . $grouplist["group_name"] . '</option>';
|
||||
} ?>' + '</select>';
|
||||
//链接加密
|
||||
var pwd_list = '<form action="" class="formName">' + '<select class="form-control pwd_id" required>' + '<?php while ($pwd_list = $DB->fetch($pwd_lists)) {
|
||||
echo '<option value="' . $pwd_list["pwd_id"] . '">' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . '</option>';
|
||||
} ?>' + '<option value="0">0 - 取消加密</option></select><br><a href="./pwd.php" target="_blank">管理加密组</a>';
|
||||
</script>
|
225
admin/login.php
225
admin/login.php
@ -1,116 +1,153 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 后台登录页
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 02:19:49
|
||||
* @FilePath: /lylme_spage/admin/login.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
include("../include/common.php");
|
||||
if(isset($_POST['user']) && isset($_POST['pass'])) {
|
||||
$user = daddslashes($_POST['user']);
|
||||
$pass = md5('lylme' . daddslashes($_POST['pass']));
|
||||
if($user == $conf['admin_user'] && $pass == $conf['admin_pwd']) {
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
if (isset($_POST['user']) && isset($_POST['pass'])) {
|
||||
|
||||
if (isset($_REQUEST['authcode'])) {
|
||||
session_start();
|
||||
if (strtolower($_REQUEST['authcode']) == $_SESSION['authcode']) {
|
||||
$user = daddslashes($_POST['user']);
|
||||
$pass = md5('lylme' . daddslashes($_POST['pass']));
|
||||
if ($user == $conf['admin_user'] && $pass == $conf['admin_pwd']) {
|
||||
$session = md5($user . $pass);
|
||||
$token = authcode("{$user}\t{$session}", 'ENCODE', SYS_KEY);
|
||||
setcookie("admin_token", $token, time() + 604800);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
setcookie("admin_token", $token, time() + 604800, "/");
|
||||
exit("<script language='javascript'>alert('登陆管理中心成功!');window.location.href='./';</script>");
|
||||
} elseif ($pass != $conf['admin_pwd']) {
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
} elseif ($pass != $conf['admin_pwd']) {
|
||||
exit("<script language='javascript'>alert('用户名或密码不正确!');history.go(-1);</script>");
|
||||
}
|
||||
} else {
|
||||
exit("<script language='javascript'>alert('验证码错误');history.go(-1);</script>");
|
||||
}
|
||||
} elseif(isset($_GET['logout'])) {
|
||||
setcookie("admin_token", "", time() - 604800);
|
||||
@header('Content-Type: text/html; charset=UTF-8');
|
||||
exit("<script language='javascript'>alert('您已成功注销本次登陆!');window.location.href='./login.php';</script>");
|
||||
} elseif(isset($islogin) == 1) {
|
||||
exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>");
|
||||
}
|
||||
} elseif (isset($_GET['logout'])) {
|
||||
setcookie("admin_token", "", time() - 604800, "/");
|
||||
exit("<script language='javascript'>alert('您已成功注销本次登陆!');window.location.href='./login.php';</script>");
|
||||
} elseif (isset($islogin) == 1) {
|
||||
exit("<script language='javascript'>alert('您已登陆!');window.location.href='./';</script>");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title>后台登录 - <?php echo explode("-", $conf['title'])[0];?></title>
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="css/materialdesignicons.min.css" rel="stylesheet">
|
||||
<link href="css/style.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.lyear-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.lyear-login {
|
||||
display: flex !important;
|
||||
min-height: 100vh;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
.lyear-login:after{
|
||||
content: '';
|
||||
min-height: inherit;
|
||||
font-size: 0;
|
||||
}
|
||||
.login-center {
|
||||
background: #fff;
|
||||
min-width: 29.25rem;
|
||||
padding: 2.14286em 3.57143em;
|
||||
border-radius: 3px;
|
||||
margin: 2.85714em;
|
||||
}
|
||||
.login-header {
|
||||
margin-bottom: 1.5rem !important;
|
||||
}
|
||||
.login-center .has-feedback.feedback-left .form-control {
|
||||
padding-left: 38px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
.login-center .has-feedback.feedback-left .form-control-feedback {
|
||||
left: 0;
|
||||
right: auto;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
z-index: 4;
|
||||
color: #dcdcdc;
|
||||
}
|
||||
.login-center .has-feedback.feedback-left.row .form-control-feedback {
|
||||
left: 15px;
|
||||
}
|
||||
</style>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<title>后台登录 - <?php echo explode("-", $conf['title'])[0]; ?></title>
|
||||
<link href="../assets/admin/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="../assets/admin/css/materialdesignicons.min.css" rel="stylesheet">
|
||||
<link href="../assets/admin/css/style.min.css" rel="stylesheet">
|
||||
<style>
|
||||
.lyear-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.lyear-login {
|
||||
display: flex !important;
|
||||
min-height: 100vh;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.lyear-login:after {
|
||||
content: '';
|
||||
min-height: inherit;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.login-center {
|
||||
background: #fff;
|
||||
min-width: 29.25rem;
|
||||
padding: 2.14286em 3.57143em;
|
||||
border-radius: 3px;
|
||||
margin: 2.85714em;
|
||||
}
|
||||
|
||||
.login-header {
|
||||
margin-bottom: 1.5rem !important;
|
||||
}
|
||||
|
||||
.login-center .has-feedback.feedback-left .form-control {
|
||||
padding-left: 38px;
|
||||
padding-right: 12px;
|
||||
}
|
||||
|
||||
.login-center .has-feedback.feedback-left .form-control-feedback {
|
||||
left: 0;
|
||||
right: auto;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
z-index: 4;
|
||||
color: #dcdcdc;
|
||||
}
|
||||
|
||||
.login-center .has-feedback.feedback-left.row .form-control-feedback {
|
||||
left: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
if(!empty($background = background())) {
|
||||
<?php
|
||||
if (!empty($background = background())) {
|
||||
$background = str_replace('./', '../', $background);
|
||||
echo '<div class="row lylme-wrapper" style="background-image: url(' . $background . ');background-size: cover;">';
|
||||
}
|
||||
?>
|
||||
<div class="row lyear-wrapper">
|
||||
<div class="lyear-login">
|
||||
<div class="login-center">
|
||||
<div class="login-header text-center">
|
||||
<h2>后台登录</h2>
|
||||
}
|
||||
?>
|
||||
<div class="row lyear-wrapper">
|
||||
<div class="lyear-login">
|
||||
<div class="login-center">
|
||||
<div class="login-header text-center">
|
||||
<h2>后台登录</h2>
|
||||
</div>
|
||||
<form action="" method="post">
|
||||
<div class="form-group has-feedback feedback-left">
|
||||
<input type="text" placeholder="用户名" class="form-control" name="user" id="username" value="<?php echo $_POST['user'] ?>" />
|
||||
<span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
<div class="form-group has-feedback feedback-left">
|
||||
<input type="password" placeholder="密码" class="form-control" id="password" name="pass" value="" />
|
||||
<span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
|
||||
<div class="form-group has-feedback feedback-left row">
|
||||
<div class="col-xs-8">
|
||||
<input type="text" name="authcode" class="form-control" placeholder="验证码" required>
|
||||
<span class="mdi mdi-check form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<img id="captcha_img" title="验证码" src='../include/validatecode.php' class="pull-right code" onclick="recode()" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button class="btn btn-block btn-primary" type="submit" id="login">登录</button>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<footer class="col-sm-12 text-center">
|
||||
<p class="m-b-0">Copyright <?php echo (date('Y')); ?> <a href="/"><?php echo explode("-", $conf['title'])[0]; ?></a></p>
|
||||
</footer>
|
||||
</div>
|
||||
<form action="" method="post">
|
||||
<div class="form-group has-feedback feedback-left">
|
||||
<input type="text" placeholder="用户名" class="form-control" name="user" id="username" value="<?php echo @$_POST['user']?>"/>
|
||||
<span class="mdi mdi-account form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
<div class="form-group has-feedback feedback-left">
|
||||
<input type="password" placeholder="密码" class="form-control" id="password" name="pass" />
|
||||
<span class="mdi mdi-lock form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<button class="btn btn-block btn-primary" type="submit" id="login">登录</button>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
<footer class="col-sm-12 text-center">
|
||||
<p class="m-b-0">Copyright <?php echo(date('Y')); ?> <a href="/"><?php echo explode("-", $conf['title'])[0];?></a></p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript">;</script>
|
||||
<script type="text/javascript" src="../assets/admin/js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../assets/admin/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
function recode() {
|
||||
$('#captcha_img').attr('src', '../include/validatecode.php?r=' + Math.random());
|
||||
$("input[name=\'authcode\']").val('');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
168
admin/pwd.php
168
admin/pwd.php
@ -1,19 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-09 02:15:34
|
||||
* @FilePath: /lylme_spage/admin/pwd.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '加密组管理';
|
||||
include './head.php';
|
||||
?>
|
||||
<main class="lyear-layout-content">
|
||||
<main class="lyear-layout-content">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'add') {
|
||||
echo '<h4>新增加密组</h4>
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'add') {
|
||||
echo '<h4>新增加密组</h4>
|
||||
<div class="panel-body"><form action="./pwd.php?set=add_submit" method="POST">
|
||||
<div class="form-group">
|
||||
<label>*加密组名称:</label><br>
|
||||
@ -36,24 +45,24 @@ if ($set == 'add') {
|
||||
<br/><a href="./pwd.php"><<返回加密组列表</a>
|
||||
</div></div>
|
||||
';
|
||||
} elseif ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$pg = $DB->fetch($DB->query("SELECT * FROM `lylme_pwd` WHERE `pwd_id` = ".$id));
|
||||
echo '<h4>修改加密组信息</h4>
|
||||
} elseif ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
$pg = $DB->fetch($DB->query("SELECT * FROM `lylme_pwd` WHERE `pwd_id` = " . $id));
|
||||
echo '<h4>修改加密组信息</h4>
|
||||
<div class="panel-body"><form action="./pwd.php?set=edit_submit&id=' . $id . '" method="POST">
|
||||
<div class="form-group">
|
||||
<label>*加密组名称:</label><br>
|
||||
<input type="text" class="form-control" name="pwd_name" value="'.$pg['pwd_name'].'" required>
|
||||
<input type="text" class="form-control" name="pwd_name" value="' . $pg['pwd_name'] . '" required>
|
||||
<small class="help-block">加密组名称,如:<code>会员组</code></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>*加密组密码:</label><br>
|
||||
<input type="text" class="form-control" name="pwd_key" value="'.$pg['pwd_key'].'" required>
|
||||
<input type="text" class="form-control" name="pwd_key" value="' . $pg['pwd_key'] . '" required>
|
||||
<small class="help-block">加密组的密码(不超过20个字符)<br><code>提示:密码和其他加密组密码相同时,登录时显示同密码的所有加密链接</code></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>加密组备注:</label><br>
|
||||
<input type="text" class="form-control" name="pwd_ps" value="'.$pg['pwd_key'].'">
|
||||
<input type="text" class="form-control" name="pwd_ps" value="' . $pg['pwd_key'] . '">
|
||||
<small class="help-block">加密组备注,仅在后台显示(可不填)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -62,71 +71,76 @@ if ($set == 'add') {
|
||||
<br/><a href="./pwd.php"><<返回加密组列表</a>
|
||||
</div></div>
|
||||
';
|
||||
} elseif ($set == 'add_submit') {
|
||||
$pwd_name = $_POST['pwd_name'];
|
||||
$pwd_key = $_POST['pwd_key'];
|
||||
$pwd_ps = $_POST['pwd_ps'];
|
||||
if (empty($pwd_name) || empty($pwd_key)) {
|
||||
echo '<script>alert("失败,请确保带星号的项目都不为空!");history.go(-1);</script>';
|
||||
}else {
|
||||
$sql = "INSERT INTO `lylme_pwd` (`pwd_id`, `pwd_name`, `pwd_key`, `pwd_ps`) VALUES (NULL, '".$pwd_name."', '".$pwd_key."', '".$pwd_ps."');";
|
||||
if($DB->query($sql)) {
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
}
|
||||
else{
|
||||
echo '<script>alert("添加失败");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$pwd_name = $_POST['pwd_name'];
|
||||
$pwd_key = $_POST['pwd_key'];
|
||||
$pwd_ps = $_POST['pwd_ps'];
|
||||
if (empty($pwd_name) || empty($pwd_key)) {
|
||||
echo '<script>alert("失败,请确保带星号的项目都不为空!");history.go(-1);</script>';
|
||||
}else {
|
||||
$sql = "UPDATE `lylme_pwd` SET `pwd_name` = '".$pwd_name."', `pwd_key` = '".$pwd_key."', `pwd_ps` = '".$pwd_ps."' WHERE `lylme_pwd`.`pwd_id` = ".$id.";";
|
||||
if($DB->query($sql)) {
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
}
|
||||
else{
|
||||
echo '<script>alert("修改失败'.$sql.'");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'delete') {
|
||||
$id = $_GET['id'];
|
||||
$delsql = "DELETE FROM `lylme_pwd` WHERE `lylme_pwd`.`pwd_id` = ".$id;
|
||||
if ($DB->query($delsql)){
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
}else{
|
||||
echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
}
|
||||
} else {
|
||||
echo '<div class="alert alert-info"><h4>链接加密</h4><li>加密后的链接地址在本页面显示为<font color="#f96197">粉色</font>,以便标识</li><li>加密分组后该分组下的链接单独设置的加密将失效,删除分组的加密后即可恢复</li><li><b>加密后链接只能使用密码登录后方可查看</b></li><li>若多个加密组使用相同的密码,登录后会同时显示使用该密码的所有链接</li><li>默认登录地址:<code>'. siteurl().'/pwd</code>(可自行修改目录名更改)</li><br><a href="./pwd.php?set=add" class="btn btn-primary">新建加密</a></div>';
|
||||
} elseif ($set == 'add_submit') {
|
||||
$pwd_name = $_POST['pwd_name'];
|
||||
$pwd_key = $_POST['pwd_key'];
|
||||
$pwd_ps = $_POST['pwd_ps'];
|
||||
if (empty($pwd_name) || empty($pwd_key)) {
|
||||
echo '<script>alert("失败,请确保带星号的项目都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "INSERT INTO `lylme_pwd` (`pwd_id`, `pwd_name`, `pwd_key`, `pwd_ps`) VALUES (NULL, '" . $pwd_name . "', '" . $pwd_key . "', '" . $pwd_ps . "');";
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("添加失败");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$pwd_name = $_POST['pwd_name'];
|
||||
$pwd_key = $_POST['pwd_key'];
|
||||
$pwd_ps = $_POST['pwd_ps'];
|
||||
if (empty($pwd_name) || empty($pwd_key)) {
|
||||
echo '<script>alert("失败,请确保带星号的项目都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
$sql = "UPDATE `lylme_pwd` SET `pwd_name` = '" . $pwd_name . "', `pwd_key` = '" . $pwd_key . "', `pwd_ps` = '" . $pwd_ps . "' WHERE `lylme_pwd`.`pwd_id` = " . $id . ";";
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("修改失败' . $sql . '");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'delete') {
|
||||
$id = $_GET['id'];
|
||||
$delsql = "DELETE FROM `lylme_pwd` WHERE `lylme_pwd`.`pwd_id` = " . $id;
|
||||
if ($DB->query($delsql)) {
|
||||
echo '<script>window.location.href="./pwd.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
}
|
||||
} else {
|
||||
echo '<div class="alert alert-info"><h4>链接加密</h4><li>加密后的链接地址在本页面显示为<font color="#f96197">粉色</font>,以便标识</li><li>加密分组后该分组下的链接单独设置的加密将失效,删除分组的加密后即可恢复</li><li><b>加密后链接只能使用密码登录后方可查看</b></li><li>若多个加密组使用相同的密码,登录后会同时显示使用该密码的所有链接</li><li>默认登录地址:<code>' . siteurl() . '/pwd</code>(可自行修改目录名更改)</li><br><a href="./pwd.php?set=add" class="btn btn-primary">新建加密</a></div>';
|
||||
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead><tr><th>名称</th><th>密码</th><th>备注</th><th>操作</th></tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$pgs = $DB->query("SELECT * FROM `lylme_pwd`");
|
||||
while ($pg = $DB->fetch($pgs)) {
|
||||
echo '<tr><td>' . $pg['pwd_name'] . '</td>
|
||||
<td>' . $pg['pwd_key'] . '</td><td>' . $pg['pwd_ps'] . '</td><td> <a href="./pwd.php?set=edit&id=' . $pg['pwd_id'] . '" class="btn btn-info btn-xs">编辑</a> <a href="./pwd.php?set=delete&id=' . $pg['pwd_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'是否删除加密组 ' . $pg['pwd_name'] .'\');">删除</a> </td></tr>';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>密码</th>
|
||||
<th>备注</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$pgs = $DB->query("SELECT * FROM `lylme_pwd`");
|
||||
while ($pg = $DB->fetch($pgs)) {
|
||||
echo '<tr><td>' . $pg['pwd_name'] . '</td>
|
||||
<td>' . $pg['pwd_key'] . '</td><td>' . $pg['pwd_ps'] . '</td><td> <a href="./pwd.php?set=edit&id=' . $pg['pwd_id'] . '" class="btn btn-info btn-xs">编辑</a> <a href="./pwd.php?set=delete&id=' . $pg['pwd_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'是否删除加密组 ' . $pg['pwd_name'] . '\');">删除</a> </td></tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
}
|
||||
include './footer.php';
|
||||
}
|
||||
include './footer.php';
|
||||
?>
|
156
admin/set.php
156
admin/set.php
@ -1,58 +1,74 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 后台网站配置
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 14:08:30
|
||||
* @FilePath: /lylme_spage/admin/set.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '网站设置';
|
||||
include './head.php';
|
||||
$last = date("Ym");
|
||||
if (@file_get_contents('log.txt') != $last || !file_exists('cache.php')) {
|
||||
$update = update();
|
||||
file_put_contents('log.txt', $last);
|
||||
var_export($update, true);
|
||||
$content = "<?php\nreturn " . var_export($update, true) . "\n?>";
|
||||
file_put_contents('cache.php', $content);
|
||||
}
|
||||
function uploadimg($arr, $uppath, $uptype)
|
||||
{
|
||||
if ((($arr["type"] == "image/jpeg") || ($arr["type"] == "image/jpg") || ($arr["type"] == "image/png")) && $arr["size"] < 10485760) {
|
||||
copy($arr["tmp_name"], ROOT . $uppath);
|
||||
saveSetting($uptype, '/' . $uppath);
|
||||
} elseif ($arr["size"] == 0) {
|
||||
} else {
|
||||
echo '<script>alert("上传的图片大小超过10MB或类型不符!");history.go(-1);</script>';
|
||||
}
|
||||
if ((($arr["type"] == "image/jpeg") || ($arr["type"] == "image/jpg") || ($arr["type"] == "image/png")) && $arr["size"] < 10485760) {
|
||||
copy($arr["tmp_name"], ROOT . $uppath);
|
||||
saveSetting($uptype, '/' . $uppath);
|
||||
} elseif ($arr["size"] == 0) {
|
||||
} else {
|
||||
echo '<script>alert("上传的图片大小超过10MB或类型不符!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if ($set == 'save') {
|
||||
$title = $_POST['title'];
|
||||
$logo = $_POST['logo'];
|
||||
$background = $_POST['background'];
|
||||
$wapbackground = $_POST['wapbackground'];
|
||||
$keywords = $_POST['keywords'];
|
||||
$description = $_POST['description'];
|
||||
$copyright = $_POST['copyright'];
|
||||
$icp = $_POST['icp'];
|
||||
$yan = $_POST['yan'];
|
||||
$tq = $_POST['tq'];
|
||||
$wztj = $_POST['wztj'];
|
||||
$cdnpublic = $_POST['cdnpublic'];
|
||||
$home_title = $_POST['home-title'];
|
||||
if ($yan == 'true') {
|
||||
saveSetting('yan', 'true');
|
||||
} else {
|
||||
saveSetting('yan', 'false');
|
||||
}
|
||||
if ($tq == 'true') {
|
||||
saveSetting('tq', 'true');
|
||||
} else {
|
||||
saveSetting('tq', 'false');
|
||||
}
|
||||
saveSetting('title', $title);
|
||||
saveSetting('logo', $logo);
|
||||
saveSetting('background', $background);
|
||||
saveSetting('wap_background', $wapbackground);
|
||||
saveSetting('keywords', $keywords);
|
||||
saveSetting('description', $description);
|
||||
saveSetting('copyright', $copyright);
|
||||
saveSetting('icp', $icp);
|
||||
saveSetting('wztj', $wztj);
|
||||
saveSetting('cdnpublic', $cdnpublic);
|
||||
saveSetting('home-title', $home_title);
|
||||
uploadimg($_FILES["logoimg"], 'assets/img/web-logo.png', 'logo');
|
||||
uploadimg($_FILES["wapbackgroundimg"], 'assets/img/web-wapbackground.jpg', 'wap_background');
|
||||
uploadimg($_FILES["backgroundimg"], 'assets/img/web-background.jpg', 'background');
|
||||
echo '<script>alert("修改成功!");window.location.href="./set.php";</script>';
|
||||
$title = $_POST['title'];
|
||||
$logo = $_POST['logo'];
|
||||
$background = $_POST['background'];
|
||||
$wapbackground = $_POST['wapbackground'];
|
||||
$keywords = $_POST['keywords'];
|
||||
$description = $_POST['description'];
|
||||
$mode = $_POST['mode'];
|
||||
$snapshot = $_POST['snapshot'];
|
||||
$licensecode = $_POST['licensecode'];
|
||||
$copyright = $_POST['copyright'];
|
||||
$icp = $_POST['icp'];
|
||||
$yan = $_POST['yan'];
|
||||
$wztj = $_POST['wztj'];
|
||||
$cdnpublic = $_POST['cdnpublic'];
|
||||
if ($yan == 'true') {
|
||||
saveSetting('yan', 'true');
|
||||
} else {
|
||||
saveSetting('yan', 'false');
|
||||
}
|
||||
saveSetting('tq', 'false');
|
||||
saveSetting('title', $title, "网站名称");
|
||||
saveSetting('logo', $logo, "网站LOGO");
|
||||
saveSetting('background', $background, "背景图片");
|
||||
saveSetting('wap_background', $wapbackground, "手机背景图片");
|
||||
saveSetting('keywords', $keywords, "网站关键词");
|
||||
saveSetting('description', $description, "网站描述");
|
||||
saveSetting('mode', $mode, "网站运行模式");
|
||||
saveSetting('snapshot', $snapshot, "详情页快照API");
|
||||
saveSetting('copyright', $copyright, "底部版权");
|
||||
saveSetting('icp', $icp, "ICP备案号");
|
||||
saveSetting('wztj', $wztj, "自定义footer");
|
||||
saveSetting('cdnpublic', $cdnpublic, "CDN地址");
|
||||
saveSetting('c', $licensecode, "程序授权码");
|
||||
uploadimg($_FILES["logoimg"], 'assets/img/web-logo.png', 'logo');
|
||||
uploadimg($_FILES["wapbackgroundimg"], 'assets/img/web-wapbackground.jpg', 'wap_background');
|
||||
uploadimg($_FILES["backgroundimg"], 'assets/img/web-background.jpg', 'background');
|
||||
echo '<script>alert("修改成功!");window.location.href="./set.php";</script>';
|
||||
} else {
|
||||
?>
|
||||
?>
|
||||
<script>
|
||||
function updatetext(check) {
|
||||
document.getElementById(check).innerHTML = "重新选择";
|
||||
@ -91,7 +107,7 @@ if ($set == 'save') {
|
||||
<input type="file" style="display:none" accept="image/png,image/jpeg" id="backgroundimg" name="backgroundimg" onclick="updatetext('checkbackground');" />
|
||||
</div>
|
||||
</div>
|
||||
<small class="help-block">填写图片的URL:如<code>./assets/img/background.jpg</code>或<code><?php echo siteurl() ?>/assets/img/background.jpg</code>或从<code>本地上传</code><br>设置Bing每日壁纸:<a href="https://doc.lylme.com/spage/#/%E8%83%8C%E6%99%AF%E8%AE%BE%E7%BD%AE" target="_blank">查看教程</a><br>注:修改后需要清除浏览器缓存才会改变</small>
|
||||
<small class="help-block">填写图片的URL,如:<code>/assets/img/background.jpg</code>或从<code>本地上传</code><br>设置Bing每日壁纸:<code>/assets/img/bing.php</code><br>注:修改后需要清除浏览器缓存才会改变</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="wap_site_background">手机端背景图片</label>
|
||||
@ -111,22 +127,33 @@ if ($set == 'save') {
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="web_site_description">站点描述</label>
|
||||
<textarea class="form-control" id="web_site_description" rows="5" name="description" placeholder="请输入站点描述"><?php echo $conf['description'] ?></textarea>
|
||||
<small class="help-block">网站描述,有利于搜索引擎抓取相关信息</small>
|
||||
<textarea class="form-control" id="web_site_description" rows="2" name="description" placeholder="请输入站点描述"><?php echo $conf['description'] ?></textarea>
|
||||
<small class="help-block">网站描述,用于搜索引擎抓取相关信息</small>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="web_site_home-title">首页提示语</label>
|
||||
<textarea type="text" class="form-control" name="home-title" placeholder="请输入首页提示语,支持HTML代码"><?php echo $conf['home-title'] ?></textarea>
|
||||
<small class="help-block">首页提示语, 仅适用于部分主题<code>支持HTML代码</code></small>
|
||||
<label for="web_site_home-title">运行模式</label>
|
||||
<label class="lyear-radio radio-primary m-t-10">
|
||||
<input type="radio" <?php if (!$mode = $conf['mode'] == 2) echo 'checked="checked"'; ?> value="1" name="mode">
|
||||
<span>直接访问(默认)</span>
|
||||
</label>
|
||||
<label class="lyear-radio radio-primary m-t-10">
|
||||
<input type="radio" <?php if ($mode) echo 'checked="checked"'; ?> value="2" name="mode">
|
||||
<span>详情页模式</span>
|
||||
</label>
|
||||
|
||||
<small class="help-block">导航链接访问方式,详情页模式需要启用伪静态 <a href="https://doc.lylme.com/spage/#/urlwrite" target="_blank">查看教程</a></small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="web_site_copyright">版权信息</label>
|
||||
<textarea width="200px" type="text" rows="5" class="form-control" name="copyright" placeholder="请输入版权信息,支持HTML代码"><?php echo $conf['copyright'] ?></textarea>
|
||||
<textarea width="200px" type="text" rows="3" class="form-control" name="copyright" placeholder="请输入版权信息,支持HTML代码"><?php echo $conf['copyright'] ?></textarea>
|
||||
<small class="help-block">显示在首页底部的版权提示,<code>支持HTML代码</code></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="web_site_wztj">自定义footer</label>
|
||||
<textarea type="text" rows="5" class="form-control" name="wztj" placeholder="可填写网站统计、引用JS文件等"><?php echo $conf['wztj'] ?></textarea>
|
||||
<textarea type="text" rows="10" class="form-control" name="wztj" placeholder="可填写网站统计、引用JS文件等"><?php echo $conf['wztj'] ?></textarea>
|
||||
<small class="help-block">站点底部自定义,可填写网站统计、JS代码(需要script标签)、CSS代码(需要style标签)等<code>支持HTML代码</code> <a href="https://doc.lylme.com/spage/#/footer" target="_blank">查看教程</a></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -137,21 +164,22 @@ if ($set == 'save') {
|
||||
<label class="btn-block" for="web_yan_status">随机一言开关</label>
|
||||
<label class="lyear-switch switch-solid switch-cyan">
|
||||
<input type="checkbox" <?php if ($conf['yan'] != 'false') {
|
||||
echo 'checked="checked"';
|
||||
} ?> name="yan" value="true">
|
||||
echo 'checked="checked"';
|
||||
} ?> name="yan" value="true">
|
||||
<span></span>
|
||||
</label>
|
||||
<small class="help-block">显示在首页的随机一言,自定义一言文件路径,一行一条<code>/assets/date/date.dat</code> </small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="btn-block" for="web_tq_status">天气显示开关</label>
|
||||
<label class="lyear-switch switch-solid switch-primary">
|
||||
<input type="checkbox" <?php if ($conf['tq'] != 'false') {
|
||||
echo 'checked="checked"';
|
||||
} ?> name="tq" value="true">
|
||||
<span></span>
|
||||
</label>
|
||||
<small class="help-block">和风天气插件,若不能使用请申请自己的密钥填入,<a href="https://doc.lylme.com/spage/#/%E5%A4%A9%E6%B0%94" target="_blank">查看教程</a><br><code>注:baisu模板关闭后同时关闭时间显示</code> </small>
|
||||
<label for="web_site_snapshot">详情页快照生成API</label>
|
||||
<input class="form-control" type="text" id="web_site_snapshot" name="snapshot" value="<?php echo $conf['snapshot'] ?>" placeholder="请输入API接口地址">
|
||||
<small class="help-block">用于详情页生成网站缩略图,不填不启用,若不了解请留空 <a href="https://doc.lylme.com/spage/#/snapshot" target="_blank">查看教程</a></small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="web_site_licensecode">六零导航页授权密钥</label>
|
||||
<input class="form-control" type="text" id="web_site_licensecode" name="licensecode" value="<?php echo $conf['c'] ?>" placeholder="请输入授权密钥">
|
||||
<small class="help-block">微信关注【上云六零】公众号免费获取授权,授权后点击<a href="./update.php">检查更新</a>会自动下发授权密钥。<a href="https://doc.lylme.com/spage/#/license" target="_blank">查看说明</a> <br>内网用户需手动填入,当前域名:<code><?php echo $_SERVER['HTTP_HOST'] ?></code><br>授权正常请勿修改密钥</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary m-r-5">保 存</button>
|
||||
|
204
admin/sou.php
204
admin/sou.php
@ -3,20 +3,20 @@ $title = '搜索引擎设置';
|
||||
include './head.php';
|
||||
$sousrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_sou`"));
|
||||
?>
|
||||
<main class="lyear-layout-content">
|
||||
<main class="lyear-layout-content">
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php
|
||||
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
|
||||
if($set == 'add') {
|
||||
echo '<h4>新增搜索接</h4>
|
||||
if ($set == 'add') {
|
||||
echo '<h4>新增搜索接</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./sou.php?set=add_submit" method="POST">
|
||||
<div class="form-group">
|
||||
@ -67,12 +67,12 @@ if($set == 'add') {
|
||||
</div>
|
||||
<br/><a href="./sou.php"><<返回</a>
|
||||
</div></div>';
|
||||
} elseif($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
} elseif ($set == 'edit') {
|
||||
$id = $_GET['id'];
|
||||
|
||||
$row2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
echo '<h4>修改搜索引擎</h4>
|
||||
$row2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1");
|
||||
$row = $DB->fetch($row2);
|
||||
echo '<h4>修改搜索引擎</h4>
|
||||
<div class="panel-body">
|
||||
<form action="./sou.php?set=edit_submit&id=' . $id . '" method="POST">
|
||||
<div class="form-group">
|
||||
@ -119,10 +119,10 @@ if($set == 'add') {
|
||||
<label class="btn-block" for="web_tq_status">启用开关</label>
|
||||
<label class="lyear-switch switch-solid switch-primary">
|
||||
<input type="checkbox"';
|
||||
if($row['sou_st'] == 1) {
|
||||
echo 'checked="checked"';
|
||||
}
|
||||
echo 'name="st" value="true">
|
||||
if ($row['sou_st'] == 1) {
|
||||
echo 'checked="checked"';
|
||||
}
|
||||
echo 'name="st" value="true">
|
||||
<span></span>
|
||||
</label>
|
||||
<small class="help-block">说明:是否启用该搜索引擎(默认启用) </small>
|
||||
@ -132,112 +132,112 @@ if($set == 'add') {
|
||||
</div>
|
||||
<br/><a href="./sou.php"><<返回</a>
|
||||
</div></div>';
|
||||
} elseif($set == 'add_submit') {
|
||||
$name = $_POST['name'];
|
||||
$alias = $_POST['alias'];
|
||||
$hint = $_POST['hint'];
|
||||
$link = $_POST['link'];
|
||||
$waplink = $_POST['waplink'];
|
||||
$color = $_POST['color'];
|
||||
$icon = $_POST['icon'];
|
||||
if($_POST['st'] == true) {
|
||||
$st = 1;
|
||||
} else {
|
||||
$st = 0;
|
||||
}
|
||||
$sou_order = $sousrows + 1;
|
||||
} elseif ($set == 'add_submit') {
|
||||
$name = $_POST['name'];
|
||||
$alias = $_POST['alias'];
|
||||
$hint = $_POST['hint'];
|
||||
$link = $_POST['link'];
|
||||
$waplink = $_POST['waplink'];
|
||||
$color = $_POST['color'];
|
||||
$icon = $_POST['icon'];
|
||||
if ($_POST['st'] == true) {
|
||||
$st = 1;
|
||||
} else {
|
||||
$st = 0;
|
||||
}
|
||||
$sou_order = $sousrows + 1;
|
||||
|
||||
if (empty($name) && empty($alias) && empty($hint) && empty($link) && empty($color) && empty($icon)) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
if (empty($name) && empty($alias) && empty($hint) && empty($link) && empty($color) && empty($icon)) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
|
||||
$sql = "INSERT INTO `lylme_sou` (`sou_id`, `sou_alias`, `sou_name`, `sou_hint`, `sou_color`, `sou_link`, `sou_waplink`, `sou_icon`, `sou_st`, `sou_order`) VALUES
|
||||
$sql = "INSERT INTO `lylme_sou` (`sou_id`, `sou_alias`, `sou_name`, `sou_hint`, `sou_color`, `sou_link`, `sou_waplink`, `sou_icon`, `sou_st`, `sou_order`) VALUES
|
||||
(NULL, '" . $alias . "', '" . $name . "', '" . $hint . "', '" . $color . "', '" . $link . "', '" . $waplink . "', '" . $icon . "', '" . $st . "', '" . $sou_order . "');
|
||||
";
|
||||
|
||||
if($DB->query($sql)) {
|
||||
echo '<script>alert("添加搜索引擎 ' . $name . ' 成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("添加搜索引擎失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if(!$rows) {
|
||||
echo '<script>alert("当前记录不存在!");history.go(-1);</script>';
|
||||
}
|
||||
$name = $_POST['name'];
|
||||
$alias = $_POST['alias'];
|
||||
$hint = $_POST['hint'];
|
||||
$link = $_POST['link'];
|
||||
$waplink = $_POST['waplink'];
|
||||
$color = $_POST['color'];
|
||||
$icon = $_POST['icon'];
|
||||
$order = $_POST['order'];
|
||||
if($_POST['st'] == true) {
|
||||
$st = 1;
|
||||
} else {
|
||||
$st = 0;
|
||||
}
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("添加搜索引擎 ' . $name . ' 成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("添加搜索引擎失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'edit_submit') {
|
||||
$id = $_GET['id'];
|
||||
$rows2 = $DB->query("select * from lylme_sou where sou_id='$id' limit 1");
|
||||
$rows = $DB->fetch($rows2);
|
||||
if (!$rows) {
|
||||
echo '<script>alert("当前记录不存在!");history.go(-1);</script>';
|
||||
}
|
||||
$name = $_POST['name'];
|
||||
$alias = $_POST['alias'];
|
||||
$hint = $_POST['hint'];
|
||||
$link = $_POST['link'];
|
||||
$waplink = $_POST['waplink'];
|
||||
$color = $_POST['color'];
|
||||
$icon = $_POST['icon'];
|
||||
$order = $_POST['order'];
|
||||
if ($_POST['st'] == true) {
|
||||
$st = 1;
|
||||
} else {
|
||||
$st = 0;
|
||||
}
|
||||
|
||||
if (empty($name) && empty($alias) && empty($hint) && empty($link) && empty($color) && empty($icon) && empty($order)) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
if (empty($name) && empty($alias) && empty($hint) && empty($link) && empty($color) && empty($icon) && empty($order)) {
|
||||
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
|
||||
} else {
|
||||
|
||||
$sql = "UPDATE `lylme_sou` SET `sou_alias` = '" . $alias . "', `sou_name` = '" . $name . "', `sou_hint` = '" . $hint . "', `sou_color` = '" . $color . "', `sou_link` = '" . $link . "', `sou_waplink` = '" . $waplink . "', `sou_icon` = '" . $icon . "', `sou_st` = '" . $st . "', `sou_order` = '" . $order . "' WHERE `lylme_sou`.`sou_id` = " . $id . ";";
|
||||
$sql = "UPDATE `lylme_sou` SET `sou_alias` = '" . $alias . "', `sou_name` = '" . $name . "', `sou_hint` = '" . $hint . "', `sou_color` = '" . $color . "', `sou_link` = '" . $link . "', `sou_waplink` = '" . $waplink . "', `sou_icon` = '" . $icon . "', `sou_st` = '" . $st . "', `sou_order` = '" . $order . "' WHERE `lylme_sou`.`sou_id` = " . $id . ";";
|
||||
|
||||
|
||||
if($DB->query($sql)) {
|
||||
echo '<script>alert("修改搜索引擎 ' . $name . ' 成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("修改失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif($set == 'delete') {
|
||||
$id = $_GET['id'];
|
||||
$sql = "DELETE FROM lylme_sou WHERE sou_id='$id'";
|
||||
if($DB->query($sql)) {
|
||||
echo '<script>alert("删除成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
}
|
||||
} else {
|
||||
echo '<div class="alert alert-info">系统共有 <b>' . $sousrows . '</b> 个搜索引擎<br/><a href="./sou.php?set=add" class="btn btn-primary">新增搜索引擎</a></div> <div class="table-responsive">
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("修改搜索引擎 ' . $name . ' 成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("修改失败!");history.go(-1);</script>';
|
||||
}
|
||||
}
|
||||
} elseif ($set == 'delete') {
|
||||
$id = $_GET['id'];
|
||||
$sql = "DELETE FROM lylme_sou WHERE sou_id='$id'";
|
||||
if ($DB->query($sql)) {
|
||||
echo '<script>alert("删除成功!");window.location.href="./sou.php";</script>';
|
||||
} else {
|
||||
echo '<script>alert("删除失败!");history.go(-1);</script>';
|
||||
}
|
||||
} else {
|
||||
echo '<div class="alert alert-info">系统共有 <b>' . $sousrows . '</b> 个搜索引擎<br/><a href="./sou.php?set=add" class="btn btn-primary">新增搜索引擎</a></div> <div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead><tr><th>排序权重</th><th>名称</th><th>别名</th><th>地址</th><th>状态</th><th>操作</th></tr></thead>
|
||||
<tbody>';
|
||||
|
||||
|
||||
$rs = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC");
|
||||
while($res = $DB->fetch($rs)) {
|
||||
echo '<tr><td><b>' . $res['sou_order'] . '</b></td><td><b><font color="' . $res['sou_color'] . '">' . $res['sou_name'] . '</font></b></td><td>' . $res['sou_alias'] . '</td><td>' . $res['sou_link'] . '</td><td>';
|
||||
$rs = $DB->query("SELECT * FROM `lylme_sou` ORDER BY `lylme_sou`.`sou_order` ASC");
|
||||
while ($res = $DB->fetch($rs)) {
|
||||
echo '<tr><td><b>' . $res['sou_order'] . '</b></td><td><b><font color="' . $res['sou_color'] . '">' . $res['sou_name'] . '</font></b></td><td>' . $res['sou_alias'] . '</td><td>' . $res['sou_link'] . '</td><td>';
|
||||
|
||||
if($res['sou_st'] == 1) {
|
||||
echo '<span class="label label-success">开启</span>';
|
||||
} else {
|
||||
echo '<span class="label label-danger">关闭</span>';
|
||||
}
|
||||
if ($res['sou_st'] == 1) {
|
||||
echo '<span class="label label-success">开启</span>';
|
||||
} else {
|
||||
echo '<span class="label label-danger">关闭</span>';
|
||||
}
|
||||
|
||||
echo '</td><td><a href="./sou.php?set=edit&id=' . $res['sou_id'] . '" class="btn btn-info btn-xs">编辑</a> <a href="./sou.php?set=delete&id=' . $res['sou_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'确定删除 ' . $res['sou_name'] . '\');">删除</a></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
echo '</td><td><a href="./sou.php?set=edit&id=' . $res['sou_id'] . '" class="btn btn-info btn-xs">编辑</a> <a href="./sou.php?set=delete&id=' . $res['sou_id'] . '" class="btn btn-xs btn-danger" onclick="return confirm(\'确定删除 ' . $res['sou_name'] . '\');">删除</a></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
include './footer.php';
|
||||
include './footer.php';
|
||||
?>
|
@ -1,6 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description:
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-01-23 12:25:35
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 05:35:10
|
||||
* @FilePath: /lylme_spage/admin/table_group.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
include_once("../include/common.php");
|
||||
if(isset($islogin)==1) {
|
||||
if (isset($islogin) == 1) {
|
||||
} else exit("<script language='javascript'>window.location.href='./login.php';</script>");
|
||||
|
||||
echo '<div class="alert alert-info">系统共有 <b>' . $groupsrows . '</b> 个分组<br/><a href="./group.php?set=add" class="btn btn-primary">新建分组</a></div>
|
||||
@ -9,35 +18,41 @@ echo '<div class="alert alert-info">系统共有 <b>' . $groupsrows . '</b> 个
|
||||
<thead><tr><th>名称</th><th>排序</th><th>链接数</th><th>访问密码</th><th>状态</th><th>操作</th></tr></thead>
|
||||
<tbody>';
|
||||
|
||||
$sql = " 1";
|
||||
$rs = $DB->query("SELECT * FROM lylme_groups WHERE{$sql} order by group_order asc");
|
||||
while ($res = $DB->fetch($rs)) {
|
||||
$pwd = $DB->get_row("SELECT `pwd_id`, `pwd_key` FROM `lylme_pwd` WHERE `pwd_id` = ".$res['group_pwd'])['pwd_key'];
|
||||
echo '<tr><td><input type="hidden" name="group_id" value="'.$res['group_id'].'">' . $res['group_name'] . '</td><td>
|
||||
<button class="btn btn-primary btn-xs sort-up">上移</button> <button class="btn btn-cyan btn-xs sort-down">下移</button></td>
|
||||
<td>'. $DB->num_rows($DB->query("SELECT `id` FROM `lylme_links` WHERE `group_id` =".$res['group_id'])).'</td>
|
||||
<td>';
|
||||
if($pwd||$res['group_pwd']){
|
||||
if(empty($pwd)){
|
||||
echo '<font color="red">失效[请重新设置加密组]</font>';
|
||||
}
|
||||
else{
|
||||
echo '<font color="f96197">'.$pwd.'</font>';
|
||||
}
|
||||
}
|
||||
else{echo '<font color="green">未加密</font>';}
|
||||
echo ' </td><td>';
|
||||
$rs = $DB->query("SELECT * FROM lylme_groups ORDER BY group_order ASC");
|
||||
while ($res = $DB->fetch($rs)) {
|
||||
$pwd = null;
|
||||
if (isset($res['group_pwd']) && $res['group_pwd'] !== 0) {
|
||||
|
||||
if($res['group_status']){
|
||||
echo '<button class="btn btn-pink btn-xs" onclick="off_group('.$res['group_id'].')">禁用</button>';
|
||||
}else{
|
||||
echo '<button class="btn btn-success btn-xs" onclick="on_group('.$res['group_id'].')">启用</button>';
|
||||
}
|
||||
|
||||
echo'</td><td> <a href="./group.php?set=edit&id=' . $res['group_id'] . '" class="btn btn-info btn-xs">编辑</a> <button class="btn btn-xs btn-danger" onclick="del_group('.$res['group_id'].')">删除</button></td></tr>';
|
||||
$pwd_row = $DB->get_row("SELECT `pwd_id`, `pwd_key` FROM `lylme_pwd` WHERE `pwd_id` = " . intval($res['group_pwd']));
|
||||
if ($pwd_row !== null) {
|
||||
$pwd = $pwd_row['pwd_key'];
|
||||
}
|
||||
}
|
||||
echo '<tr><td><input type="hidden" name="group_id" value="' . $res['group_id'] . '">' . $res['group_name'] . '</td><td>
|
||||
<button class="btn btn-primary btn-xs sort-up">上移</button> <button class="btn btn-cyan btn-xs sort-down">下移</button></td>
|
||||
<td>' . $DB->num_rows($DB->query("SELECT `id` FROM `lylme_links` WHERE `group_id` =" . $res['group_id'])) . '</td>
|
||||
<td>';
|
||||
if ($pwd || $res['group_pwd']) {
|
||||
if (empty($pwd)) {
|
||||
echo '<font color="red">失效[请重新设置加密组]</font>';
|
||||
} else {
|
||||
echo '<font color="f96197">' . $pwd . '</font>';
|
||||
}
|
||||
} else {
|
||||
echo '<font color="green">未加密</font>';
|
||||
}
|
||||
echo ' </td><td>';
|
||||
|
||||
if ($res['group_status']) {
|
||||
echo '<button class="btn btn-pink btn-xs" onclick="off_group(' . $res['group_id'] . ')">禁用</button>';
|
||||
} else {
|
||||
echo '<button class="btn btn-success btn-xs" onclick="on_group(' . $res['group_id'] . ')">启用</button>';
|
||||
}
|
||||
|
||||
echo '</td><td> <a href="./group.php?set=edit&id=' . $res['group_id'] . '" class="btn btn-info btn-xs">编辑</a> <button class="btn btn-xs btn-danger" onclick="del_group(' . $res['group_id'] . ')">删除</button></td></tr>';
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
140
admin/theme.php
140
admin/theme.php
@ -1,85 +1,73 @@
|
||||
<?php
|
||||
$title = '主题设置';
|
||||
include './head.php';
|
||||
function theme($theme,$str){
|
||||
$theme_ini = ROOT.'template/'.$theme.'/theme.ini';
|
||||
$arr = json_decode(file_get_contents($theme_ini), true);
|
||||
if(!empty($arr[$str])){
|
||||
return strip_tags($arr[$str]);
|
||||
}
|
||||
else if($str =='theme_version'){
|
||||
return '未知';
|
||||
}
|
||||
else if($str =='theme_name'){
|
||||
return $theme;
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$set=isset($_GET['set'])?$_GET['set']:null;
|
||||
if(!empty($set)) {
|
||||
if(saveSetting('template',$set)) {
|
||||
exit('<script>alert("主题修改成功!");window.location.href="./theme.php";</script>');
|
||||
} else {
|
||||
exit('<script>alert("主题修改失败!");window.location.href="./theme.php";</script>');
|
||||
}
|
||||
}
|
||||
?>
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><h4>主题设置 <a href="https://spage.lylme.com/themes" target="_blank">更多主题 >></a></h4></div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>主题名称</th>
|
||||
<th>主题说明</th>
|
||||
<th>主题作者</th>
|
||||
<th>在线演示</th>
|
||||
<th>选择主题</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$theme_path = ROOT.'template/';
|
||||
$themes = glob($theme_path."*", GLOB_ONLYDIR);
|
||||
foreach($themes as $theme) {
|
||||
$theme = str_replace($theme_path ,"" , $theme);
|
||||
echo'<tr><td><h4>'.theme($theme,"theme_name").' </h4>版本:'.theme($theme,"theme_version").'</td>';
|
||||
|
||||
echo '<td><p>'.theme($theme,"theme_explain").'</p>';
|
||||
if(theme($theme,"theme_course")){
|
||||
echo ' <a href="'.theme($theme,"theme_course").'" target="_blank">主题教程</a>';
|
||||
}
|
||||
echo'</td>';
|
||||
echo '<td><p>'.theme($theme,"author_name").'</p>';
|
||||
if(theme($theme,"author_link")){
|
||||
echo ' <a href="'.theme($theme,"author_link").'" target="_blank">作者主页</a>';
|
||||
}
|
||||
echo '</td><td>';
|
||||
if(theme($theme,"theme_demo")){
|
||||
echo '<p><a class="btn btn-default" href="'.theme($theme,"theme_demo").'" target="_blank">在线演示</a></p>';
|
||||
}
|
||||
echo '</td>';
|
||||
if($conf['template'] == $theme) {
|
||||
echo '<td><p class="btn btn-default disabled">当前使用</p></td>';
|
||||
} else {
|
||||
echo '<td><a href="./theme.php?set='.$theme.'" class="btn btn-label btn-primary"><label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>使用</a></td>';
|
||||
}
|
||||
echo '</tr>'."\n";
|
||||
}
|
||||
$set = isset($_GET['set']) ? $_GET['set'] : null;
|
||||
if (!empty($set)) {
|
||||
if (saveSetting('template', $set, "网站主题")) {
|
||||
exit('<script>alert("主题修改成功!");window.location.href="./theme.php";</script>');
|
||||
} else {
|
||||
exit('<script>alert("主题修改失败!");window.location.href="./theme.php";</script>');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4>主题设置 <a href="https://spage.lylme.com/themes" target="_blank">更多主题 >></a></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<a href="./theme_setting.php" class="btn btn-label btn btn-default"><label><i class="mdi mdi-contrast-circle"></i></label>主题自定义设置</a>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>主题名称</th>
|
||||
<th>主题说明</th>
|
||||
<th>主题作者</th>
|
||||
<th>在线演示</th>
|
||||
<th>选择主题</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$theme_path = ROOT . 'template/';
|
||||
$themes = glob($theme_path . "*", GLOB_ONLYDIR);
|
||||
foreach ($themes as $theme) {
|
||||
$theme = str_replace($theme_path, "", $theme);
|
||||
echo '<tr><td><h4>' . theme($theme, "theme_name") . ' </h4>版本:' . theme($theme, "theme_version") . '</td>';
|
||||
|
||||
echo '<td><p>' . theme($theme, "theme_explain") . '</p>';
|
||||
if (theme($theme, "theme_course")) {
|
||||
echo ' <a href="' . theme($theme, "theme_course") . '" target="_blank">主题教程</a>';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td><p>' . theme($theme, "author_name") . '</p>';
|
||||
if (theme($theme, "author_link")) {
|
||||
echo ' <a href="' . theme($theme, "author_link") . '" target="_blank">作者主页</a>';
|
||||
}
|
||||
echo '</td><td>';
|
||||
if (theme($theme, "theme_demo")) {
|
||||
echo '<p><a class="btn btn-default" href="' . theme($theme, "theme_demo") . '" target="_blank">在线演示</a></p>';
|
||||
}
|
||||
echo '</td>';
|
||||
if ($conf['template'] == $theme) {
|
||||
echo '<td><p class="btn btn-default disabled">当前使用</p></td>';
|
||||
} else {
|
||||
echo '<td><a href="./theme.php?set=' . $theme . '" class="btn btn-label btn-primary"><label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label>使用</a></td>';
|
||||
}
|
||||
echo '</tr>' . "\n";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<?php
|
||||
include './footer.php';
|
||||
|
76
admin/theme_setting.php
Normal file
76
admin/theme_setting.php
Normal file
@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
* @Description: 主题自定义设置
|
||||
* @Author: LyLme admin@lylme.com
|
||||
* @Date: 2024-04-12 14:30:34
|
||||
* @LastEditors: LyLme admin@lylme.com
|
||||
* @LastEditTime: 2024-04-14 05:49:36
|
||||
* @FilePath: /lylme_spage/admin/theme_setting.php
|
||||
* @Copyright (c) 2024 by LyLme, All Rights Reserved.
|
||||
*/
|
||||
$title = '主题自定义设置';
|
||||
include './head.php';
|
||||
?>
|
||||
<link href="../assets/js/layui/css/layui.css" type="text/css" rel="stylesheet" />
|
||||
<script src="../assets/js/layui/layui.js" type="application/javascript"></script>
|
||||
<link rel="stylesheet" href="../assets/admin/css/theme_setting.css">
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4><?php echo theme($conf['template'], 'theme_name') . '主题 - 自定义设置'; ?></h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="layui-form layuimini-form">
|
||||
<?php
|
||||
$theme_configs = ROOT . 'template/' . $conf['template'] . '/config.php';
|
||||
if (file_exists($theme_configs) && ($result = @require $theme_configs) !== false && is_array($theme_config)) {
|
||||
|
||||
try {
|
||||
$theme_name = "theme_config_" . $conf['template'];
|
||||
if(isset($conf[$theme_name])){
|
||||
$form_data = json_decode($conf[$theme_name], true);
|
||||
|
||||
}
|
||||
$form_data = !empty($form_data) ? $form_data : [];
|
||||
echo Form::getInstance()
|
||||
->form_action('ajax_theme.php?set=save')
|
||||
|
||||
->form_method(Form::form_method_post)
|
||||
->form_schema($theme_config)
|
||||
->input_hidden("theme_path", $conf['template'])
|
||||
// ->switch('是否启用', '启用主题配置', 'status', true)
|
||||
->input_submit('保存', 'class="layui-btn" lay-submit lay-filter="saveBtn"')
|
||||
// ->input_submit('确认保存', 'class="btn btn-primary m-r-5"')
|
||||
->form_data($form_data)
|
||||
->create();
|
||||
} catch (Exception $e) {
|
||||
echo "主题配置载入失败";
|
||||
//$e->getMessage();
|
||||
}
|
||||
} else {
|
||||
echo "<h3>当前主题未适配主题自定义设置</h3>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/admin/js/theme_setting.js"></script>
|
||||
<!--选色器-->
|
||||
<link rel="stylesheet" type="text/css" href="/assets/admin/css/coloris.min.css" />
|
||||
<script type="text/javascript" src="/assets/admin/js/coloris.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
Coloris({
|
||||
el: '.coloris',
|
||||
swatches: ['#000000', '#555555', '#666666', '#264653', '#2a9d8f', '#f4a261', '#e76f51', '#ff0000', '#d62828', '#023e8a', '#0077b6', '#0096c7']
|
||||
});
|
||||
</script>
|
||||
</main>
|
||||
<?php
|
||||
include './footer.php';
|
||||
?>
|
136
admin/update.php
136
admin/update.php
@ -1,84 +1,90 @@
|
||||
<?php
|
||||
|
||||
$title = '检查更新';
|
||||
include './head.php';
|
||||
@unlink('log.txt');
|
||||
$update = update();
|
||||
?>
|
||||
<!--页面主要内容-->
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
if(getver($update['version']) > getver($conf['version']) && !empty($update['version']) ) {
|
||||
|
||||
echo '<div class="alert alert-info" role="alert">发现新版本:'.$update['version'].' 当前版本:</b>'.$conf['version'].' <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">查看发行版</a></div>
|
||||
<div class="card"><div class="card-header"><h4>更新说明</h4></div><ul class="list-group">
|
||||
'.$update['update_log'].'
|
||||
<li class="list-group-item"><button onclick="update()" class="btn btn-primary">更新</button></li>';
|
||||
} else if(!empty($update['version'])) {
|
||||
echo '<div class="alert alert-success" role="alert">当前已是最新版本! <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">查看发行版</a></div>
|
||||
<div class="card"><div class="card-header"><h4>版本更新</h4></div><ul class="list-group">
|
||||
<li class="list-group-item"><b>当前版本:</b>'.$conf['version'].'</li>
|
||||
<li class="list-group-item"><b>最新版本:</b>'.$update['version'].'</li>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger" role="alert">检查更新失败!</div>
|
||||
<div class="card"><div class="card-header"><h4>版本更新</h4></div><ul class="list-group">
|
||||
<li class="list-group-item"><b>当前版本:</b>'.$conf['version'].'</li>
|
||||
<li class="list-group-item"><b>手动更新:</b>请前往<a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">码云</a>下载最新版本<code>lylme_spage_update.zip</code>后缀的更新包上传到网站根目录解压即可,程序会自动更新数据库</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul></div>
|
||||
<!--页面主要内容-->
|
||||
<main class="lyear-layout-content">
|
||||
<div class="container-fluid">
|
||||
<?php
|
||||
if (getver($update['version']) > getver($conf['version']) && !empty($update['version'])) {
|
||||
|
||||
echo '<div class="alert alert-info" role="alert">发现新版本:' . $update['version'] . ' 当前版本:</b>' . $conf['version'] . ' <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">查看发行版</a></div>
|
||||
<div class="card"><div class="card-header"><h4>更新说明</h4></div><ul class="list-group">
|
||||
' . $update['update_log'] . '
|
||||
<li class="list-group-item"><button onclick="update()" class="btn btn-primary">更新</button></li>';
|
||||
} else if (!empty($update['version'])) {
|
||||
echo '<div class="alert alert-success" role="alert">当前已是最新版本! <a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">查看发行版</a></div>
|
||||
<div class="card"><div class="card-header"><h4>版本更新</h4></div><ul class="list-group">
|
||||
<li class="list-group-item"><b>当前版本:</b>' . $conf['version'] . '</li>
|
||||
<li class="list-group-item"><b>最新版本:</b>' . $update['version'] . '</li>';
|
||||
} else {
|
||||
echo '<div class="alert alert-danger" role="alert">检查更新失败!</div>
|
||||
<div class="card"><div class="card-header"><h4>版本更新</h4></div><ul class="list-group">
|
||||
<li class="list-group-item"><b>当前版本:</b>' . $conf['version'] . '</li>
|
||||
<li class="list-group-item"><b>手动更新:</b>请前往<a href="https://gitee.com/LyLme/lylme_spage/releases" target="_blank" class="alert-link">码云</a>下载最新版本<code>lylme_spage_update.zip</code>后缀的更新包上传到网站根目录解压即可,程序会自动更新数据库</a></li>';
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
include './footer.php';
|
||||
?>
|
||||
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/layer/3.1.1/layer.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="js/lightyear.js"></script>
|
||||
<script src="js/bootstrap-notify.min.js"></script>
|
||||
<link href="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery-confirm/3.3.0/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<script src="/assets/admin/js/layer.min.js" type="application/javascript"></script>
|
||||
<script type="text/javascript" src="/assets/admin/js/lightyear.js"></script>
|
||||
<script src="/assets/admin/js/bootstrap-notify.min.js"></script>
|
||||
<link href="/assets/admin/js/jquery-confirm.min.css" type="text/css" rel="stylesheet" />
|
||||
<script src="/assets/admin/js/jquery-confirm.min.js" type="application/javascript"></script>
|
||||
<script>
|
||||
function update() {
|
||||
$.confirm({
|
||||
title: '更新',
|
||||
content: '<p><b>注意:更新会替换大部分文件(不会删除原有文件)</b></p><p>若您修改了源码的内容,为防止丢失请先进行备份</p><p>另外:不建议通过修改源码的方式来修改内容,本程序预留了自定义JS的功能,建议通过JS的方式来修改内容,欢迎加群讨论获取',
|
||||
type: 'orange',
|
||||
buttons: {
|
||||
omg: {
|
||||
text: '更新',
|
||||
btnClass: 'btn-orange',
|
||||
action: function(){
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url:"ajax_link.php?submit=update",
|
||||
method:"POST",
|
||||
data:{file:"<?php echo $update['file'] ?>"},
|
||||
success:function(data){
|
||||
if(data == 'success'){
|
||||
function update() {
|
||||
$.confirm({
|
||||
title: '更新',
|
||||
content: '<p><b>注意:更新会替换大部分文件(不会删除原有文件)</b></p><p>若您修改了源码的内容,为防止丢失请先进行备份</p><p>另外:不建议通过修改源码的方式来修改内容,本程序预留了自定义JS的功能,建议通过JS的方式来修改内容,欢迎加群讨论获取',
|
||||
type: 'orange',
|
||||
buttons: {
|
||||
omg: {
|
||||
text: '更新',
|
||||
btnClass: 'btn-orange',
|
||||
action: function() {
|
||||
lightyear.loading('show');
|
||||
$.ajax({
|
||||
url: "ajax_link.php?submit=update",
|
||||
method: "POST",
|
||||
data: {
|
||||
file: "<?php echo $update['file'] ?>"
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if (data.code == 200) {
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify(data.msg, 'success', 1000);
|
||||
window.location.replace("./");
|
||||
return true;
|
||||
} else {
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify(data.msg, 'danger', 2000);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function(data) {
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify('更新成功!', 'success', 1000);
|
||||
window.location.replace("./");
|
||||
return true;
|
||||
}else{
|
||||
lightyear.loading('hide');
|
||||
lightyear.notify(data, 'warning', 2000);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error:function(data){
|
||||
layer.msg('服务器错误');
|
||||
lightyear.loading('hide');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
close: {
|
||||
text: '取消',
|
||||
}
|
||||
},
|
||||
close: {
|
||||
text: '取消',
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user