更新 v1.8.5

This commit is contained in:
LyLme 2024-01-09 11:08:01 +08:00
parent 54a345e324
commit 4f6579764f
4 changed files with 137 additions and 110 deletions

View File

@ -1,14 +1,16 @@
<?php
include_once("../include/common.php");
if(isset($islogin)==1) {
} else exit("<script language='javascript'>window.location.href='./login.php';</script>");
if(isset($islogin) == 1) {
} else {
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>
<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">
@ -31,23 +33,24 @@ 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="./tag.php">导航菜单设置</a> </li>
<li> <a href="./sou.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="./theme.php"><i class="mdi mdi-invert-colors"></i>主题设置</a> </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>
<div class="applyrow">'.$applyrows.'</div>';
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 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>
<li class="nav-item active"> <a href="./sou.php"><i class="mdi mdi-magnify"></i>搜索引擎</a></li>
<li class="nav-item active"> <a href="./pwd.php"><i class="mdi mdi-key-variant"></i>加密管理</a></li>
<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>

View File

@ -1,7 +1,7 @@
<?php
$title='搜索引擎设置';
$title = '搜索引擎设置';
include './head.php';
$sousrows=$DB->num_rows($DB->query("SELECT * FROM `lylme_sou`"));
$sousrows = $DB->num_rows($DB->query("SELECT * FROM `lylme_sou`"));
?>
<main class="lyear-layout-content">
@ -13,11 +13,10 @@ $sousrows=$DB->num_rows($DB->query("SELECT * FROM `lylme_sou`"));
<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">
@ -68,62 +67,62 @@ echo '<h4>新增搜索接</h4>
</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">
<form action="./sou.php?set=edit_submit&id=' . $id . '" method="POST">
<div class="form-group">
<label>*搜索引擎名称: (*必填)</label><br>
<input type="text" class="form-control" name="name" value="'.$row['sou_name'].'" required placeholder="如:百度一下">
<input type="text" class="form-control" name="name" value="' . $row['sou_name'] . '" required placeholder="如:百度一下">
<small class="help-block">搜索引擎名称,如<code>百度一下</code><code>搜狗搜索</code></small>
</div>
<div class="form-group">
<label>*搜索引擎别名: (*必填)</label><br>
<input type="text" class="form-control" name="alias" value="'.$row['sou_alias'].'" required placeholder="baidu">
<input type="text" class="form-control" name="alias" value="' . $row['sou_alias'] . '" required placeholder="baidu">
<small class="help-block">注:仅支持字母,<code>不能和其他搜索引擎的别名相同</code><br>建议填写搜索引擎的拼音或英文,如百度填写<code>baidu</code></small>
</div>
<div class="form-group">
<label>*搜索框提示: (*必填)</label><br>
<input type="text" class="form-control" name="hint" value="'.$row['sou_hint'].'" required placeholder="如:请输入搜索内容">
<input type="text" class="form-control" name="hint" value="' . $row['sou_hint'] . '" required placeholder="如:请输入搜索内容">
</div>
<div class="form-group">
<label>*搜索引擎地址: (*必填)</label><br>
<input type="text" class="form-control" name="link" value="'.$row['sou_link'].'" required placeholder="https://www.baidu.com/s?word=">
<input type="text" class="form-control" name="link" value="' . $row['sou_link'] . '" required placeholder="https://www.baidu.com/s?word=">
<small class="help-block">例:百度搜索 <code>https://www.baidu.com/s?word=</code><a href="https://blog.lylme.com/archives/lylme_spage.html#sou">查看获取接口教程</a>
<br>注意:当前仅支持搜索词作为末尾,例如:<code>https://www.baidu.com/s?word=搜索内容</code><br>如果使用GET请求搜索搜索词不处于末尾<code>https://www.baidu.com/s?wd=搜索词&ie=UTF-8</code>可将搜索词参数调换到末尾,如<code>https://www.baidu.com/s?ie=UTF-8&wd=搜索词</code>多个GET参数用以<code>&</code>分隔<br>如果搜索词不在末尾且非GET请求,如<code>https://xxx.com/s/搜索词.html</code>类似情况可用PHP页面定制搜索接口<a href="https://blog.lylme.com/archives/lylme_spage.html#souphp">查看教程</a></small>
<br>注意:当前仅支持搜索词作为末尾,例如:<code>https://www.baidu.com/s?word=搜索内容</code><br>如果使用GET请求搜索搜索词不处于末尾<code>https://www.baidu.com/s?wd=搜索词&ie=UTF-8</code>可将搜索词参数调换到末尾,如<code>https://www.baidu.com/s?ie=UTF-8&wd=搜索词</code>多个GET参数用以<code>&</code>分隔<br>如果搜索词不在末尾,如<code>https://xxx.com/s/搜索词.html</code>类似情况可用PHP定制搜索接口<a href="https://doc.lylme.com/spage/#/search-help">查看教程</a></small>
</div>
<div class="form-group">
<label>搜索引擎手机端地址: (选填) </label><br>
<input type="text" class="form-control" name="waplink" value="'.$row['sou_waplink'].'" placeholder="一般情况下留空">
<input type="text" class="form-control" name="waplink" value="' . $row['sou_waplink'] . '" placeholder="一般情况下留空">
<small class="help-block">注:百度搜索的电脑端和手机端不会自适应,需要手动设置手机端,如<code>https://m.baidu.com/s?word=</code><br>如果你添加的搜索区分手机端和PC端则需要手动设置。<code>一般情况下留空即可</code></small>
</div>
<div class="form-group">
<label>标题文字颜色: (*必填) </label><br>
<input type="text" class="form-control" name="color" value="'.$row['sou_color'].'" required>
<input type="text" class="form-control" name="color" value="' . $row['sou_color'] . '" required>
<small class="help-block">(*必填) 填写颜色的十六进制码,如: <code>#FF0000</code>(红色)<br>默认值:<code>#696a6d</code></small>
</div>
<div class="form-group">
<label>搜索引擎图标:(*必填) </label><br>
<textarea type="text" class="form-control" name="icon" placeholder="<svg" required>'.$row['sou_icon'].'</textarea>
<textarea type="text" class="form-control" name="icon" placeholder="<svg" required>' . $row['sou_icon'] . '</textarea>
<small class="help-block">方案1粘贴图标的<code>SVG</code>代码(推荐) <a href="./help.php?doc=icon" target="_blank">查看教程</a><br>方案2使用图片地址需要img标签<code>&lt;img src="/assets/img/logo.png" /&gt; </code></small>
</div>
<div class="form-group">
<label>排序权重: (*必填) </label><br>
<input type="text" class="form-control" name="order" value="'.$row['sou_order'].'" required>
<input type="text" class="form-control" name="order" value="' . $row['sou_order'] . '" required>
<small class="help-block">(*必填) 数字越小越靠前</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"';
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>
@ -133,90 +132,97 @@ echo '<h4>修改搜索引擎</h4>
</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
(NULL, '".$alias."', '".$name."', '".$hint."', '".$color."', '".$link."', '".$waplink."', '".$icon."', '".$st."', '".$sou_order."');
$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>';
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 . ";";
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 {
$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">
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>&nbsp;<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>';
}
?>
echo '</td><td><a href="./sou.php?set=edit&id=' . $res['sou_id'] . '" class="btn btn-info btn-xs">编辑</a>&nbsp;<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>

View File

@ -78,6 +78,23 @@ if($sqlvn < $filevn) {
saveSetting('admin_pwd', $admin_pwd);
}
}
if($sqlvn < 10805) {
$version = 'v1.8.5';
if (!isset($conf['about'])) {
$about_file = ROOT . 'about/about.txt';
if(file_exists($about_file)) {
$about = file_get_contents($about_file);
} else {
$about = "INSERT INTO `lylme_config` (`id`, `k`, `v`, `description`) VALUES (NULL, 'about', '<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>', NULL)";
}
$DB->query(daddslashes($about));
@unlink($about_file);
@unlink(ROOT . 'about/说明.txt');
}
}
$sql = explode(';', $sql);
for ($i = 0;$i < count($sql);$i++) {

View File

@ -50,7 +50,8 @@ INSERT INTO `lylme_config` VALUES
(19, 'wap_background', NULL, '手机端背景'),
(20, 'wxplus', '', '微信推送密钥'),
(21, 'wxplustime', '20:00', '微信推送时间'),
(22, 'yan', 'true', '随机一言开关');
(22, 'yan', 'true', '随机一言开关'),
(23, 'about', '<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>', '关于页面');
DROP TABLE IF EXISTS `lylme_groups`;
CREATE TABLE `lylme_groups` (