From 5cae5af1592eb1013823c4792c4aa42aed564863 Mon Sep 17 00:00:00 2001 From: "MI15\\Win" <10359480+tznb@user.noreply.gitee.com> Date: Tue, 18 Apr 2023 13:17:09 +0800 Subject: [PATCH] v2.0.13-20230418 --- system/api_root.php | 7 ++-- system/click.php | 36 ++++++++----------- system/index.php | 3 +- system/version.txt | 2 +- .../admin/page/expand/guestbook-admin.php | 2 +- templates/admin/page/link_extend.php | 4 +-- templates/admin/page/root/sys_setting.php | 11 ++++++ templates/admin/page/root/tool.php | 3 ++ templates/admin/page/share.php | 4 +-- templates/admin/page/updatelog.php | 12 +++++++ 10 files changed, 52 insertions(+), 32 deletions(-) diff --git a/system/api_root.php b/system/api_root.php index 561c716..92ec343 100644 --- a/system/api_root.php +++ b/system/api_root.php @@ -499,6 +499,7 @@ function write_sys_settings(){ 'Debug'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'调试模式参数错误'], 'Maintenance'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'维护模式参数错误'], 'Sub_domain'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'二级域名参数错误'], + 'Privacy'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'强制私有参数错误'], 'copyright'=>['empty'=>true], 'global_header'=>['empty'=>true], 'global_footer'=>['empty'=>true], @@ -519,11 +520,13 @@ function write_sys_settings(){ } if(!is_subscribe('bool')){ if($_POST['Sub_domain'] == 1){$o_config['Sub_domain'] = 0;$filter = true;} + if($_POST['Privacy'] == 1){$o_config['Privacy'] = 0;$filter = true;} if(!empty($_POST['copyright'])){$o_config['copyright'] = "";$filter = true;} if(!empty($_POST['global_header'])){$o_config['global_header'] = "";$filter = true;} if(!empty($_POST['global_footer'])){$o_config['global_footer'] = "";$filter = true;} - if(!empty($_POST['apply'])){$o_config['apply'] = 0;$filter = true;} - if(!empty($_POST['guestbook'])){$o_config['guestbook'] = 0;$filter = true;} + if($_POST['apply'] == 1){$o_config['apply'] = 0;$filter = true;} + if($_POST['guestbook'] == 1){$o_config['guestbook'] = 0;$filter = true;} + if($_POST['link_extend'] == 1){$o_config['link_extend'] = 0;$filter = true;} } update_db("global_config", ["v" => $o_config], ["k" => "o_config"],[1,($filter ?"保存成功,未检测到有效授权,带*号的配置无法为你保存":"保存成功")]); diff --git a/system/click.php b/system/click.php index 67f1bc2..a403ed7 100644 --- a/system/click.php +++ b/system/click.php @@ -8,17 +8,20 @@ if(empty($id)){Not_Found();} //查询链接信息 $where['lid'] = $id; $where['uid'] = UID; -//$where['status'] = 1; +$where['status'] = 1; $link = get_db('user_links','*',$where); //查找失败时显示404 -if(empty($link)){ - Not_Found(); -} +if(empty($link)){Not_Found();} + //站点设置和站点图标 $site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); -$favicon = ( !empty($site['site_icon_file'])) ? $site['site_icon'] : './favicon.ico'; $site['Title'] = $site['title'].(empty($site['subtitle'])?'':' - '.$site['subtitle']); +//免费用户请保留版权,谢谢! +$copyright = empty($global_config['copyright'])?'Copyright © TwoNav':$global_config['copyright']; +$ICP = empty($global_config['ICP'])?'':''.$global_config['ICP'].''; +$favicon = ( !empty($site['site_icon_file'])) ? $site['site_icon'] : './favicon.ico'; + //取登录状态 $is_login = is_login(); @@ -39,7 +42,6 @@ if(!$is_login){ $pv = empty($share['pwd']) || $_SESSION['verify']['share'][$share['id']] == $share['pwd']; } } - //判断链接是否停用/私有 if($link['status'] == 0){ @@ -64,7 +66,6 @@ if(!$is_login){ exit('很抱歉,页面所属的祖分类是私有的!您无权限查看,如果您是管理员,请先登录!'); } - //判断链接是否加密 if(!empty($link['pid'])){ $verify_type = 'link_pwd'; @@ -94,9 +95,6 @@ if(!$is_login){ } } - - - //取模板信息 require DIR ."/system/templates.php"; $dir_path = DIR.'/templates/transit/'.$s_templates['transit']; @@ -107,18 +105,12 @@ if(!is_file($transit_path)){ $transit_path= DIR.'/templates/transit/default/index.php'; } -//免费用户请保留版权,谢谢! -$copyright = empty($global_config['copyright'])?'Copyright © TwoNav':$global_config['copyright']; -$ICP = empty($global_config['ICP'])?'':''.$global_config['ICP'].''; - - //统计点击数 write_user_count(date('Ym'),'click_Ym'); write_user_count(date('Ymd'),'click_Ymd'); update_db("user_links", ["click[+]"=>1],['uid'=>UID,'lid'=>$id]); -//读取过渡页设置 -$transition_page = unserialize(get_db("user_config","v",["t"=>"config","k"=>"s_transition_page","uid"=>UID])); + //读取用户主题配置 $theme_config_db = unserialize(get_db('user_config','v',['t'=>'theme','k'=>$s_templates['transit'],'uid'=>UID])); @@ -143,24 +135,24 @@ if(!empty($link['url_standby'])) { exit; } -if ($s_site['link_model'] == '302'){ //302重定向 +if ($site['link_model'] == '302'){ //302重定向 header("HTTP/1.1 302 Moved Permanently"); header("Location: ".$link['url']); exit; -}elseif($s_site['link_model'] == '301'){ //301重定向 +}elseif($site['link_model'] == '301'){ //301重定向 header("HTTP/1.1 301 Moved Permanently"); header("Location: ".$link['url']); exit; -}elseif($s_site['link_model'] == 'Privacy'){ //隐私保护_header +}elseif($site['link_model'] == 'Privacy'){ //隐私保护_header header("Content-type: text/html; charset=utf-8"); header("Refresh:0;url=".$link['url']); echo '正在保护您的隐私..'; exit; -}elseif($s_site['link_model'] == 'Privacy_js'){ //隐私保护_js +}elseif($site['link_model'] == 'Privacy_js'){ //隐私保护_js header("Content-type: text/html; charset=utf-8"); echo '正在保护您的隐私..'; exit; -}elseif($s_site['link_model'] == 'Privacy_meta'){ //隐私保护_meta +}elseif($site['link_model'] == 'Privacy_meta'){ //隐私保护_meta header("Content-type: text/html; charset=utf-8"); echo '正在保护您的隐私..'; exit; diff --git a/system/index.php b/system/index.php index 966a101..fd5025d 100644 --- a/system/index.php +++ b/system/index.php @@ -1,10 +1,9 @@ 把地址栏的URL复制>在后台添加链接即可\n5.本条信息被删除时如果存在留言则不显示,没有留言时依旧会显示!\n6.有提交长度限制,类型32,联系方式64,标题128,内容2048字节!若不够用请自己修改源代码!\n7.为了防止被恶意提交,当留言数超过256时将不在接收留言!"; + $arr['content'] = "1.极简留言板采用轻量设计,整体只有几KB\n2.留言数据存放路径/data/user/xxx/MessageBoard/ (xxx表示用户名)\n3.默认是禁止留言的,点击上方蓝色字(禁止留言/允许留言)可切换状态\n4.使用方法: 点击极简留言板(蓝字)>把地址栏的URL复制>在后台添加链接即可(部分主题已支持自动展现入口)\n5.本条信息被删除时如果存在留言则不显示,没有留言时依旧会显示!\n6.有提交长度限制,类型32,联系方式64,标题128,内容2048字节!若不够用请自己修改源代码!\n7.为了防止被恶意提交,当留言数超过256时将不在接收留言!"; $arr['time'] = date("Y-m-d H:i:s",time()); $arr['ip'] = '127.0.0.1'; $arr['id'] = $id; diff --git a/templates/admin/page/link_extend.php b/templates/admin/page/link_extend.php index acd8971..97264a1 100644 --- a/templates/admin/page/link_extend.php +++ b/templates/admin/page/link_extend.php @@ -25,7 +25,7 @@ function echo_text($data){ ?>
- +
- +
开启时将关闭主页/登录/注册等服务,站长账号不受影响(网站升级迁移时适用)
+ +
+ +
+ +
+
开启后用户必须登录才可以进入主页(过渡页不限制)
+
diff --git a/templates/admin/page/root/tool.php b/templates/admin/page/root/tool.php index 0556108..5341aa5 100644 --- a/templates/admin/page/root/tool.php +++ b/templates/admin/page/root/tool.php @@ -1,6 +1,9 @@