mirror of
https://github.com/tznb1/TwoNav.git
synced 2025-08-10 08:51:49 +00:00
Compare commits
4 Commits
v2.0.29-20
...
v2.0.31-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0038e27493 | ||
|
|
3646cfba93 | ||
|
|
6a418f6c7f | ||
|
|
33386c75dc |
9
system/MySQL/20230715.php
Normal file
9
system/MySQL/20230715.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
|
||||
$sql ="
|
||||
ALTER TABLE `user_links` ADD `keywords` TEXT NOT NULL DEFAULT '' COMMENT '关键字' AFTER `weight` ;
|
||||
";
|
||||
if(exe_sql($sql)){
|
||||
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
|
||||
}else{
|
||||
msg(-1,'数据库更新失败');
|
||||
}
|
||||
@@ -46,6 +46,7 @@ INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALU
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230420.php', '1681977368', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230518.php', '1684393068', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230522.php', '1684762253', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230715.php', '1684762253', 'TRUE', '');
|
||||
|
||||
-- 创建用户表
|
||||
DROP TABLE IF EXISTS `global_user`;
|
||||
@@ -109,6 +110,7 @@ CREATE TABLE IF NOT EXISTS `user_links` (
|
||||
`url` text NOT NULL COMMENT '主链接',
|
||||
`url_standby` text NOT NULL COMMENT '备用链接',
|
||||
`weight` int(11) NOT NULL DEFAULT '0' COMMENT '权重',
|
||||
`keywords` text NOT NULL DEFAULT '' COMMENT '关键字',
|
||||
`description` text NOT NULL DEFAULT '' COMMENT '描述',
|
||||
`icon` text NOT NULL DEFAULT '' COMMENT '图标',
|
||||
`click` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '点击数',
|
||||
|
||||
9
system/SQLite/20230715.php
Normal file
9
system/SQLite/20230715.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php if(!defined('DIR')){header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit;}
|
||||
$sql ='
|
||||
ALTER TABLE user_links ADD keywords TEXT(128) NOT NULL DEFAULT "";
|
||||
';
|
||||
if(exe_sql($sql)){
|
||||
insert_db('updatadb_logs',['file_name'=>$file_name,'update_time'=>time(),'status'=>'TRUE','extra'=>'']);
|
||||
}else{
|
||||
msg(-1,'数据库更新失败');
|
||||
}
|
||||
@@ -38,6 +38,7 @@ CREATE TABLE IF NOT EXISTS "updatadb_logs" (
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230417.php', '1681719049', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230420.php', '1681977368', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230522.php', '1684762253', 'TRUE', '');
|
||||
INSERT INTO "updatadb_logs" ("file_name", "update_time", "status", "extra") VALUES ('20230715.php', '1684762253', 'TRUE', '');
|
||||
|
||||
-- 创建用户表
|
||||
CREATE TABLE IF NOT EXISTS "global_user" (
|
||||
@@ -93,6 +94,7 @@ CREATE TABLE IF NOT EXISTS "user_links" (
|
||||
"url" TEXT(1024) NOT NULL,
|
||||
"url_standby" text NOT NULL DEFAULT "",
|
||||
"weight" integer(11) NOT NULL DEFAULT 0,
|
||||
"keywords" TEXT(128) NOT NULL DEFAULT "",
|
||||
"description" TEXT(128) NOT NULL DEFAULT "",
|
||||
"icon" text NOT NULL DEFAULT "",
|
||||
"click" integer(10) NOT NULL DEFAULT 0,
|
||||
|
||||
176
system/api.php
176
system/api.php
@@ -176,7 +176,7 @@ function write_category(){
|
||||
'fid'=>intval($_POST['fid']??'0'),
|
||||
'pid'=>intval($_POST['pwd_id']??'0'),
|
||||
'status'=>1,
|
||||
'property'=>$_POST['property']??'0',
|
||||
'property'=>intval($_POST['property']??'0'),
|
||||
'name'=>htmlspecialchars($_POST['name'],ENT_QUOTES),
|
||||
'add_time'=>time(),
|
||||
'up_time'=>time(),
|
||||
@@ -230,7 +230,7 @@ function write_category(){
|
||||
$data = [
|
||||
'fid'=>$_POST['fid'],
|
||||
'pid'=>intval($_POST['pwd_id']??'0'),
|
||||
'property'=>$_POST['property']??'0',
|
||||
'property'=>intval($_POST['property']??'0'),
|
||||
'name'=>$_POST['name'],
|
||||
'up_time'=>time(),
|
||||
'description'=>$_POST['description'],
|
||||
@@ -378,6 +378,7 @@ function write_link(){
|
||||
$url = $_POST['url'];
|
||||
$icon = empty($_POST['icon']) ? '' : $_POST['icon'];
|
||||
$description = empty($_POST['description']) ? '' : $_POST['description'];
|
||||
$keywords = empty($_POST['keywords']) ? '' : $_POST['keywords'];
|
||||
$property = empty($_POST['property']) ? 0 : 1;
|
||||
//检测链接是否合法
|
||||
check_link($fid,$title,$url,$_POST['url_standby']);
|
||||
@@ -390,7 +391,10 @@ function write_link(){
|
||||
if($length_limit['l_desc'] > 0 && strlen($description) > $length_limit['l_desc'] ){
|
||||
msg(-1,'描述长度不能大于'.$length_limit['l_desc'].'个字节');
|
||||
}
|
||||
|
||||
//关键字长度检测
|
||||
if($length_limit['l_key'] > 0 && strlen($keywords) > $length_limit['l_key'] ){
|
||||
msg(-1,'关键字长度不能大于'.$length_limit['l_key'].'个字节');
|
||||
}
|
||||
//取最大链接ID
|
||||
$lid = get_maxid('link_id');
|
||||
//图标处理
|
||||
@@ -416,6 +420,7 @@ function write_link(){
|
||||
'title' => htmlspecialchars($title,ENT_QUOTES),
|
||||
'url' => $url,
|
||||
'url_standby' => $_POST['url_standby']??'',
|
||||
'keywords' => htmlspecialchars($keywords,ENT_QUOTES),
|
||||
'description' => htmlspecialchars($description,ENT_QUOTES),
|
||||
'add_time' => time(),
|
||||
'up_time' => time(),
|
||||
@@ -425,7 +430,20 @@ function write_link(){
|
||||
'property' => $property,
|
||||
'icon' => $icon
|
||||
];
|
||||
|
||||
//扩展字段
|
||||
if($GLOBALS['global_config']['link_extend'] == 1 && check_purview('link_extend',1)){
|
||||
$list = get_db("user_config","v",["k"=>"s_extend_list","uid"=>UID]);
|
||||
if(!empty($list)){
|
||||
$list = unserialize($list);
|
||||
$extend = [];
|
||||
foreach($list as $field){
|
||||
$name = "_{$field['name']}";
|
||||
if(isset($_POST[$name])){
|
||||
$data['extend'][$name] = $_POST[$name];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//插入数据库
|
||||
insert_db('user_links',$data);
|
||||
msgA(['code'=>1,'msg'=>'添加成功','id'=>$lid]);
|
||||
@@ -537,6 +555,7 @@ function write_link(){
|
||||
$title = $_POST['title'];
|
||||
$url = $_POST['url'];
|
||||
$icon = $_POST['icon'];
|
||||
$keywords = empty($_POST['keywords']) ? '' : $_POST['keywords'];
|
||||
$description = empty($_POST['description']) ? '' : $_POST['description'];
|
||||
$property = empty($_POST['property']) ? 0 : 1;
|
||||
//检测链接是否合法
|
||||
@@ -546,6 +565,10 @@ function write_link(){
|
||||
if($length_limit['l_desc'] > 0 && strlen($description) > $length_limit['l_desc'] ){
|
||||
msg(-1,'描述长度不能大于'.$length_limit['l_desc'].'个字节');
|
||||
}
|
||||
//关键字长度检测
|
||||
if($length_limit['l_key'] > 0 && strlen($keywords) > $length_limit['l_key'] ){
|
||||
msg(-1,'关键字长度不能大于'.$length_limit['l_key'].'个字节');
|
||||
}
|
||||
//检查链接是否已存在
|
||||
if(has_db('user_links',['uid'=>UID ,'lid[!]'=>$lid, "url" => $url])){msg(-1,'链接已存在!');}
|
||||
//检查链接ID是否存在
|
||||
@@ -557,6 +580,7 @@ function write_link(){
|
||||
'title' => htmlspecialchars($title,ENT_QUOTES),
|
||||
'url' => $url,
|
||||
'url_standby' => $_POST['url_standby']??'',
|
||||
'keywords' => htmlspecialchars($keywords,ENT_QUOTES),
|
||||
'description' => htmlspecialchars($description,ENT_QUOTES),
|
||||
'up_time' => time(),
|
||||
'property' => $property,
|
||||
@@ -576,7 +600,6 @@ function write_link(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//非必须参数,未传递参数时
|
||||
@@ -598,6 +621,9 @@ function write_link(){
|
||||
if(!isset($_POST['pwd_id'])){
|
||||
unset($data['pid']);
|
||||
}
|
||||
if(!isset($_POST['keywords'])){
|
||||
unset($data['keywords']);
|
||||
}
|
||||
//更新数据
|
||||
update_db('user_links',$data,['uid'=>UID,'lid'=>intval($_POST['lid']) ]);
|
||||
msgA(['code'=>1,'msg'=>'修改成功','icon' => $icon]);
|
||||
@@ -680,6 +706,116 @@ function write_link(){
|
||||
if(empty($fid)){msg(-1,'分类ID错误');}
|
||||
//加一个查找分类是否存在
|
||||
update_db('user_links',['fid'=>$fid],['uid'=>UID ,"lid" => json_decode($_POST['lid']) ],[1,'设置成功']);
|
||||
//检测是否满足要求
|
||||
}elseif($_GET['type'] === 'msg_pull_check'){
|
||||
if($global_config['offline']){
|
||||
msg(-1,"离线模式不可用");
|
||||
}
|
||||
if(!is_subscribe('bool')){
|
||||
msg(-1,"未检测到有效授权,无法使用该功能!");
|
||||
}
|
||||
if(intval($_POST['icon']) > 0){
|
||||
if(!check_purview('icon_pull',1)){
|
||||
msg(-1,'您所在的用户组,无法使用网站图标获取功能');
|
||||
}
|
||||
$path = DIR ."/data/user/".U."/favicon";
|
||||
if(!Check_Path($path)){
|
||||
msg(-1,'创建目录失败,请检查目录权限');
|
||||
}
|
||||
$config = unserialize( get_db("global_config", "v", ["k" => "icon_config"])) ?? [];
|
||||
if($config['o_switch'] == '0'){
|
||||
msg(-1,'相关服务处于关闭状态,请联系站长开启');
|
||||
}
|
||||
}
|
||||
session_start();
|
||||
$key = md5(uniqid().Get_Rand_Str(8));
|
||||
$_SESSION['msg_pull']["$key"] = true;
|
||||
msgA(['code'=>1,'msg'=>'success','key'=>$key]);
|
||||
}elseif($_GET['type'] === 'msg_pull'){
|
||||
session_start();
|
||||
$key = $_POST['key'];
|
||||
if(empty($key) || !$_SESSION['msg_pull']["$key"]){
|
||||
msg(-1,'key验证失败,请重试!');
|
||||
}elseif(empty($_POST['link_id'])){
|
||||
msg(-1,'链接ID不能为空');
|
||||
}
|
||||
//读取信息
|
||||
$link = get_db('user_links','*',['uid'=>UID ,'lid'=>$_POST['link_id'] ]);
|
||||
//检查链接
|
||||
if(empty($link)){
|
||||
msg(-1,'链接ID不存在');
|
||||
}elseif(!preg_match("/^(http:\/\/|https:\/\/).*/",$link['url'])){
|
||||
msg(-1,'只支持识别http/https协议的链接!');
|
||||
}elseif( !filter_var($link['url'], FILTER_VALIDATE_URL) ) {
|
||||
msg(-1,'URL无效!');
|
||||
}
|
||||
|
||||
//是否获取站点信息
|
||||
if( ( intval($_POST['title']) + intval($_POST['keywords']) + intval($_POST['description']) ) > 0 ){
|
||||
//读取长度限制配置
|
||||
$length_limit = unserialize(get_db("global_config","v",["k"=>"length_limit"]));
|
||||
//获取网站标题
|
||||
$c = curl_init();
|
||||
curl_setopt($c, CURLOPT_URL, $link['url']);
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36');
|
||||
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($c , CURLOPT_TIMEOUT, 10);
|
||||
$data = curl_exec($c);
|
||||
curl_close($c);
|
||||
require (DIR .'/system/get_page_info.php');
|
||||
$info = get_page_info($data);
|
||||
$new = [];
|
||||
if(intval($_POST['title']) > 0 && !empty($info['site_title'])){
|
||||
$new['title'] = $info['site_title'];
|
||||
if($length_limit['l_name'] > 0 && strlen($new['title']) > $length_limit['l_name'] ){
|
||||
$new['title'] = mb_substr($new['title'], 0, $length_limit['l_name'], 'utf-8');
|
||||
}
|
||||
}
|
||||
if(intval($_POST['keywords']) > 0 && !empty($info['site_keywords'])){
|
||||
$new['keywords'] = (empty($link['keywords']) || $_POST['keywords'] == '2') ? $info['site_keywords'] : $link['keywords'];
|
||||
if($length_limit['l_key'] > 0 && strlen($new['keywords']) > $length_limit['l_key'] ){
|
||||
$new['keywords'] = mb_substr($new['keywords'], 0, $length_limit['l_key'], 'utf-8');
|
||||
}
|
||||
}
|
||||
if(intval($_POST['description']) > 0 && !empty($info['site_description'])){
|
||||
$new['description'] = (empty($link['description']) || $_POST['description'] == '2') ? $info['site_description'] : $link['description'];
|
||||
if($length_limit['l_desc'] > 0 && strlen($new['description']) > $length_limit['l_desc'] ){
|
||||
$new['description'] = mb_substr($new['description'], 0, $length_limit['l_desc'], 'utf-8');
|
||||
}
|
||||
}
|
||||
if(empty($new)){
|
||||
$r['info'] = 'fail';
|
||||
}else{
|
||||
update_db('user_links',$new,['uid'=>UID ,"lid" => $link['lid'] ]);
|
||||
$r['info'] = 'success';
|
||||
}
|
||||
}
|
||||
|
||||
//是否获取图标
|
||||
if(intval($_POST['icon']) > 0){
|
||||
//检查跳过已存在图标的链接
|
||||
if($_POST['icon'] == '1' && !empty($link['icon'])){
|
||||
$r['icon'] = 'skip';
|
||||
}
|
||||
$api = Get_Index_URL().'?c=icon&url='.base64_encode($link['url']);
|
||||
$res = ccurl($api,30,true);
|
||||
$data = get_db('global_icon','*',['url_md5'=>md5($link['url'])]);
|
||||
if(empty($data)){
|
||||
$r['icon'] = 'fail';
|
||||
}
|
||||
$new_path = "./data/user/".U.'/favicon/'.$data['file_name'];
|
||||
if(copy("./data/icon/{$data['file_name']}",$new_path)){
|
||||
update_db('user_links',['icon'=>$new_path],['uid'=>UID ,"lid" => $link['lid'] ]);
|
||||
$r['icon'] = 'success';
|
||||
}else{
|
||||
$r['icon'] = 'fail';
|
||||
}
|
||||
}
|
||||
|
||||
msg(1,$r);
|
||||
//图标拉取
|
||||
}elseif($_GET['type'] === 'icon_pull'){
|
||||
if($global_config['offline']){
|
||||
@@ -711,7 +847,7 @@ function write_link(){
|
||||
}
|
||||
|
||||
$api = Get_Index_URL().'?c=icon&url='.base64_encode($link['url']);
|
||||
$res = ccurl($api,30);
|
||||
$res = ccurl($api,30,true);
|
||||
$data = get_db('global_icon','*',['url_md5'=>md5($link['url'])]);
|
||||
if(empty($data)){
|
||||
msg(1,'fail');
|
||||
@@ -1006,7 +1142,8 @@ function write_site_setting(){
|
||||
function write_transit_setting(){
|
||||
$datas = [
|
||||
'visitor_stay_time'=>['int'=>true,'min'=>0,'max'=>60,'msg'=>'访客停留时间范围0-60'],
|
||||
'admin_stay_time'=>['int'=>true,'min'=>0,'max'=>60,'msg'=>'管理员停留时间范围0-60']
|
||||
'admin_stay_time'=>['int'=>true,'min'=>0,'max'=>60,'msg'=>'管理员停留时间范围0-60'],
|
||||
'default_keywords'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'默认关键字参数错误']
|
||||
];
|
||||
|
||||
foreach ($datas as $key => $data){
|
||||
@@ -1463,7 +1600,7 @@ function write_data_control(){
|
||||
function read_data(){
|
||||
global $USER_DB;
|
||||
//指定类型限制仅root账号可用!
|
||||
if(in_array($USER_DB['UserGroup'] != 'root' && $_GET['type'],['diagnostic_log','connectivity_test','phpinfo'])){
|
||||
if($USER_DB['UserGroup'] != 'root' && in_array( $_GET['type'],['diagnostic_log','connectivity_test','phpinfo'])){
|
||||
msg(-1,'无权限');
|
||||
}
|
||||
|
||||
@@ -1569,6 +1706,27 @@ function read_data(){
|
||||
}else{
|
||||
exit('密码验证失败,请重试!');
|
||||
}
|
||||
//报表统计
|
||||
}elseif($_GET['type'] == 'echarts'){
|
||||
$days = isset($_GET['date']) && !empty($_GET['date']) ? $_GET['date'] : 7;
|
||||
$dates = [];
|
||||
for ($i = 0; $i < $days; $i++) {
|
||||
$date = date('Ymd', strtotime("-$i days"));
|
||||
$dates[] = $date;
|
||||
}
|
||||
$dates = array_reverse($dates);
|
||||
$day_data = [];
|
||||
array_push($day_data, ['name' => '访问量', 'type' => 'line', 'data' => []]);
|
||||
array_push($day_data, ['name' => '点击量', 'type' => 'line', 'data' => []]);
|
||||
array_push($day_data, ['name' => 'IP数', 'type' => 'line', 'data' => []]);
|
||||
foreach ($dates as $date) {
|
||||
array_push($day_data[0]['data'], get_db('user_count', 'v', ['uid' => UID, 'k' => $date, 't' => 'index_Ymd']) ?? 0);
|
||||
array_push($day_data[1]['data'], get_db('user_count', 'v', ['uid' => UID, 'k' => $date, 't' => 'click_Ymd']) ?? 0);
|
||||
array_push($day_data[2]['data'], get_db('user_count', 'v', ['uid' => UID, 'k' => $date, 't' => 'ip_count']) ?? 0);
|
||||
}
|
||||
|
||||
$data = ['dates'=>$dates,'day_data'=>$day_data];
|
||||
msgA(['code'=>1,'data'=>$data]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1596,6 +1754,7 @@ function other_get_link_info(){
|
||||
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36');
|
||||
curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1); //允许重定向,解决http跳转到https无法识别
|
||||
curl_setopt($c , CURLOPT_TIMEOUT, 5); //设置超时时间
|
||||
$data = curl_exec($c);
|
||||
@@ -1604,6 +1763,7 @@ function other_get_link_info(){
|
||||
require (DIR .'/system/get_page_info.php');
|
||||
$info = get_page_info($data);
|
||||
$link['title'] = $info['site_title'];
|
||||
$link['keywords'] = $info['site_keywords'];
|
||||
$link['description'] = $info['site_description'];
|
||||
msgA(['code'=>1,'data'=>$link]);
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ function write_sys_settings(){
|
||||
}
|
||||
|
||||
//长度限制
|
||||
foreach (['c_name','c_desc','l_name','l_url','l_desc'] as $name){
|
||||
foreach (['c_name','c_desc','l_name','l_url','l_key','l_desc'] as $name){
|
||||
$length_limit[$name] = is_subscribe('bool') ? intval($_POST[$name]) : 0;
|
||||
}
|
||||
write_global_config("length_limit",$length_limit,'长度限制');
|
||||
@@ -738,6 +738,25 @@ function other_root(){
|
||||
if(!is_subscribe('bool')){msg(-1,"未检测到有效授权,无法使用该功能!");}
|
||||
write_global_config('icon_config',$_POST,'图标配置');
|
||||
msg(1,'保存成功');
|
||||
}elseif($_GET['type'] == 'write_icon_del_cache'){
|
||||
//删除数据库缓存信息
|
||||
if(empty(count_db('global_icon','*'))){
|
||||
msg(-1,'无缓存记录..');
|
||||
}
|
||||
delete_db('global_icon','*');
|
||||
|
||||
//删除缓存目录下的所有文件
|
||||
$files = glob(DIR.'/data/icon' . '/*');
|
||||
if (empty($files)) {
|
||||
msg(-1,'无缓存文件..');
|
||||
}
|
||||
foreach ($files as $file) {
|
||||
if (is_file($file)) {
|
||||
unlink($file);
|
||||
}
|
||||
}
|
||||
|
||||
msg(1,'操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php if(!defined('DIR')){Not_Found();}AccessControl();
|
||||
//负责过渡页/跳转/隐私保护/密码访问
|
||||
$id = intval($_GET['id']);
|
||||
|
||||
//IP数统计
|
||||
count_ip();
|
||||
//如果id为空,则显示404
|
||||
if(empty($id)){Not_Found();}
|
||||
|
||||
@@ -131,6 +132,19 @@ if($global_config['link_extend'] == 1 && check_purview('link_extend',1) && in_ar
|
||||
//载入过渡页设置
|
||||
$transition_page = unserialize(get_db("user_config", "v", ["uid"=>UID,"k"=>"s_transition_page"]));
|
||||
|
||||
//关键字处理
|
||||
if(!empty($link['url_standby']) || $site['link_model'] == 'Transition'){
|
||||
if(empty($link['keywords'])){
|
||||
if($transition_page['default_keywords'] == '0'){
|
||||
$link['keywords'] = $link['title'];
|
||||
}else if($transition_page['default_keywords'] == '1'){
|
||||
$link['keywords'] = $site['keywords'];
|
||||
}else{
|
||||
$link['keywords'] = $link['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//如果存在备用链接,则强制载入过渡页
|
||||
if(!empty($link['url_standby'])) {
|
||||
$link['url_standby'] = unserialize($link['url_standby']);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
// 来源 https://blog.mimvp.com/article/23089.html
|
||||
|
||||
function get_page_info($output, $friend_link = '', $curl_info=array()) {
|
||||
$page_info = array();
|
||||
@@ -71,16 +70,39 @@ function get_page_info($output, $friend_link = '', $curl_info=array()) {
|
||||
|
||||
preg_match('/<META\s+content="([\w\W]*?)"\s+scheme="([\w\W]*?)"/si', $meta_str, $res);
|
||||
if(!empty($res)) $meta_array[strtolower($res[2])] = $res[1];
|
||||
|
||||
// 20230716 新增匹配语法
|
||||
preg_match('/<META\s+content=[\'"](.*?)[\'"]\s+itemprop=[\'"](.*?)[\'"]\s+name=[\'"](.*?)[\'"]>/si', $meta_str, $res);
|
||||
if(!empty($res)) $meta_array[strtolower($res[3])] = $res[1];
|
||||
|
||||
preg_match('/<meta\s+itemprop=[\'"](.*?)[\'"]\s+name=[\'"](.*?)[\'"]\s+content=[\'"](.*?)[\'"]>/si', $meta_str, $res);
|
||||
if(!empty($res)) $meta_array[strtolower($res[2])] = $res[3];
|
||||
}
|
||||
|
||||
|
||||
//如果正则匹配失败则使用php函数尝试再次匹配
|
||||
if(empty($meta_array['keywords']) || empty($meta_array['description'])){
|
||||
//将html保存为临时文件
|
||||
$key = md5(uniqid().Get_Rand_Str(8));
|
||||
$tempFile = DIR ."/data/temp/".md5(uniqid().Get_Rand_Str(8)).".html";
|
||||
file_put_contents($tempFile, $output);
|
||||
$tags = get_meta_tags($tempFile);
|
||||
unlink($tempFile); //删除临时文件
|
||||
if(empty($meta_array['keywords']) && !empty($tags['keywords'])){
|
||||
$meta_array['keywords'] = $tags['keywords'];
|
||||
}
|
||||
if(empty($meta_array['description']) && !empty($tags['description'])){
|
||||
$meta_array['description'] = $tags['description'];
|
||||
}
|
||||
}
|
||||
|
||||
$page_info['site_keywords'] = $meta_array['keywords'];
|
||||
$page_info['site_description'] = $meta_array['description'];
|
||||
//$page_info['meta_array'] = $meta_array; //暂时不需要全部meta
|
||||
|
||||
|
||||
# 判断是否存在友链
|
||||
if(!empty($friend_link) && strstr($output, $friend_link) != "") {
|
||||
$page_info['friend_link_status'] = 1;
|
||||
}
|
||||
|
||||
|
||||
return $page_info;
|
||||
}
|
||||
@@ -288,5 +288,6 @@ if(empty($_GET['share']) && !$site['ex_theme']){
|
||||
//访问统计
|
||||
write_user_count(date('Ym'),'index_Ym');
|
||||
write_user_count(date('Ymd'),'index_Ymd');
|
||||
count_ip();
|
||||
//载入模板
|
||||
require($index_path);
|
||||
@@ -18,14 +18,19 @@ if($_SERVER['REQUEST_METHOD'] === 'GET'){
|
||||
AccessControl(); //访问控制
|
||||
$User = $_POST["User"];$Password = $_POST["Password"]; //获取请求数据
|
||||
|
||||
if(empty($User)){
|
||||
insert_db("user_log", ["uid" => '',"user"=>'',"ip"=>Get_IP(),"time"=>time(),"type" => 'login',"content"=>Get_Request_Content(),"description"=>"请求登录>账号为空"]);
|
||||
msg(-1,'账号不能为空!');
|
||||
}elseif($User != $USER_DB['User']){
|
||||
insert_db("user_log", ["uid" => '',"user"=>$User,"ip"=>Get_IP(),"time"=>time(),"type" => 'login',"content"=>Get_Request_Content(),"description"=>"请求登录>账号不存在"]);
|
||||
msg(-1,'账号不存在!');
|
||||
}
|
||||
|
||||
//记录请求日志
|
||||
insert_db("user_log", ["uid" => $USER_DB['ID'],"user"=>$USER_DB['User'],"ip"=>Get_IP(),"time"=>time(),"type" => 'login',"content"=>Get_Request_Content(),"description"=>"请求登录"]);
|
||||
$log_id = $db->id();
|
||||
//基础判断
|
||||
if(!isset($User)){
|
||||
update_db_db("user_log", ["description" => "请求登录>账号不能为空"], ["id"=>$log_id]);
|
||||
msg(-1,'账号不能为空!');
|
||||
}elseif(strlen($Password)!==32){
|
||||
if(strlen($Password)!==32){
|
||||
update_db("user_log", ["description" => "请求登录>密码错误(长度应该是32位的MD5)"], ["id"=>$log_id]);
|
||||
msg(-1,'密码错误!');
|
||||
}elseif($c != $global_config["Login"] && $c != $USER_DB['Login'] ){
|
||||
|
||||
@@ -530,7 +530,7 @@ function get_http_code($url,$TIMEOUT = 10 ,$NOBODY = true) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function ccurl($url,$overtime = 3){
|
||||
function ccurl($url,$overtime = 3,$Referer = false){
|
||||
try {
|
||||
$curl = curl_init ( $url ) ; //初始化
|
||||
curl_setopt($curl, CURLOPT_TIMEOUT, $overtime ); //超时
|
||||
@@ -539,6 +539,11 @@ function ccurl($url,$overtime = 3){
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
if($Referer === true){
|
||||
curl_setopt($curl, CURLOPT_REFERER, $_SERVER['HTTP_REFERER']);
|
||||
}elseif(!empty($Referer)){
|
||||
curl_setopt($curl, CURLOPT_REFERER, $Referer);
|
||||
}
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36');
|
||||
$Res["content"] = curl_exec ( $curl ) ;
|
||||
$Res["code"] = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
@@ -734,4 +739,22 @@ function send_email($config){
|
||||
msg(-1,'发送失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//统计访问ip数
|
||||
function count_ip(){
|
||||
$ip = Get_IP(); //取访客IP
|
||||
$k = date('Ymd'); $t = 'ip_list';
|
||||
$ip_list = get_db('user_count','v',['uid'=>UID,'k'=>$k,'t'=>$t]); //取列表
|
||||
$ip_list = empty($ip_list) ? [] : unserialize($ip_list); //反序列化
|
||||
//判断IP是否存在列表中
|
||||
if(!in_array($ip, $ip_list)){
|
||||
$ip_list[] = $ip; //加入列表
|
||||
if(!has_db('user_count',['uid'=>UID,'t'=>$t,'k'=>$k])){
|
||||
insert_db("user_count", ['uid'=>UID,"k"=>$k,"v"=>$ip_list,'t'=>$t]);
|
||||
}else{
|
||||
update_db("user_count", ["v"=>$ip_list],['uid'=>UID,'t'=>$t,'k'=>$k]);
|
||||
}
|
||||
write_user_count($k,'ip_count');//访问ip数+1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
v2.0.29-20230705
|
||||
v2.0.31-20230720
|
||||
@@ -29,8 +29,8 @@ layui.use(module, function () {
|
||||
if(data.path != '' ){$("#iconurl").val(data.path);}
|
||||
//如果勾选连续添加
|
||||
if($("#continuity").is(":checked")){
|
||||
//$('#reset').click();//完全清空
|
||||
form.val('form',{'url':'','title':'','description':'','icon':''});
|
||||
form.val('form',{'url':'','title':'','description':'','icon':'','keywords':''});
|
||||
$('form input[name^="_"]').val(''); //扩展字段清空
|
||||
$('#icon_img').attr('src', blank_img);//清除缩略图
|
||||
layer.msg('添加成功', {icon: 1});
|
||||
$("#url").focus();//URL获取输入焦点
|
||||
@@ -233,6 +233,9 @@ function get_link_info() {
|
||||
if(data.data.description != null) {
|
||||
$("#description").val(data.data.description);
|
||||
}
|
||||
if(data.data.keywords != null) {
|
||||
$("#keywords").val(data.data.keywords);
|
||||
}
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 5});
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ layui.use(['form','table','dropdown','miniTab'], function () {
|
||||
var IDs = [];
|
||||
var api = get_api('read_link_list'); //列表接口
|
||||
var limit = localStorage.getItem(u + "_limit") || 50; //尝试读取本地记忆数据,没有就默认50
|
||||
var link_sort = JSON.parse(localStorage.getItem(u + "_link_sort")) || {field: 'lid', type: null };
|
||||
var pwds = [];
|
||||
var field,order;
|
||||
miniTab.listen();
|
||||
//渲染表格
|
||||
renderTable1();
|
||||
@@ -81,21 +81,23 @@ layui.use(['form','table','dropdown','miniTab'], function () {
|
||||
item.hide = local[item.field];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//渲染表格函数
|
||||
var renderTable2 = function () {
|
||||
where = link_sort.type === null ? {} : {field:link_sort.field,order:link_sort.type.toUpperCase()};
|
||||
table.render({
|
||||
elem: '#table'
|
||||
,height: 'full-110' //自适应高度
|
||||
,url: api //数据接口
|
||||
,where: where
|
||||
,page: true //开启分页
|
||||
,limit:limit //默认每页显示行数
|
||||
,limits: [20,50,100,300,500]
|
||||
,even:true //隔行背景色
|
||||
,loading:true //加载条
|
||||
//,defaultToolbar:false
|
||||
,toolbar: '#toolbar'
|
||||
,id:'table'
|
||||
,initSort: link_sort
|
||||
,cols: [cols]
|
||||
,method: 'post'
|
||||
,response: {statusCode: 1 }
|
||||
@@ -112,10 +114,9 @@ layui.use(['form','table','dropdown','miniTab'], function () {
|
||||
$("[data-field='add_time']").addClass('layui-hide-xs');
|
||||
$("[data-field='up_time']").addClass('layui-hide-xs');
|
||||
$("[data-field='click']").addClass('layui-hide-xs');
|
||||
//$(".layui-laypage .layui-laypage-count").css("padding-left","35px");
|
||||
$(".layui-laypage .layui-laypage-prev").addClass('layui-hide-xs');
|
||||
$(".layui-laypage .layui-laypage-curr").addClass('layui-hide-xs');
|
||||
$(".layui-laypage .layui-laypage-next").addClass('layui-hide-xs');
|
||||
// $(".layui-laypage .layui-laypage-prev").addClass('layui-hide-xs');
|
||||
// $(".layui-laypage .layui-laypage-curr").addClass('layui-hide-xs');
|
||||
// $(".layui-laypage .layui-laypage-next").addClass('layui-hide-xs');
|
||||
$(".layui-laypage .layui-laypage-skip").addClass('layui-hide-xs');
|
||||
$(".layui-table-tool-self").addClass('layui-hide-xs');
|
||||
//加载加密分组数据
|
||||
@@ -135,29 +136,28 @@ layui.use(['form','table','dropdown','miniTab'], function () {
|
||||
key: input.name,value: input.checked
|
||||
});
|
||||
});
|
||||
$('th[data-field="icon"]').attr('title', '仅显示已上传的图标');
|
||||
}
|
||||
});
|
||||
// 监听表格排序事件
|
||||
table.on('sort(table)', function(obj) {
|
||||
field = obj.field; // 排序字段
|
||||
order = obj.type == null ? '' : obj.type.toUpperCase(); // 排序方式asc,desc转为大写,null则默认排序
|
||||
link_sort = {field:obj.field,type:obj.type};
|
||||
localStorage.setItem(u + "_link_sort",JSON.stringify(link_sort));
|
||||
link_search();
|
||||
});
|
||||
};
|
||||
|
||||
function link_search(){
|
||||
var fid = document.getElementById("fid").value;
|
||||
var keyword = document.getElementById("link_keyword").value;//获取输入内容
|
||||
var property = document.getElementById("property").value;
|
||||
var status = document.getElementById("status").value;
|
||||
let data = form.val('form');
|
||||
if(link_sort.type != null){
|
||||
data.field = link_sort.field;
|
||||
data.order = link_sort.type.toUpperCase();
|
||||
}
|
||||
table.reload('table', {
|
||||
url: api
|
||||
,method: 'post'
|
||||
,request: {
|
||||
pageName: 'page' //页码的参数名称
|
||||
,limitName: 'limit' //每页数据量的参数名
|
||||
}
|
||||
,where: {query:keyword,fid:fid,property:property,status:status,field:field,order:order}
|
||||
,request: {pageName: 'page',limitName: 'limit'}
|
||||
,where: data
|
||||
,page: {curr: 1}
|
||||
});
|
||||
}
|
||||
@@ -320,8 +320,44 @@ layui.use(['form','table','dropdown','miniTab'], function () {
|
||||
layer.msg(data.msg);
|
||||
}
|
||||
});
|
||||
}else if(event === 'msg_pull'){
|
||||
index = layer.open({type: 1,scrollbar: false,shadeClose: true,title: '批量识别链接信息',area : ['100%', '100%'],content: $('.msg_pull')});
|
||||
}
|
||||
});
|
||||
|
||||
$('#start_pull').click(function () {
|
||||
let lits = table.checkStatus('table').data; console.log( lits );
|
||||
let config = form.val('msg_pull');
|
||||
let number = 0;
|
||||
let total = lits.length;
|
||||
let load_id = layer.load(1, {shade:[0.5,'#fff']});//加载层
|
||||
let msg_id = layer.msg('正在识别中', {icon: 16,time: 1000*300}); //进度提示
|
||||
//检查是否满足条件
|
||||
$.post(get_api('write_link','msg_pull_check'),config,function(data,status){
|
||||
if(data.code == 1){
|
||||
config.key = data.key;
|
||||
start_pull(number); //开始拉取
|
||||
}else{
|
||||
layer.alert(data.msg || '未知错误',{icon:5,title:'错误',anim: 2,closeBtn: 0,btn: ['刷新页面']},function () {location.reload();});
|
||||
}
|
||||
});
|
||||
function start_pull(number){
|
||||
if(number >= total){
|
||||
layer.closeAll();
|
||||
layer.alert('处理完毕,请刷新页面!' ,{icon:1,title:'提示',anim: 2,shadeClose: false,closeBtn: 0});
|
||||
return true;
|
||||
}
|
||||
$("#layui-layer"+ msg_id+" .layui-layer-padding").html('<i class="layui-layer-face layui-icon layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></i>[ ' + number + ' / ' + total + ' ] 正在处理中..');
|
||||
config.link_id = lits[number].lid;
|
||||
$.post(get_api('write_link','msg_pull'),config,function(data,status){
|
||||
number ++;
|
||||
start_pull(number);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem: '#link_extend_list'
|
||||
|
||||
@@ -41,11 +41,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="keywords" name="keywords" placeholder="可留空" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="description" id="description" placeholder="请输入内容" class="layui-textarea"></textarea>
|
||||
<textarea name="description" id="description" placeholder="可留空" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -240,9 +240,16 @@ require 'header.php';
|
||||
</div>
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header"><i class="fa fa-line-chart icon"></i>报表统计</div>
|
||||
<div class="layui-card-header">
|
||||
<div style="display: flex; justify-content: space-between;">
|
||||
<div><i class="fa fa-line-chart icon"></i>报表统计</div>
|
||||
<div>
|
||||
<button class="layui-btn layui-btn-primary echarts" style="border: none;display:none;"><span>最近7天</span><i class="layui-icon layui-icon-down layui-font-12"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div id="echarts-records" style="width: 100%;min-height:500px"></div>
|
||||
<div id="echarts-records" style="width: 100%; min-height: 500px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -323,29 +330,61 @@ if($USER_DB['UserGroup'] == 'root'){
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
miniTab = layui.miniTab,
|
||||
echarts = layui.echarts;
|
||||
echarts = layui.echarts,
|
||||
dropdown = layui.dropdown;
|
||||
miniTab.listen();
|
||||
|
||||
//报表功能
|
||||
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||
var optionRecords = {
|
||||
tooltip: {trigger: 'axis'},
|
||||
legend: {data:['访问量','点击量']},
|
||||
grid: {left: '3%',right: '4%',bottom: '3%',containLabel: true},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: <?php echo json_encode($day)?>
|
||||
},
|
||||
yAxis: {},
|
||||
series: <?php echo json_encode($day_data)?>
|
||||
};
|
||||
echartsRecords.setOption(optionRecords);
|
||||
|
||||
// echarts 窗口缩放自适应
|
||||
window.onresize = function(){
|
||||
echartsRecords.resize();
|
||||
|
||||
//报表统计下拉初始化
|
||||
var home_echarts = localStorage.getItem(u + "_home_echarts") || 7 ;
|
||||
$('.echarts').find('span').text(`最近${home_echarts}天`);
|
||||
$('.echarts').show();
|
||||
dropdown.render({
|
||||
elem: '.echarts',
|
||||
data: [{
|
||||
title: '最近7天',
|
||||
value: 7
|
||||
},{
|
||||
title: '最近14天',
|
||||
value: 14
|
||||
},{
|
||||
title: '最近30天',
|
||||
value: 30
|
||||
}],
|
||||
click: function(obj){
|
||||
this.elem.find('span').text(obj.title);
|
||||
localStorage.setItem(u + "_home_echarts",obj.value);
|
||||
home_echarts = obj.value;
|
||||
load_echarts();
|
||||
}
|
||||
});
|
||||
|
||||
//加载报表统计
|
||||
function load_echarts(){
|
||||
var echartsRecords = echarts.init(document.getElementById('echarts-records'), 'walden');
|
||||
$.post('./index.php?c=api&method=read_data&date='+home_echarts+'&type=echarts&u='+u,function(data,status){
|
||||
if(data.code == 1){
|
||||
var optionRecords = {
|
||||
tooltip: {trigger: 'axis'},
|
||||
legend: {data:['访问量','点击量','IP数']},
|
||||
grid: {left: '3%',right: '4%',bottom: '3%',containLabel: true},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: data.data.dates
|
||||
},
|
||||
yAxis: {},
|
||||
series: data.data.day_data
|
||||
};
|
||||
echartsRecords.setOption(optionRecords);
|
||||
window.onresize = function(){echartsRecords.resize();} // echarts 窗口缩放自适应
|
||||
return;
|
||||
}
|
||||
layer.alert("获取统计数据失败..",{icon:5,title:'错误',anim: 2,closeBtn: 0,btn: ['刷新页面']},function () {location.reload();});
|
||||
});
|
||||
}
|
||||
load_echarts();
|
||||
|
||||
//定时刷新
|
||||
setInterval(function() {
|
||||
if($("#layuiminiHomeTabId",parent.document).attr('class') == 'layui-this' && document.visibilityState == 'visible'){
|
||||
|
||||
@@ -79,14 +79,25 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="keywords" name="keywords" placeholder="可留空" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="description" id="description" placeholder="请输入内容" class="layui-textarea"></textarea>
|
||||
<textarea name="description" id="description" placeholder="可留空" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
//判断全局是否开启扩展
|
||||
if($global_config['link_extend'] && check_purview('link_extend',1)){
|
||||
require 'link_extend.php';
|
||||
}?>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" id="continuity" lay-skin="primary" title="连续添加">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$link = get_db('user_links',['lid','fid','pid(pwd_id)','property','title','url','url_standby','description','icon'],['uid'=>UID,'lid'=>$_GET['id']]);
|
||||
$link = get_db('user_links',['lid','fid','pid(pwd_id)','property','title','url','url_standby','keywords','description','icon'],['uid'=>UID,'lid'=>$_GET['id']]);
|
||||
if(empty($link)){
|
||||
require(DIR.'/templates/admin/page/404.php');
|
||||
exit;
|
||||
@@ -92,11 +92,18 @@ $title='编辑链接';$awesome=true; require 'header.php';
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="keywords" name="keywords" placeholder="可留空" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">描述</label>
|
||||
<div class="layui-input-block">
|
||||
<textarea name="description" id="description" placeholder="请输入内容" class="layui-textarea"></textarea>
|
||||
<textarea name="description" id="description" placeholder="可留空" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -13,6 +13,7 @@ if(!empty($list)){
|
||||
foreach ($list as $data) {
|
||||
$field = "_".$data['name'];
|
||||
$data['value'] = isset($extend_data[$field]) ? $extend_data[$field] : $data['default'];
|
||||
$link["_{$data['name']}"] = ''.htmlentities($data['value']);
|
||||
if($data['type'] == 'text'){
|
||||
echo_text($data);
|
||||
}elseif($data['type'] == 'textarea'){
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main">
|
||||
|
||||
<form class="layui-form" lay-filter="form">
|
||||
<div class="layui-inline layui-form" style="padding-bottom: 5px;">
|
||||
<label class="layui-form-label " style="width:60px;padding-left: 5px;padding-right: 5px;">分类筛选:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select id="fid" lay-filter="fid" name="categorys" lay-search>
|
||||
<select name="fid" lay-search>
|
||||
<option value="0" selected="">全部</option>
|
||||
<optgroup label="用户分类">
|
||||
<?php echo_category(true); ?>
|
||||
@@ -21,21 +21,20 @@
|
||||
<div class="layui-inline layui-form" style="padding-bottom: 5px;">
|
||||
<label class="layui-form-label layui-hide-sm" style="width:60px;padding-left: 5px;padding-right: 5px;">关键字:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input" name="keyword" id="link_keyword" placeholder='请输入标题或描述或URL' value=''autocomplete="off" >
|
||||
<input class="layui-input" name="query" id="link_keyword" placeholder='请输入标题或描述或URL' autocomplete="off" >
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-inline layui-form layui-hide-xs" style="padding-bottom: 5px;" >
|
||||
<label class="layui-form-label layui-hide-sm" style="width:60px;padding-left: 5px;padding-right: 5px; ">属性筛选:</label>
|
||||
<div class="layui-input-inline" style=" width: 80px; ">
|
||||
<select id="property" >
|
||||
<select name="property" >
|
||||
<option value="" selected>不限</option>
|
||||
<option value="0" >公开</option>
|
||||
<option value="1" >私有</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline" style=" width: 80px; ">
|
||||
<select id="status" >
|
||||
<select name="status" >
|
||||
<option value="" selected>不限</option>
|
||||
<option value="0" >禁用</option>
|
||||
<option value="1" >启用</option>
|
||||
@@ -43,12 +42,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline layui-form" style="padding-bottom: 5px;">
|
||||
<button class="layui-btn layui-btn-normal " id="link_search" style="height: 36px;">搜索</button>
|
||||
<button class="layui-btn layui-btn-normal "type="button" id="link_search" style="height: 36px;">搜索</button>
|
||||
</div>
|
||||
|
||||
<span id = "testing_tip" style = "display:none;">测试中...</span>
|
||||
<span id = "subscribe" style = "display:none;"><?php echo is_subscribe('bool')?'1':'0' ?></span>
|
||||
<table id="table" class="layui-table" lay-filter="table" style="margin: 1px 0;"></table>
|
||||
</form>
|
||||
<table id="table" class="layui-table" lay-filter="table" style="margin: 1px 0;"></table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 操作列 -->
|
||||
@@ -75,9 +74,7 @@
|
||||
<?php if($global_config['offline'] != 1 ){ ?>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger layui-hide-xs" lay-event="testing" id="testing">检测</button>
|
||||
<?php }?>
|
||||
<?php if($global_config['offline'] != 1 && check_purview('icon_pull',1)){ ?>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger layui-hide-xs" lay-event="icon_pull" id="icon_pull">图标拉取</button>
|
||||
<?php }?>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger layui-hide-xs" lay-event="msg_pull" id="msg_pull">识别</button>
|
||||
<button class="layui-btn layui-btn-sm layui-btn-normal layui-btn-danger" layuimini-content-href="link_sort" data-title="链接排序">排序模式</button>
|
||||
</div>
|
||||
</script>
|
||||
@@ -116,5 +113,55 @@
|
||||
</div>
|
||||
</script>
|
||||
</ul>
|
||||
<ul class="msg_pull" style="margin-top: 18px;display:none;padding-right: 10px;padding-left: 10px;">
|
||||
<form class="layui-form layuimini-form" lay-filter="msg_pull">
|
||||
<pre class="layui-code" id="tip" >提示: 自动识别仅针对http/https有效,且不能保证百分百成功!未成功识别时不会对链接信息进行修改!大批量识别前建议先备份数据,效果不理想时可以回退!</pre>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网站标题</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="title" >
|
||||
<option value="0">保持不变</option>
|
||||
<option value="1">获取 (覆盖)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="keywords" >
|
||||
<option value="0">保持不变</option>
|
||||
<option value="1" selected>获取 (未填关键字时)</option>
|
||||
<option value="2">获取 (覆盖)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网站描述</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="description" >
|
||||
<option value="0">保持不变</option>
|
||||
<option value="1" selected>获取 (未填描述时)</option>
|
||||
<option value="2">获取 (覆盖)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">网站图标</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="icon" >
|
||||
<option value="0">保持不变</option>
|
||||
<option value="1" selected>获取 (未上传图标时)</option>
|
||||
<option value="2">获取 (覆盖)</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-warm" type="button" id="close" >关闭</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="start_pull" id="start_pull">开始</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -86,6 +86,7 @@ $title='系统设置';require(dirname(__DIR__).'/header.php');
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-danger" type="button" id="clean">清除缓存</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="save">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -103,7 +104,24 @@ layui.use(['jquery','form'], function () {
|
||||
|
||||
//表单赋值
|
||||
form.val('form', <?php echo json_encode(unserialize( get_db("global_config", "v", ["k" => "icon_config"])));?>);
|
||||
|
||||
//清除缓存
|
||||
$('#clean').click(function() {
|
||||
layer.confirm('确定要清除全部缓存吗?',{icon: 3, title:'温馨提示'}, function(index){
|
||||
$.post(get_api('other_root','write_icon_del_cache'),function(data,status){
|
||||
if(data.code == 1) {
|
||||
if(data.msg!="操作成功"){
|
||||
layer.alert(data.msg)
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 1});
|
||||
}
|
||||
}else{
|
||||
layer.msg(data.msg, {icon: 5});
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(save)', function (data) {
|
||||
$.post(get_api('other_root','write_icon_config'),data.field,function(data,status){
|
||||
|
||||
@@ -253,7 +253,7 @@ $title='系统设置';require(dirname(__DIR__).'/header.php');
|
||||
</div>
|
||||
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;"><legend>相关限制</legend></fieldset>
|
||||
<blockquote class="layui-elem-quote layui-text" style="">程序采用UTF8编码,一个汉字约占用3个字节!英文字母和数组占用1个字节!值为0表示不限制!</blockquote>
|
||||
<blockquote class="layui-elem-quote layui-text" style="">程序采用UTF8编码,一个汉字约占用3个字节!英文字母和数组占用1个字节!值为0表示不限制!<br />添加或编辑时长度超限则不允许添加,批量识别时超限则截断</blockquote>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">分类名称</label>
|
||||
<div class="layui-input-inline">
|
||||
@@ -282,6 +282,13 @@ $title='系统设置';require(dirname(__DIR__).'/header.php');
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">字符长度限制,单位:字节。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">链接关键字</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="l_key" autocomplete="off" value="0" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">字符长度限制,单位:字节。</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">链接描述</label>
|
||||
<div class="layui-input-inline">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" min="0" max="60" lay-verify="required|number" name="visitor_stay_time" value = "3" autocomplete="off" placeholder="访客停留时间,单位s" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">访客停留时间,单位秒</div>
|
||||
<div class="layui-form-mid layui-word-aux">访客停留时间,单位秒(需模板支持)</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
@@ -18,7 +18,18 @@
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" min="0" max="60" lay-verify="required|number" name="admin_stay_time" value = "5" autocomplete="off" placeholder="管理员停留时间,单位s" class="layui-input">
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">管理员停留时间,单位秒</div>
|
||||
<div class="layui-form-mid layui-word-aux">管理员停留时间,单位秒(需模板支持)</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" >默认关键字</label>
|
||||
<div class="layui-input-inline" >
|
||||
<select name="default_keywords" >
|
||||
<option value="0">链接标题</option>
|
||||
<option value="1">站点关键字</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">指链接信息未填写关键字时选择其他值作为关键字</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php $title='过渡模板';$awesome=true; require 'header.php'; ?>
|
||||
<?php $title='过渡模板';$awesome=true; require 'header.php';
|
||||
$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site']));
|
||||
$tip = $site['link_model'] == 'Transition';
|
||||
?>
|
||||
<style type="text/css">
|
||||
.screenshot{
|
||||
width: 99%;
|
||||
@@ -15,7 +18,8 @@
|
||||
<blockquote class="layui-elem-quote layuimini-form" style="margin-top: 0px;border-left: 5px solid <?php echo $cache?"#1e9fff":($global_config['offline']?"":"#639d11") ?>;padding: 6px;">
|
||||
<span class="layui-breadcrumb" lay-separator="|">
|
||||
<a href="./index.php?c=admin&page=theme_transit&cache=no&u=<?php echo U;?>">刷新数据</a>
|
||||
<a href="javascript:;" layuimini-content-href="set_transit" data-title="设置过渡页面">设置</a>
|
||||
<a href="javascript:;" layuimini-content-href="set_transit" data-title="设置过渡页面">设置</a><?php if(!$tip){echo '
|
||||
<a href="javascript:;" layuimini-content-href="SiteSetting" data-title="站点设置">注:请将站点设置>链接模式>改为过渡页面</a>';}?>
|
||||
</span>
|
||||
</blockquote>
|
||||
<div class="layui-bg-gray" style="padding: 1px;" >
|
||||
|
||||
@@ -2,6 +2,38 @@
|
||||
<body>
|
||||
<div class="layuimini-container">
|
||||
<div class="layuimini-main" style=" margin-left: 20px;">
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.0.31-20230720</h4>
|
||||
<ul>
|
||||
<li>[新增] 支持统计访问IP数,可在后台概要页报表统计展示</li>
|
||||
<li>[新增] 数据库链接表新增关键字列</li>
|
||||
<li>[新增] 添加/编辑链接页面新增关键字输入,用于过渡页SEO优化 (注:230715之前的过度模板固定用链接标题作为关键字)</li>
|
||||
<li>[新增] 过度模板设置新增默认关键字选项 (针对未填写关键字时选择其他值作为关键字,需更新过度页模板)</li>
|
||||
<li>[新增] 链接列表新增识别按钮,用于批量获取URL的标题/描述/关键字/图标</li>
|
||||
<li>[新增] 系统设置中新增链接关键字长度限制</li>
|
||||
<li>[新增] 链接列表排序模式支持记忆到客户端</li>
|
||||
<li>[新增] 已开启链接扩展字段时,添加链接时支持填写扩展字段 (原仅编辑支持)</li>
|
||||
<li>[修复] 编辑链接时重置按钮未对扩展内容重置</li>
|
||||
<li>[优化] 添加/编辑链接页面识别功能支持关键字识别</li>
|
||||
<li>[优化] 链接列表的图标拉取与自动识别功能合并</li>
|
||||
<li>[优化] 链接识别的成功率</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<h4 class="layui-timeline-title">v2.0.30-20230713</h4>
|
||||
<ul>
|
||||
<li>[修复] 登录接口的一个错误</li>
|
||||
<li>[优化] 图标配置页面新增清除缓存按钮,优化图标拉取功能的成功率</li>
|
||||
<li>[优化] 主题设置>过渡模板,当站点设置中链接模式不为过度页面时显示提示信息</li>
|
||||
<li>[新增] 后台概要页的报表统计支持选择最近7/14/30天的统计数据 (终端记忆)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo $link['title']; ?> - <?php echo $site['title']; ?></title>
|
||||
<meta name="keywords" content="<?php echo $link['title']; ?>" />
|
||||
<meta name="keywords" content="<?php echo $link['keywords']; ?>" />
|
||||
<meta name="description" content="<?php echo $link['description']; ?>" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="<?php echo $libs?>/bootstrap4/css/bootstrap.min.css" type="" media=""/>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name":"OneNav1",
|
||||
"description":"OneNav旧版过渡页",
|
||||
"homepage":"https://www.xiaoz.me",
|
||||
"version":"2.0.1",
|
||||
"update":"2023/04/05",
|
||||
"version":"2.0.2",
|
||||
"update":"2023/07/16",
|
||||
"author":"xiaoz",
|
||||
"screenshot":"https://s3.bmp.ovh/imgs/2022/04/17/8cac968a8cc8135c.png",
|
||||
"config": {
|
||||
|
||||
Reference in New Issue
Block a user