diff --git a/index.php b/index.php index 105927c..61b5228 100644 --- a/index.php +++ b/index.php @@ -67,6 +67,7 @@ if(!in_array($c,[$global_config["Register"],'ico','icon'])){ session_name('TwoNavSID'); if(empty($c) || $c == 'index'){ + $c = 'index'; require "./system/index.php";//主页 }elseif($c == $global_config["Register"]){ require "./system/Register.php";//注册 diff --git a/system/Register.php b/system/Register.php index 581e8f8..e0f910e 100644 --- a/system/Register.php +++ b/system/Register.php @@ -4,21 +4,10 @@ if($global_config['Maintenance'] != 0){Amsg(-1,'网站正在进行维护,请稍 $global_templates = unserialize(get_db("global_config",'v', ["k" => "s_templates"])); //如果是Get请求则载入登录模板 if($_SERVER['REQUEST_METHOD'] === 'GET'){ - $t_name = $global_templates['register']; - $t_dir = "./templates/register/".$t_name; //模板目录 - $t_path = "./templates/register/{$t_name}/index.php"; //模板路径 - //如果不存在则使用默认模板 - if(!file_exists($t_path)){ - $t_name = 'default'; - $t_dir ='./templates/register/default'; - $t_path = './templates/register/default/index.php'; - $global_templates['register'] = 'default'; - update_db("global_config", ["v" => $global_templates], ["k"=>"s_templates"]); - } - $copyright = empty($global_config['copyright'])?'Copyright © TwoNav':$global_config['copyright']; - $ICP = empty($global_config['ICP'])?'':''.$global_config['ICP'].''; - $reg_tips = get_db('global_config','v',['k'=>'reg_tips']); - require $t_path; + //通用数据初始化 + require DIR."/system/templates.php"; + $reg_tips = get_db('global_config','v',['k'=>'reg_tips']); //注册提示 + require $index_path; exit; } diff --git a/system/admin.php b/system/admin.php index 941b6b5..f5f97bf 100644 --- a/system/admin.php +++ b/system/admin.php @@ -11,7 +11,9 @@ if(!is_login){ exit; }//已登录,检查是否需要验证二级密码 elseif(!empty($LoginConfig['Password2']) && !Check_Password2($LoginConfig)){ - require DIR.'/templates/admin/other/verify_pwd2.php'; + $c = 'verify';$_GET['c'] = 'pwd2'; + require DIR."/system/templates.php"; + require $index_path; exit; } @@ -64,7 +66,7 @@ if($page == 'config_home'){ $theme_config = empty($theme_config['config']) ? []:$theme_config['config']; //读取用户主题配置 - if(!in_array($_GET['fn'],['home','login','register','transit','guide','article'])){ + if(!in_array($_GET['fn'],['home','login','register','transit','guide','article','verify','guestbook','apply'])){ msg(-1,"参数错误"); } $theme_config_db = get_db('user_config','v',['t'=>'theme_'.$_GET['fn'],'k'=>$theme,'uid'=>UID]); @@ -178,64 +180,6 @@ if( $page == 'theme_home' || $page == 'theme_login' || $page == 'theme_transit' } } - -//菜单接口 -if ($page == 'menu') { - $menu = []; - if(check_purview('site_info',1)){ - array_push($menu,['title'=>'站点设置','href'=>'SiteSetting','icon'=>'fa fa-cog']); - } - if(check_purview('theme_in',1)){ - array_push($menu,['title'=>'主题设置','href'=>'theme_home','icon'=>'fa fa-magic']); - } - array_push($menu, - ['title'=>'分类管理','href'=>'category_list','icon'=>'fa fa-list-ul'], - ['title'=>'加密管理','href'=>'pwd_group','icon'=>'fa fa-lock'], - ['title'=>'链接管理','icon'=>'fa fa-folder-open-o','href'=>'','child'=> - [ - ['title'=>'链接列表','href'=>'link_list','icon'=>'fa fa-link'], - ['title'=>'添加链接','href'=>'link_add','icon'=>'fa fa-plus-square-o'], - ['title'=>'书签分享','href'=>'share','icon'=>'fa fa-external-link'], - ['title'=>'导出导入','href'=>'data_control','icon'=>'fa fa-retweet'], - ] - ]); - - //扩展功能 - $extend = []; - if($global_config['apply'] == 1 && check_purview('apply',1)){ - array_push($extend,['title'=>'收录管理','href'=>'expand/apply-admin','icon'=>'fa fa-pencil']); - } - if($global_config['guestbook'] == 1 && check_purview('guestbook',1)){ - array_push($extend,['title'=>'留言管理','href'=>'expand/guestbook-admin','icon'=>'fa fa-commenting-o']); - } - if($global_config['article'] > 0 && check_purview('article',1)){ - array_push($extend,['title'=>'文章管理','href'=>'expand/article-list','icon'=>'fa fa-file-text-o']); - } - if(!empty($extend)){ - $extend = ['title'=>'扩展功能','icon'=>'fa fa-folder-open-o','href'=>'','child'=> $extend]; - array_push($menu,$extend); - } - - //如果是管理员则追加菜单 - if($USER_DB['UserGroup'] == 'root'){ - array_push($menu, - ['title'=>'网站管理','icon'=>'fa fa-wrench','href'=>'','child'=> - [ - ['title'=>'系统设置','href'=>'root/sys_setting','icon'=>'fa fa-gears'], - ['title'=>'授权管理','href'=>'root/vip','icon'=>'fa fa-diamond'], - //['title'=>'默认设置','href'=>'root/default_setting','icon'=>'fa fa-heart-o'], - ['title'=>'用户管理','href'=>'root/user_control','icon'=>'fa fa-user'], - ['title'=>'用户分组','href'=>'root/users_control','icon'=>'fa fa-users'], - ['title'=>'注册管理','href'=>'root/reg_control','icon'=>'fa fa-user-plus'], - ['title'=>'站长工具','href'=>'root/tool','icon'=>'fa fa-exclamation-triangle'], - ] - ]); - } - $init = array( 'homeInfo'=>['title'=>'概要','href'=>'home'],'logoInfo'=>['title'=>'TwoNav','image'=>'./templates/admin/img/logo.png','href'=>'./?u='.U],'menuInfo'=>$menu); - header('Content-Type:application/json; charset=utf-8'); - exit(json_encode($init)); -} - //不带参数是载入框架 if(empty($page)){ $site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); diff --git a/system/api.php b/system/api.php index a570f30..4b9048a 100644 --- a/system/api.php +++ b/system/api.php @@ -680,10 +680,6 @@ function write_link(){ update_db('user_links',['weight'=>$key[1]],['uid'=>UID,'lid'=>$key[0]]); } msg(1,'保存成功'); - - msg(-1,'未支持'); - - //私有切换 }elseif($_GET['type'] === 'property_sw' ){ update_db('user_links',['property'=>intval($_POST['property']) ],['uid'=>UID,'lid'=>intval($_POST['lid']) ],[1,'保存成功']); @@ -1175,20 +1171,21 @@ function write_transit_setting(){ '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){ - if($data['int']){ - $s[$key] = ($_POST[$key] >= $data['min'] && $_POST[$key] <= $data['max'])?intval($_POST[$key]):msg(-1,$data['msg']); - }elseif(isset($data['v'])){ - $s[$key] = in_array($_POST[$key],$data['v']) ? $_POST[$key]:msg(-1,$data['msg']); - }else{ - $s[$key] = $data['empty']?$_POST[$key]:(!empty($_POST[$key])?$_POST[$key]:msg(-1,$data['msg'])); - } - } + $s = Post_data_filter($datas); write_user_config('s_transition_page',$s,'config','过渡页配置'); msg(1,"保存成功!"); } +//写验证页配置 +function write_verify_page(){ + $datas = [ + 'link_tip'=>['empty'=>true], + 'share_tip'=>['empty'=>true] + ]; + $s = Post_data_filter($datas); + write_user_config('s_verify_page',$s,'config','验证页配置'); + msg(1,"保存成功!"); +} //修改密码 function write_user_password(){ @@ -1358,10 +1355,137 @@ function other_testing_link(){ msgA(['code' => 0 ,'StatusCode'=> $code]); } +//读主题信息 +function read_theme(){ + global $global_config; + global $USER_DB; + // 检查权限 + if(!check_purview('theme_in',1)){ + msg(-1,'无权限'); + } + + $check_dirs = ['home','login','transit','register','guide','article','apply','verify','guestbook']; + $request_dir = $_GET['dir']; + if(in_array($request_dir,$check_dirs)){ + if(in_array($request_dir,['register','guide']) && $USER_DB['UserGroup'] != 'root' ){ + msg(-1,'管理此模板需管理员权限'); + } + }else{ + msg(-1,'dir参数错误'); + } + $son_dirs = get_dir_list(DIR.'/templates/'.$request_dir); + + foreach ($son_dirs as $son_dir) { + $path = DIR.'/templates/'.$request_dir.'/'.$son_dir; //目录完整路径 + //没有信息文件则跳过 + if(!is_file($path.'/info.json') ) {continue;} + //读取主题信息 + $themes[$son_dir] = json_decode(@file_get_contents($path.'/info.json'),true); + //是否支持配置 + $themes[$son_dir]['config'] = is_file($path.'/config.php') ? '1':'0'; + //预览图优先顺序:png>jpg>info>default + if(is_file($path.'/screenshot.jpg')){ + $themes[$son_dir]['screenshot'] = "./templates/$request_dir/$son_dir/screenshot.jpg"; + }elseif(is_file($path.'/screenshot.png')){ + $themes[$son_dir]['screenshot'] = "./templates/$request_dir/$son_dir/screenshot.png"; + }elseif(empty($themes[$son_dir]['screenshot'])){ + $themes[$son_dir]['screenshot'] = "./templates/admin/static/42ed3ef2c4a50f6d.png"; + } + } + + function filter($arr){ + foreach($arr as $key => $data){ + $new[$key]['name'] = $data['name'] ?? 'null'; + $new[$key]['description']= $data['description'] ?? 'null'; + $new[$key]['homepage']= $data['homepage'] ?? 'null'; + $new[$key]['version']= $data['version'] ?? 'null'; + $new[$key]['update']= $data['update'] ?? 'null'; + $new[$key]['author']= $data['author'] ?? 'null'; + $new[$key]['screenshot']= $data['screenshot'] ?? 'null'; + $new[$key]['config'] = $data['config'] ?? '0'; + $new[$key]['state'] = $data['up'] == 1 ? 'up' : (empty($data['dir']) ? 'local' : 'dw'); + } + return $new; + } + + //在线主题处理 + if ( !$global_config['offline'] && $USER_DB['UserGroup'] === 'root'){ + + if(preg_match('/^v.+-(\d{8})$/i',SysVer,$matches)){ + $sysver = intval( $matches[1] );//取版本中的日期 + }else{ + msg(-1,'获取程序版本异常'); + } + + //读取缓存 + $page = 'theme_'.$request_dir; + $template = get_db('global_config','v',['k'=>$page.'_cache']); + if(!empty($template)){ + $data = json_decode($template, true); + } + + //没有缓存 或 禁止缓存 或 缓存过时 + if(empty($template) || $_GET['cache'] === 'no' || time() - $data["time"] > 1800 ){ + $urls = [ + "lm21" => "https://update.lm21.top/TwoNav/{$request_dir}_template.json", + "gitee" => "https://gitee.com/tznb/twonav_updata/raw/master/{$request_dir}_template.json" + ]; + $Source = $global_config['Update_Source'] ?? ''; + if (!empty($Source) && isset($urls[$Source])) { + $urls = [$Source => $urls[$Source]]; + } + }else{ + $cache = true; + } + //读取超时参数 + $overtime = !isset($global_config['Update_Overtime']) ? 3 : ($global_config['Update_Overtime'] < 3 || $global_config['Update_Overtime'] > 60 ? 3 : $global_config['Update_Overtime']); + //远程获取 + foreach($urls as $key => $url){ + $Res = ccurl($url,$overtime); + $data = json_decode($Res["content"], true); + if($data["code"] == 200 ){ //如果获取成功 + $data["time"] = time(); //记录当前时间 + write_global_config($page.'_cache',json_encode($data),$request_dir.'_模板缓存'); + break; //跳出循环. + } + } + //解析 + foreach($data["data"] as $key){ + $path = DIR.'/templates/'.$request_dir.'/'.$key["dir"]; + if( is_dir($path) ) { //本地存在 + $value = $key["dir"]; + //检查是否可以更新 + $update = str_replace('/','',$themes[$value]['update']); //本地主题版本 + $update_new = str_replace('/','',$key["update"]); //远程主题版本 + if( $sysver >= intval($key["low"]) && $sysver <= intval($key["high"]) && $update < $update_new ){ + $themes[$value]['up'] = '1'; + } + }else{ + //判断是否适配当前系统版本 + if( $sysver >= intval($key["low"]) && $sysver <= intval($key["high"]) ){ + $value = $key["dir"]; + $themes[$value] = json_decode(json_encode($key),true); + } + } + } + } + + //取正在使用的模板 + $s_templates = unserialize(get_db("user_config", "v", ["uid"=>UID,"k"=>"s_templates"])); + if($request_dir == 'home'){ + $current['home_pad'] = $s_templates['home_pad'] ?? 'default'; + $current['home_pc'] = $s_templates['home_pc'] ?? 'default'; + }else{ + $current[$request_dir] = $s_templates[$request_dir] ?? 'default'; + } + + $themes = filter($themes); + msgA(['code'=>1,'data'=>$themes,'current'=>$current,'referrer'=>($data['referrer'] ?? '')]); +} //主题下载/更新/删除 function write_theme(){ global $global_config; - $fn = $_POST['fn'];if($_GET['type'] != 'config' && !in_array($fn,['home','login','transit','register','guide','article'])){msg(-1,'fn参数错误');} + $fn = $_POST['fn'];if($_GET['type'] != 'config' && !in_array($fn,['home','login','transit','register','guide','article','verify','guestbook','apply'])){msg(-1,'fn参数错误');} if($_GET['type'] == 'download'){ is_root(); if($global_config['offline']){msg(-1,"离线模式禁止下载主题!");} //离线模式 @@ -1466,6 +1590,11 @@ function write_theme(){ //读取用户模板配置 require DIR."/system/templates.php"; + if($fn == 'register' || $fn == 'guide'){ + $global_templates[$fn] = $name; + update_db('global_config',['v'=>$global_templates],['k'=>'s_templates'],[1,'操作成功']); + } + //判断设置的类型 if($fn == 'home'){ if( $type == 'PC/Pad'){ @@ -1478,18 +1607,8 @@ function write_theme(){ }else{ msg(-1,'参数错误'); } - }elseif($fn == 'login'){ - $s_templates['login'] = $name; - }elseif($fn == 'transit'){ - $s_templates['transit'] = $name; - }elseif($fn == 'article'){ - $s_templates['article'] = $name; - }elseif($fn == 'register'){ - $global_templates['register'] = $name; - update_db('global_config',['v'=>$global_templates],['k'=>'s_templates'],[1,'注册模板设置成功']); - }elseif($fn == 'guide'){ - $global_templates['guide'] = $name; - update_db('global_config',['v'=>$global_templates],['k'=>'s_templates'],[1,'引导页模板设置成功']); + }else{ + $s_templates[$fn] = $name; } //更新数据 update_db('user_config',['v'=>$s_templates],['uid'=>UID,'k'=>'s_templates'],[1,'设置成功']); @@ -1508,7 +1627,7 @@ function write_theme(){ msg(-1,"获取模板类型错误"); } $fn = empty($GET['fn']) ? $_GET['template_type'] : $GET['fn']; - if(!in_array($fn,['home','login','register','transit','guide','article'])){ + if(!in_array($fn,['home','login','transit','register','guide','article','verify','guestbook','apply'])){ msg(-1,"参数错误"); } //0420 END @@ -1836,6 +1955,59 @@ function read_data(){ $day_data[$date] = empty($list) ? [] : $list ; } msgA(['code'=>1,'data'=>$day_data]); + }elseif($_GET['type'] == 'menu'){ + global $global_config; + $menu = []; + if(check_purview('site_info',1)){ + array_push($menu,['title'=>'站点设置','href'=>'SiteSetting','icon'=>'fa fa-cog']); + } + if(check_purview('theme_in',1)){ + array_push($menu,['title'=>'主题管理','href'=>'theme','icon'=>'fa fa-magic']); + } + array_push($menu, + ['title'=>'分类管理','href'=>'category_list','icon'=>'fa fa-list-ul'], + ['title'=>'加密管理','href'=>'pwd_group','icon'=>'fa fa-lock'], + ['title'=>'链接管理','icon'=>'fa fa-folder-open-o','href'=>'','child'=> + [ + ['title'=>'链接列表','href'=>'link_list','icon'=>'fa fa-link'], + ['title'=>'添加链接','href'=>'link_add','icon'=>'fa fa-plus-square-o'], + ['title'=>'书签分享','href'=>'share','icon'=>'fa fa-external-link'], + ['title'=>'导出导入','href'=>'data_control','icon'=>'fa fa-retweet'], + ] + ]); + + //扩展功能 + $extend = []; + if($global_config['apply'] == 1 && check_purview('apply',1)){ + array_push($extend,['title'=>'收录管理','href'=>'expand/apply-admin','icon'=>'fa fa-pencil']); + } + if($global_config['guestbook'] == 1 && check_purview('guestbook',1)){ + array_push($extend,['title'=>'留言管理','href'=>'expand/guestbook-admin','icon'=>'fa fa-commenting-o']); + } + if($global_config['article'] > 0 && check_purview('article',1)){ + array_push($extend,['title'=>'文章管理','href'=>'expand/article-list','icon'=>'fa fa-file-text-o']); + } + if(!empty($extend)){ + $extend = ['title'=>'扩展功能','icon'=>'fa fa-folder-open-o','href'=>'','child'=> $extend]; + array_push($menu,$extend); + } + + //如果是管理员则追加菜单 + if($USER_DB['UserGroup'] == 'root'){ + array_push($menu, + ['title'=>'网站管理','icon'=>'fa fa-wrench','href'=>'','child'=> + [ + ['title'=>'系统设置','href'=>'root/sys_setting','icon'=>'fa fa-gears'], + ['title'=>'授权管理','href'=>'root/vip','icon'=>'fa fa-diamond'], + ['title'=>'用户管理','href'=>'root/user_control','icon'=>'fa fa-user'], + ['title'=>'用户分组','href'=>'root/users_control','icon'=>'fa fa-users'], + ['title'=>'注册管理','href'=>'root/reg_control','icon'=>'fa fa-user-plus'], + ['title'=>'站长工具','href'=>'root/tool','icon'=>'fa fa-exclamation-triangle'], + ] + ]); + } + $init = array( 'homeInfo'=>['title'=>'概要','href'=>'home'],'logoInfo'=>['title'=>'TwoNav','image'=>'./templates/admin/img/logo.png','href'=>'./?u='.U],'menuInfo'=>$menu); + msgA($init); } } @@ -1887,3 +2059,17 @@ function other_get_link_info(){ $link['description'] = $info['site_description']; msgA(['code'=>1,'data'=>$link]); } + +//POST数据过滤 +function Post_data_filter($datas){ + foreach ($datas as $key => $data){ + if($data['int']){ + $s[$key] = ($_POST[$key] >= $data['min'] && $_POST[$key] <= $data['max'])?intval($_POST[$key]):msg(-1,$data['msg']); + }elseif(isset($data['v'])){ + $s[$key] = in_array($_POST[$key],$data['v']) ? $_POST[$key]:msg(-1,$data['msg']); + }else{ + $s[$key] = $data['empty']?$_POST[$key]:(!empty($_POST[$key])?$_POST[$key]:msg(-1,$data['msg'])); + } + } + return $s; +} \ No newline at end of file diff --git a/system/click.php b/system/click.php index 7505d05..f28135b 100644 --- a/system/click.php +++ b/system/click.php @@ -4,7 +4,7 @@ $id = intval($_GET['id']); //IP数统计 count_ip(); //如果id为空,则显示404 -if(empty($id)){Not_Found();} +if(empty($id)) Not_Found(); //查询链接信息 $where['lid'] = $id; @@ -13,18 +13,7 @@ $where['status'] = 1; $link = get_db('user_links','*',$where); //查找失败时显示404 -if(empty($link)){Not_Found();} - -//站点设置和站点图标 -$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); -$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(); +if(empty($link)) Not_Found(); //取父分类和祖分类信息 $info_c = ['cid','fid','property','status','pid']; @@ -72,7 +61,9 @@ if(!$is_login){ $verify_type = 'link_pwd'; $password = get_db('user_pwd_group','password',['uid'=>UID,'pid'=>$link['pid']]); if($_SESSION['verify']['link'][$link['lid']] != $password){ - require DIR.'/templates/admin/other/verify_link_pwd.php'; + $c = 'verify'; + require DIR."/system/templates.php"; + require $index_path; exit(); } } @@ -81,7 +72,9 @@ if(!$is_login){ $verify_type = 'category_pwd'; $password = get_db('user_pwd_group','password',['uid'=>UID,'pid'=>$category_parent['pid']]); if($_SESSION['verify']['category'][$category_parent['cid']] != $password){ - require DIR.'/templates/admin/other/verify_link_pwd.php'; + $c = 'verify'; + require DIR."/system/templates.php"; + require $index_path; exit(); } } @@ -90,39 +83,22 @@ if(!$is_login){ $verify_type = 'category_pwd'; $password = get_db('user_pwd_group','password',['uid'=>UID,'pid'=>$category_ancestor['pid']]); if($_SESSION['verify']['category'][$category_ancestor['cid']] != $password){ - require DIR.'/templates/admin/other/verify_link_pwd.php'; + $c = 'verify'; + require DIR."/system/templates.php"; + require $index_path; exit(); } } } -//取模板信息 -require DIR ."/system/templates.php"; -$dir_path = DIR.'/templates/transit/'.$s_templates['transit']; -$theme_dir = str_replace(DIR.'/templates/transit',"./templates/transit",$dir_path); -$transit_path = $dir_path.'/index.php'; -//检查是否存在,不存在则使用默认 -if(!is_file($transit_path)){ - $transit_path= DIR.'/templates/transit/default/index.php'; -} //统计点击数 write_user_count(date('Ym'),'click_Ym'); write_user_count(date('Ymd'),'click_Ymd'); update_db("user_links", ["click[+]"=>1],['uid'=>UID,'lid'=>$id]); - - -//读取用户主题配置 -$theme_config_db = unserialize(get_db('user_config','v',['t'=>'theme_transit','k'=>$s_templates['transit'],'uid'=>UID])); - -//读取默认主题配置 -$theme_info = json_decode(@file_get_contents($dir_path.'/info.json'),true); -$theme_config = empty($theme_info['config']) ? []:$theme_info['config']; -$theme_ver = !Debug?$theme_info['version']:$theme_info['version'].'.'.time(); - -//合并配置数据 -$theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config??[],$theme_config_db??[]); +//通用数据初始化 +require DIR."/system/templates.php"; //如果主题信息声明支持扩展字段 if($global_config['link_extend'] == 1 && check_purview('link_extend',1) && in_array($theme_info['support']['link_extend'],["true","1"])){ @@ -154,11 +130,11 @@ if(!empty($link['url_standby'])) { if(in_array(intval($code),[200,301,302,401]) ){ $site['link_model'] = $site['link_model'] == 'direct' ? '302' : $site['link_model']; }else{ - require $transit_path; + require $index_path; exit; } }else{ - require $transit_path; + require $index_path; exit; } } @@ -185,11 +161,6 @@ if ($site['link_model'] == '302'){ //302重定向(临时) echo '正在保护您的隐私..'; exit; }else{ //Transition 过渡页 - require $transit_path; + require $index_path; exit; } - -//返回404 -function Not_Found() { - header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit; -} diff --git a/system/expand/apply.php b/system/expand/apply.php index 0dd3bbb..355b96f 100644 --- a/system/expand/apply.php +++ b/system/expand/apply.php @@ -18,7 +18,8 @@ if ( $apply['apply'] == 0 ){ } //get请求载入页面 if($_SERVER['REQUEST_METHOD'] === 'GET'){ - require DIR.'/templates/admin/page/expand/apply-user.php'; + require DIR."/system/templates.php"; + require($index_path); exit; } //载入提示页 diff --git a/system/expand/article.php b/system/expand/article.php index 0768b54..828da13 100644 --- a/system/expand/article.php +++ b/system/expand/article.php @@ -1,65 +1,28 @@ UID,'k'=>'s_site'])); -$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'; - - -//取模板信息 -require DIR ."/system/templates.php"; -$dir_path = DIR.'/templates/article/'.$s_templates['article']; -$theme_dir = str_replace(DIR.'/templates/article',"./templates/article",$dir_path); -$path = $dir_path.'/index.php'; -//检查是否存在,不存在则使用默认 -if(!is_file($path)){ - $path= DIR.'/templates/article/default/index.php'; - $theme_dir = './templates/article/default'; -} +if(empty($data)) Not_Found(); //统计点击数 update_db("user_article_list", ["browse_count[+]"=>1],['uid'=>UID,'id'=>$id]); -//读取用户主题配置 -$theme_config_db = unserialize(get_db('user_config','v',['t'=>'theme_article','k'=>$s_templates['article'],'uid'=>UID])); - -//读取默认主题配置 -$theme_info = json_decode(@file_get_contents($theme_dir.'/info.json'),true); -$theme_config = empty($theme_info['config']) ? []:$theme_info['config']; -$theme_ver = !Debug?$theme_info['version']:$theme_info['version'].'.'.time(); - -//合并配置数据 -$theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config??[],$theme_config_db??[]); - -require $path; -exit; - -//返回404 -function Not_Found() { - header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit; -} \ No newline at end of file +//载入模板 +require $index_path; diff --git a/system/expand/guestbook.php b/system/expand/guestbook.php index c4c9150..8e76ecf 100644 --- a/system/expand/guestbook.php +++ b/system/expand/guestbook.php @@ -16,23 +16,23 @@ if(!Check_Path("data/user/{$u}/MessageBoard")){ //POST提交留言 if($_SERVER['REQUEST_METHOD'] === 'POST'){ - if($s['allow'] != '1'){ msg(-1015,'提交失败,当前禁止留言!'); } + if($s['allow'] != '1'){ msg(-1,'提交失败,当前禁止留言!'); } $type = $_POST['type']; //类型 $contact = $_POST['contact']; //联系方式 $title = $_POST['title']; //标题 $content = $_POST['content']; //内容 if(empty($type)){ - msg(-1015,'提交失败,类型不能为空'); + msg(-1,'提交失败,类型不能为空'); }elseif(empty($contact)){ - msg(-1015,'提交失败,联系方式不能为空'); + msg(-1,'提交失败,联系方式不能为空'); }elseif(empty($title)){ - msg(-1015,'提交失败,标题不能为空'); + msg(-1,'提交失败,标题不能为空'); }elseif(empty($content)){ - msg(-1015,'提交失败,内容不能为空'); + msg(-1,'提交失败,内容不能为空'); }elseif(strlen($type) >= 32 || strlen($contact) >= 64 || strlen($title) >= 128 || strlen($content) >= 2048){ - msg(-1015,'提交失败,长度超限'); + msg(-1,'提交失败,长度超限'); }elseif(ShuLiang("data/user/{$u}/MessageBoard/") > 256){ - msg(-1015,'提交失败,留言太多了请稍后再试'); + msg(-1,'提交失败,留言太多了请稍后再试'); } $json_arr = array( @@ -48,9 +48,9 @@ if($_SERVER['REQUEST_METHOD'] === 'POST'){ $json = json_encode($json_arr); $path = "data/user/{$u}/MessageBoard/".time().'_'.crc32($json).'.json'; if( Check_Path("data/user/{$u}/MessageBoard") && file_put_contents($path, $json)){ - msg(0,'提交成功'); + msg(1,'提交成功'); }else{ - msg(-1015,'系统错误,提交失败'); //创建目录或写入文件失败,请检查权限 + msg(-1,'系统错误,提交失败'); //创建目录或写入文件失败,请检查权限 } } @@ -67,5 +67,8 @@ function ShuLiang($path){ } return $sl; } -require DIR.'/templates/admin/page/expand/guestbook-user.php'; + +//通用数据初始化 +require DIR."/system/templates.php"; +require $index_path; exit; \ No newline at end of file diff --git a/system/index.php b/system/index.php index 1fdc75d..cf3755a 100644 --- a/system/index.php +++ b/system/index.php @@ -1,6 +1,60 @@ UID,'sid'=>$share]); + if(empty($share)){ + $content = '分享已被删除,请联系作者!'; + require DIR.'/templates/admin/page/404.php'; + exit; + } + //判断是否过期 + if(time() > $share['expire_time']){ + $content = '分享已过期,请联系作者!'; + require DIR.'/templates/admin/page/404.php';; + exit; + } + //判断是否加密 + if(!empty($share['pwd']) && !is_login()){ + session_start(); + if($_SESSION['verify']['share'][$share['id']] != $share['pwd']){ + $c = 'verify';$_GET['c'] = 'share'; + require DIR."/system/templates.php"; + require $index_path; + exit; + } + } + + $data = json_decode($share['data']); + //判断分享类型(1.分类 2.链接) + if($share['type'] == 1){ + $where['cid'] = $data; + if($share['pv'] == 1){ + unset($where['property']); + } + }else if($share['type'] == 2){ + $category_parent = [['name' => $share['name'] ,"font_icon" =>"fa fa-bookmark-o" , "id" => 'share' ,"description" => "书签分享"]]; + $categorys = $category_parent; + } + + //浏览计次 + update_db("user_share", ["views[+]"=>1],['uid'=>UID,'id'=>$share['id']]); +} + + +//通用数据初始化 +require DIR."/system/templates.php"; //判断用户组,是否允许未登录时访问主页 if(!is_login && ($global_config['Privacy'] == 1 || !check_purview('Common_home',1))){ @@ -8,73 +62,10 @@ if(!is_login && ($global_config['Privacy'] == 1 || !check_purview('Common_home', header("Location: ./?c=admin&u=".U); exit; } -//载入站点设置 -$site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); -//如果没有权限则清除自定义代码 -if(!check_purview('header',1)){$site['custom_header'] = '';} -if(!check_purview('footer',1)){$site['custom_footer'] = '';} -$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'; +//例外主题,不支持热门网址/最新网址/输出上限 +$site['ex_theme'] = in_array($theme,['snail-nav','heimdall']); -//读取默认模板信息 -require DIR ."/system/templates.php"; -//引导页 -if(!empty($global_config['default_page']) && $global_config['default_page'] == 2){ - if(empty(Get('u')) && empty($_COOKIE['Default_User'])){ - $theme = $global_templates['guide']; - $dir_path = DIR.'/templates/guide/'.$global_templates['guide']; - $index_path = $dir_path.'/index.php'; - if(!is_file($index_path)){ - $dir_path= DIR.'/templates/guide/default'; - $index_path = $dir_path.'/index.php'; - } - $theme_dir = str_replace(DIR.'/templates/guide',"./templates/guide",$dir_path); - $theme_info = json_decode(@file_get_contents($dir_path.'/info.json'),true); - $theme_config = empty($theme_info['config']) ? []:$theme_info['config']; - $theme_config_db = get_db('user_config','v',['t'=>'theme_guide','k'=>$theme,'uid'=>UID]); - $theme_config_db = unserialize($theme_config_db); - $theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config,$theme_config_db); - require($index_path); - exit; - } -} -//参数指定主题优先 -$theme = trim(@$_GET['theme']); -if ( !empty ($theme) && check_purview('theme_in',1)){ - $dir_path = DIR.'/templates/home/'.$theme; - $index_path = $dir_path.'/index.php'; -}else{ - $is_Pad = preg_match('/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i',$_SERVER['HTTP_USER_AGENT']); - $theme = $is_Pad?$s_templates['home_pad']:$s_templates['home_pc']; - $dir_path = DIR.'/templates/home/'.$theme; - $index_path = $dir_path.'/index.php'; -} -//检查是否存在,不存在则使用默认 -if(!is_file($index_path)){ - $dir_path= DIR.'/templates/home/default'; - $index_path = $dir_path.'/index.php'; -} -//相对路径 -$theme_dir = str_replace(DIR.'/templates/home',"./templates/home",$dir_path); -//主题信息 -$theme_info = json_decode(@file_get_contents($dir_path.'/info.json'),true); -//支持属性 -$support_subitem = $theme_info['support']['subitem']??0; //0.不支持子分类 1.分类栏支持 2.链接栏支持 3.都支持 -$support_category_svg = $theme_info['support']['category_svg']??0; //0.不支持 1.支持 -//主题配置(默认) -$theme_config = empty($theme_info['config']) ? []:$theme_info['config']; -//主题配置(用户) -$theme_config_db = get_db('user_config','v',['t'=>'theme_home','k'=>$theme,'uid'=>UID]); -$theme_config_db = unserialize($theme_config_db); -//合并配置数据 -$theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config,$theme_config_db); -//主题版本(调试时追加时间戳) -$theme_ver = !Debug?$theme_info['version']:$theme_info['version'].'.'.time(); -$site['ex_theme'] = in_array($theme,['snail-nav','heimdall']); //例外主题,不支持热门网址/最新网址/输出上限 //分类查找条件 $categorys = []; //声明一个空数组 $content = ['cid(id)','fid','name','property','font_icon','icon','description'];//需要的内容 @@ -219,7 +210,7 @@ function get_links($fid) { }else{ //首字 $icon = './system/ico.php?text='.mb_strtoupper(mb_substr($article['title'], 0, 1)); } - $article_link = ['type'=>'article','id'=>0,'title'=>$article['title'],'url'=>$url,'real_url'=>$url,'description'=>$article['summary'],'ico'=>$icon,'icon'=>$icon]; + $article_link = ['type'=>'article','id'=>0,'title'=>htmlspecialchars($article['title'],ENT_QUOTES),'url'=>$url,'real_url'=>$url,'description'=> htmlspecialchars($article['summary'],ENT_QUOTES),'ico'=>$icon,'icon'=>$icon]; //判断靠前还是靠后 if($site['article_visual'] == '1'){ array_unshift($links,$article_link); @@ -239,45 +230,7 @@ function get_links($fid) { return $links; } -//书签分享 -$share = Get('share'); -if(!empty($share)){ - $share = get_db('user_share','*',['uid'=>UID,'sid'=>$share]); - if(empty($share)){ - $content = '分享已被删除,请联系作者!'; - require DIR.'/templates/admin/page/404.php'; - exit; - } - //判断是否过期 - if(time() > $share['expire_time']){ - $content = '分享已过期,请联系作者!'; - require DIR.'/templates/admin/page/404.php';; - exit; - } - //判断是否加密 - if(!empty($share['pwd']) && !is_login){ - session_start(); - if($_SESSION['verify']['share'][$share['id']] != $share['pwd']){ - require DIR.'/templates/admin/other/verify_share_pwd.php'; - exit; - } - } - - $data = json_decode($share['data']); - //判断分享类型(1.分类 2.链接) - if($share['type'] == 1){ - $where['cid'] = $data; - if($share['pv'] == 1){ - unset($where['property']); - } - }else if($share['type'] == 2){ - $category_parent = [['name' => $share['name'] ,"font_icon" =>"fa fa-bookmark-o" , "id" => 'share' ,"description" => "书签分享"]]; - $categorys = $category_parent; - } - - //浏览计次 - update_db("user_share", ["views[+]"=>1],['uid'=>UID,'id'=>$share['id']]); -} + //如果为空则查找分类 if($category_parent == []){ diff --git a/system/install.php b/system/install.php index cc72942..3f07b5b 100644 --- a/system/install.php +++ b/system/install.php @@ -161,7 +161,8 @@ $db_config = array( 'port' => $_POST['db_port'], 'database' => $_POST['db_name'], 'username' => $_POST['db_user'], - 'password' => $_POST['db_password'] + 'password' => $_POST['db_password'], + 'charset' => 'utf8mb4' ]); //判断版本,目前基于5.6.50开发,其他版本兼容性未知,若您需要强制安装请屏蔽检测 diff --git a/system/login.php b/system/login.php index 825b248..8782948 100644 --- a/system/login.php +++ b/system/login.php @@ -2,15 +2,8 @@ //如果是Get请求则载入登录模板 if($_SERVER['REQUEST_METHOD'] === 'GET'){ - require DIR ."/system/templates.php"; - $t_path = DIR ."/templates/login/{$s_templates['login']}/index.php"; //模板路径 - $copyright = empty($global_config['copyright'])?'Copyright © TwoNav':$global_config['copyright']; - $ICP = empty($global_config['ICP'])?'':''.$global_config['ICP'].''; - //检查是否存在,不存在则使用默认 - if(!is_file($t_path)){ - $t_path = DIR.'/templates/login/default/index.php'; - } - require $t_path; + require DIR."/system/templates.php"; + require $index_path; exit; } diff --git a/system/templates.php b/system/templates.php index 8411487..aad5cbc 100644 --- a/system/templates.php +++ b/system/templates.php @@ -3,99 +3,197 @@ //读取全局模板配置 $global_templates = unserialize(get_db("global_config",'v', ["k" => "s_templates"])); -//读取用户模板配置 -$s_templates = unserialize(get_db("user_config", "v", ["uid"=>UID,"k"=>"s_templates"])); - -//没找到用户模板配置 -if(empty($s_templates)){ - //将全局默认模板配置写到用户配置 - $s_templates = $global_templates; - insert_db("user_config", ["uid" => UID,"k"=>"s_templates","v"=>$global_templates,"t"=>"config","d" => '默认模板']); +if(defined('UID')){ + //读取用户模板配置 + $s_templates = unserialize(get_db("user_config", "v", ["uid"=>UID,"k"=>"s_templates"])); + //没找到用户模板配置 + if(empty($s_templates)){ + $s_templates = $global_templates; + insert_db("user_config", ["uid" => UID,"k"=>"s_templates","v"=>$global_templates,"t"=>"config","d" => '默认模板']); + } + //声明是否已登录 + define('is_login',is_login()); $is_login = is_login; } -//载入辅助函数 -if(empty($c) || in_array($c,['index','click','article'])){ - //将URL转换为base64编码 - function base64($url){ - $urls = parse_url($url); - $scheme = empty( $urls['scheme'] ) ? 'http://' : $urls['scheme'].'://'; //获取请求协议 - $host = $urls['host']; //获取主机名 - $port = empty( $urls['port'] ) ? '' : ':'.$urls['port']; //获取端口 - $new_url = $scheme.$host.$port; - return base64_encode($new_url); +//根据请求来读取模板名 +if($c == 'index'){ + $theme = trim(@$_GET['theme']); //主题预览 + if (empty($theme)){ + $is_Pad = preg_match('/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i',$_SERVER['HTTP_USER_AGENT']); + $theme = $is_Pad ? $s_templates['home_pad'] : $s_templates['home_pc']; } - //是否启用收录 - function is_apply(){ - global $global_config; - $apply_user = unserialize( get_db("user_config", "v", ["k" => "apply","uid"=>UID])); - return ($global_config['apply'] == 1 && $apply_user['apply'] > 0); - } - //是否启用留言 - function is_guestbook(){ - global $global_config; - $guestbook_user = unserialize( get_db("user_config", "v", ["k" => "guestbook","uid"=>UID]) ); - return ($global_config['guestbook'] == 1 && $guestbook_user['allow'] == 1); - - } - //获取图标URL - function geticourl($icon,$link){ - if( !empty( $link['icon']) ){ - if(substr($link['icon'], 0,4) == ' "s_verify_page","uid"=>$USER_DB['ID']])); + $data['get_tip'] = $config['link_tip']; + }elseif($_GET['c'] == 'share'){ + $data['title'] = $share['name']; + $data['tip'] = '查看分享书签'; + $data['input_tip'] = '请输入提取码'; + $data['post_url'] = "./index.php?c=verify&type=share_pwd&u={$u}&share={$_GET['share']}"; + $config = unserialize(get_db("user_config", "v", ["k" => "s_verify_page","uid"=>$USER_DB['ID']])); + $data['get_tip'] = $config['share_tip']; + }elseif($_GET['c'] == 'pwd2'){ + $data['title'] = '验证二级密码'; + $data['tip'] = '验证二级密码'; + $data['input_tip'] = '请输入二级密码'; + $data['post_url'] = "./index.php?c=verify&type=pwd2&u={$u}"; } + $theme = $s_templates['verify']; + $dir_path = DIR.'/templates/verify'; +}elseif($c == 'article'){ //文章 + $theme = $s_templates['article']; + $dir_path = DIR.'/templates/article'; +}elseif($c == 'guestbook'){ //留言 + $theme = $s_templates['guestbook']; + $dir_path = DIR.'/templates/guestbook'; +}elseif($c == 'apply'){ //收录 + $theme = $s_templates['apply']; + $dir_path = DIR.'/templates/guestbook/'; +}elseif($c == $global_config['Login'] || $c == $USER_DB['Login']){ //登录 + $theme = $s_templates['login']; + $dir_path = DIR.'/templates/login'; +}elseif($c == $global_config["Register"] ){ //注册 + $theme = $global_templates['register']; + $dir_path = DIR.'/templates/register'; +}elseif($c == 'guide'){ //引导页,由主页修改$c + $theme = $global_templates['guide']; + $dir_path = DIR.'/templates/guide'; +} +//模板类型(用于读取配置) +$templates_type = substr($dir_path, strrpos($dir_path, "/") + 1) ; + +//无权限或不存在使用默认 +if( !check_purview('theme_in',1) || !is_file("{$dir_path}/{$theme}/index.php")){ + $theme = 'default'; + $dir_path .= '/default'; + $index_path = $dir_path.'/index.php'; +}else{ + $dir_path .= '/'.$theme; + $index_path = $dir_path.'/index.php'; +} + +//相对路径 +$theme_dir = str_replace(DIR,'.',$dir_path); +//主题信息 +$theme_info = json_decode(@file_get_contents($dir_path.'/info.json'),true); +//主题配置(默认) +$theme_config = empty($theme_info['config']) ? []:$theme_info['config']; + + +if(defined('UID')){ + //主题配置(用户) + $theme_config_db = get_db('user_config','v',['t'=>"theme_{$templates_type}",'k'=>$theme,'uid'=>UID]); + $theme_config_db = unserialize($theme_config_db); +}else{ + //主题配置(用户) + $theme_config_db = get_db('global_config','v',['t'=>"theme_{$templates_type}",'k'=>$theme]); + $theme_config_db = unserialize($theme_config_db); +} + +//合并配置数据 +$theme_config = empty($theme_config_db) ? $theme_config : array_merge ($theme_config,$theme_config_db); +//主题版本 +$theme_ver = Debug ? "{$theme_info['version']}.".time() : $theme_info['version']; + +if(defined('UID')){ + //载入站点设置 + $site = unserialize(get_db('user_config','v',['uid'=>UID,'k'=>'s_site'])); + //如果没有权限则清除自定义代码 + if(!check_purview('header',1)){$site['custom_header'] = '';} + if(!check_purview('footer',1)){$site['custom_footer'] = '';} + + //主页标题( 主标题 - 副标题 ) + $site['Title'] = $site['title'].(empty($site['subtitle'])?'':' - '.$site['subtitle']); + + //站点图标 + $favicon = ( !empty($site['site_icon_file'])) ? $site['site_icon'] : './favicon.ico'; +}else{ + //站点图标 + $favicon = './favicon.ico'; +} + +//版权信息 +$copyright = empty($global_config['copyright'])?'Copyright © TwoNav':$global_config['copyright']; + +//备案信息 +$ICP = empty($global_config['ICP'])?'':''.$global_config['ICP'].''; + +//是否启用收录 +function is_apply(){ + $apply_user = unserialize( get_db("user_config", "v", ["k" => "apply","uid"=>UID])); + return ($GLOBALS['global_config']['apply'] == 1 && $apply_user['apply'] > 0); +} +//是否启用留言 +function is_guestbook(){ + $guestbook_user = unserialize( get_db("user_config", "v", ["k" => "guestbook","uid"=>UID]) ); + return ($GLOBALS['global_config']['guestbook'] == 1 && $guestbook_user['allow'] == 1); +} + +//取URL域名 +function get_url_host($url, $get_scheme = false, $get_port = false){ + $urls = parse_url($url); + $host = $urls['host']; //获取主机名 + $port = $get_port === true ? ( empty( $urls['port'] ) ? '' : ':'.$urls['port']) : ''; + $scheme = $get_port === true ? ( empty( $urls['scheme'] ) ? 'http://' : $urls['scheme'].'://') : ''; //获取请求协议 + return $scheme.$host.$port; +} +//获取图标URL +function geticourl($icon,$link){ + if( !empty( $link['icon']) ){ + if(substr($link['icon'], 0,4) == ' 0){ $where['AND']['category'] = $category; @@ -126,19 +223,22 @@ function get_article_list($category = 0,$limit = 0){ //为文章添加分类名称 foreach ($datas as &$data) { $data['category_name'] = $categorys[$data['category']] ?? 'Null'; + $data['title'] = htmlspecialchars($data['title'],ENT_QUOTES); + $data['summary'] = htmlspecialchars($data['summary'],ENT_QUOTES); } return ['data'=>$datas,'count'=>$count]; } + //根据文章id获取内容 function get_article_content($id){ $where['uid'] = UID; if(!is_login()){ - $where['AND']['state'] = 1; //状态筛选 - }else{ - $where['AND']['OR']['state'] = [1,2]; //状态筛选 + $where['state'] = 1; //状态筛选 } $where['id'] = $id; $data = get_db('user_article_list','*',$where); + $data['title'] = htmlspecialchars($data['title'],ENT_QUOTES); + $data['summary'] = htmlspecialchars($data['summary'],ENT_QUOTES); $data['category_name'] = get_db('user_categorys','name',['uid'=>UID,'cid'=>$data['category']]); return $data; } @@ -177,4 +277,9 @@ function get_category_list($layer = false){ } } return $categorys; +} + +//返回404 +function Not_Found() { + header('HTTP/1.1 404 Not Found');header("status: 404 Not Found");exit; } \ No newline at end of file diff --git a/system/verify.php b/system/verify.php index 5f81ec1..df3a3e0 100644 --- a/system/verify.php +++ b/system/verify.php @@ -23,8 +23,8 @@ switch ($type) { break; case "pwd2": $LoginConfig = unserialize($USER_DB['LoginConfig']); - if($_POST['Password2'] === $LoginConfig['Password2']){ - setcookie($USER_DB['User'].'_Password2', md5($USER_DB['Password'].$_COOKIE[U.'_key'].$_POST['Password2']), 0,'','',false,true); + if($_POST['Password'] === $LoginConfig['Password2']){ + setcookie($USER_DB['User'].'_Password2', md5($USER_DB['Password'].$_COOKIE[U.'_key'].$_POST['Password']), 0,'','',false,true); msg(1,'二级密码正确!'); }else{ msg(-1,'二级密码错误!'); @@ -32,7 +32,7 @@ switch ($type) { break; case "link_pwd": //读取链接信息 - $link = get_db('user_links',['pid','fid','property'],['uid'=>UID,'lid'=>$_POST['id'],'status'=>1]); + $link = get_db('user_links',['pid','fid','property'],['uid'=>UID,'lid'=>$_GET['id'],'status'=>1]); if(empty($link)){ msg(-1,'链接不存在'); //查找链接失败 } @@ -44,7 +44,7 @@ switch ($type) { } if($password == $_POST['Password']){ session_start(); - $_SESSION['verify']['link'][$_POST['id']] = $password; + $_SESSION['verify']['link'][$_GET['id']] = $password; msg(1,'验证通过'); }else{ msg(-1,'密码错误!'); diff --git a/system/version.txt b/system/version.txt index 2144984..0e69520 100644 --- a/system/version.txt +++ b/system/version.txt @@ -1 +1 @@ -v2.0.36-20230823 \ No newline at end of file +v2.0.37-20230830 \ No newline at end of file diff --git a/templates/admin/index.php b/templates/admin/index.php index 2ce7c50..cbc3808 100644 --- a/templates/admin/index.php +++ b/templates/admin/index.php @@ -82,7 +82,7 @@ layui.config({version:""}); layui.use(['layer','miniAdmin'], function () { var layer = layui.layer; layui.miniAdmin.render({ - iniUrl: "./index.php?c=admin&page=menu&u="+u, + iniUrl: "./index.php?c=api&method=read_data&type=menu&u="+u, urlHashLocation: true, bgColorDefault: false, menuChildOpen: true, diff --git a/templates/admin/js/theme.js b/templates/admin/js/theme.js index bffc625..0cab8ca 100644 --- a/templates/admin/js/theme.js +++ b/templates/admin/js/theme.js @@ -1,140 +1,307 @@ - -layui.use(['form','miniTab'], function () { - var form = layui.form, - layer = layui.layer, - miniTab = layui.miniTab; - miniTab.listen(); - layer.photos({photos: '.img-list',anim: 5}); +layui.use(function(){ + var datas,local_theme,active; + var buttons = [ + {'name':'主页模板','dir':'home','display':true}, + {'name':'过渡模板','dir':'transit','display':true}, + {'name':'登录模板','dir':'login','display':true}, + {'name':'验证模板','dir':'verify','display':true}, + {'name':'收录模板','dir':'apply','display':apply}, + {'name':'留言模板','dir':'guestbook','display':guestbook}, + {'name':'文章模板','dir':'article','display':article}, + {'name':'注册模板','dir':'register','display':is_admin}, + {'name':'引导页模板','dir':'guide','display':is_admin} + ]; + var $tab = $('#tab'); + $tab.append(''); + $tab.append(''); + $tab.append(''); + buttons.forEach(item => { + if(item.display){ + $tab.append(``); + } + }); - //监听按钮 - $(".layui-btn-group .layui-btn").click(function () { - var dir= $(this).parent().attr("id");//取目录名key - var fn= $(this).parent().parent().attr("id");//取模板类型 - var type = $(this).attr("id");//取事件类型 - var data = datas[dir].info; - //console.log(data);alert('目录:'+dir+',类型:'+type+',模板类型:'+fn); - - if(type === 'dw' || type === 'up' ){ //下载或更新 - if (data.desc != null && data.desc.length != 0){ //存在描述时弹窗显示描述 - layer.open({title:data.name,content: data.desc,btn: ['下载', '取消'] - ,yes: function(index, layero){ - theme_download(dir,data.name,data.desc,fn); - },btn2: function(index, layero){ - return true; - },cancel: function(){ - return true; - } - }); - }else{ - theme_download(dir,data.name,data.desc,fn); - } - }else if(type === 'del' ){ //删除 - layer.confirm('确认删除?',{icon: 3, title:'温馨提示'}, function(index){ - theme_del(dir,fn); + var tag_btns = $('#tab .dir'); + local_theme = localStorage.getItem(u + "_theme_active") || 'home'; + local_theme = tag_btns.filter('[dir="' + local_theme + '"]'); + active = local_theme.length > 0 ? local_theme : tag_btns.first(); + $(active).addClass('layui-this'); //激活第一个 + active = $(active).attr('dir'); //取激活的dir + load_data(active); //加载数据 + //刷新按钮 + $('#refresh').click(function() { + load_data(active,true); + }); + //预览按钮 + $("#preview").click(function() { + window.open(`./index.php?c=${loginAddress}&u=${u}`); + }); + //提示信息 + $("#tips").click(function() { + let tip,url; + let title = $("#tab .layui-this:first").text(); + if(active == 'home'){ + tip = '部分模板来自其它开源项目, 本程序仅做适配
主题版权归原作者所有, 如有问题请联系!
注意: 部分模板可能不支持书签分享'; + }else if(active == 'login'){ + tip = '只有使用您的专属登录入口时才会生效,即:概要页面中的专属地址>登录'; + url = `./index.php?c=${loginAddress}&u=${u}`; + }else if(active == 'verify'){ + tip = '验证加密链接/加密分类/二级密码的页面样式'; + }else if(active == 'apply'){ + tip = '收录页面的样式,需在收录管理>设置>申请收录>开启'; + url = `./index.php?c=apply&u=${u}`; + }else if(active == 'guestbook'){ + tip = '留言板的页面样式,需在留言管理>当前设置>允许留言(点击蓝字切换)'; + url = `./index.php?c=guestbook&u=${u}`; + }else if(active == 'article'){ + tip = '浏览文章页面的样式,前端显示样式与后端编辑器不一致属正常现象!'; + }else if(active == 'register'){ + tip = '注册页面的样式'; + }else if(active == 'guide'){ + tip = '引导页面的样式,需将系统设置>默认页面>改为引导页面
未登录时直接访问域名显示引导页
登录后将显示用户主页'; + } + if(url != undefined){ + layer.alert(tip, {title:title,shadeClose: true,anim: 2,closeBtn: 0, + btn: ['预览', '确定'],btn1: function(){ + layer.closeAll(); + setTimeout(function() { window.open(url) }, 288); + } }); - - }else if(type === 'config' ){ //配置 - theme_config(dir,data.name,fn); - }else if(type === 'preview' ){ //预览 - if(fn == 'home'){ - window.open('./index.php?theme='+dir+'&u='+u); - }else{ - layer.msg('不支持预览此模板', {icon: 3});return; + }else{ + layer.alert(tip,{title:title,shadeClose: true,anim: 2,closeBtn: 0}); + } + }); + + //设置(目前仅用于过渡页) + $('#set_up').click(function() { + if(active == 'transit'){ + layer_open2('过渡页面设置',`/?c=admin&page=set_transit&u=${u}`); + }else if(active == 'verify'){ + layer_open2('过渡页面设置',`/?c=admin&page=set_verify&u=${u}`); + } + }); + + //切换tab按钮 + tag_btns.click(function() { + const dir = $(this).attr('dir'); + if(active == dir) return; + active = dir; + tag_btns.removeClass('layui-this').filter(this).addClass('layui-this'); + load_data(active); + localStorage.setItem(u + "_theme_active",active); + }); + + function layer_open2(title,url) { + layer.open({type: 2,title: title,shadeClose: true,area : ['100%','100%'],scrollbar: false,resize: false,content: url}); + } + //加载数据 + function load_data(dir,cache = false) { + const set_up = (dir == 'transit' || dir == 'verify'); + $("#set_up")[ set_up ? "show" : "hide"](); + $("#tips")[ !set_up ? "show" : "hide"](); + layer.load(1, {shade: [0.5,'#fff']});//加载层 + layer.msg('正在获取数据..', {icon: 16,time: 1000*300}); + $.post(`./index.php?c=api&method=read_theme&dir=${dir}&u=${u}&cache=${cache ? 'no':'yes'}`, function (r, status) { + layer.closeAll(); + if (r.code == 1) { + datas = r.data; + render_data(r); + } else { + layer.alert("获取数据失败,请重试!",{icon:5,title:'错误',anim: 2,closeBtn: 0,btn: ['刷新页面']},function () {location.reload();}); + } + }).fail(function () { + layer.alert("获取数据异常,请重试!",{icon:5,title:'错误',anim: 2,closeBtn: 0,btn: ['刷新页面']},function () {location.reload();}); + }); + } + + //渲染数据 + function render_data(d){ + $row = $('.layui-row'); + $row.html(''); + for (const key in d.data) { + const t = d.data[key]; + let upordw = ''; + if(is_admin){ + if(t.state == 'dw' || t.state == 'up'){ + upordw = ``; + } } - }else if(type === 'set' ){ //使用 - if(fn == 'home'){ - set_theme(dir,data.name,fn); - }else{ - set_theme2(dir,'',fn); - } - - }else if(type === 'detail' ){ //详情 - theme_detail(data); + let html = + `
+
+
+
${t.name}
+
${t.version}
+
+
+
+
+
+
+
+ ${upordw} + ${t.state == 'local' || t.state == 'up' ? '':''} + + ${t.state == 'local' && active == 'home' ? '':''} + ${t.config == '1' && theme_set == true ? '':''} + ${(t.state == 'local' || t.state == 'up' ) && is_admin == true ? '':''} +
+
+
+
`; + $row.append(html); } - //监听End - }) + //标记当前模板,使用中靠前显示 + if(active == 'home'){ + var current1 = $(`#t_${d.current.home_pc}`); + current1.css('color','#03a9f4'); + current1.prepend(' '); + $(`#col_${d.current.home_pc}`).prependTo($row); + var current2 = $(`#t_${d.current.home_pad}`); + current2.css('color','#03a9f4'); + current2.prepend(' '); + $(`#col_${d.current.home_pad}`).prependTo($row); + //if(current1.is(current2)){ $("#set:first").remove(); } + + }else{ + if(d.current[active] !== null && d.current[active] !== undefined && d.current[active].length > 0){ + var current = $(`#t_${d.current[active]}`); + current.css('color','#03a9f4'); + current.prepend(' '); + $(`#col_${d.current[active]}`).prependTo($row); + //$("#set:first").remove(); + } + } + $(`#col_default`).prependTo($row); + //点击图片放大 + layer.photos({photos: '.img-list',anim: 5}); + + //懒加载预览图 + $('.screenshot').lazyload({placeholder:"./templates/admin/img/loading.gif",threshold : 600}); + + //监听按钮 + $(".layui-btn-group .layui-btn").click(function () { + var dir= $(this).parent().attr("id");//取目录名key + var fn= $(this).parent().parent().attr("id");//取模板类型 + var type = $(this).attr("id");//取事件类型 + var data = datas[dir]; + //console.log('目录:'+dir+',类型:'+type+',模板类型:'+fn); + if(type === 'dw' || type === 'up' ){ //下载或更新 + if (data.desc != null && data.desc.length != 0){ //存在描述时弹窗显示描述 + layer.open({title:data.name,content: data.desc,btn: ['下载', '取消'] + ,yes: function(index, layero){ + theme_download(dir,data.name,data.desc,fn); + },btn2: function(index, layero){ + return true; + },cancel: function(){ + return true; + } + }); + }else{ + theme_download(dir,data.name,data.desc,fn); + } + }else if(type === 'del' ){ //删除 + layer.confirm('确认删除?',{icon: 3, title:'温馨提示'}, function(index){ + theme_del(dir,fn); + }); + }else if(type === 'config' ){ //配置 + theme_config(dir,data.name,fn); + }else if(type === 'preview' ){ //预览 + if(fn == 'home'){ + window.open('./index.php?theme='+dir+'&u='+u); + }else{ + layer.msg('不支持预览此模板', {icon: 3});return; + } + }else if(type === 'set' ){ //使用 + if(fn == 'home'){ + set_theme(dir,data.name,fn); + }else{ + set_theme2(dir,'',fn); + } + }else if(type === 'detail' ){ //详情 + theme_detail(data); + } + }); + } + //下载主题 + function theme_download(dir,name,desc,fn){ + layer.msg('下载安装中,请稍后..', {shade:[0.5,'black'],anim: 1,icon: 16,time: 1000*300}); + $.post(get_api('write_theme','download'),{dir:dir,name:name,fn:fn},function(data,status){ + layer.closeAll(); + if( data.code == 1 ) { + layer.msg(data.msg, {icon: 1}); + setTimeout(() => {load_data(active);}, 800); + }else{ + layer.alert(data.msg,{icon:5,title:"错误",anim: "slideDown",shadeClose: true,closeBtn: 0,btn: ['知道了']}); + } + }); + } -}); - -//懒加载预览图 -$('.screenshot').lazyload({placeholder:"./templates/admin/img/loading.gif",threshold : 600}); - -//下载主题 -function theme_download(dir,name,desc,fn){ - layer.load(1, {shade:[0.1,'#fff']});//加载层 - layer.msg('下载安装中,请稍后..', {offset: 'b',anim: 1,time: 60*1000}); - $.post(get_api('write_theme','download'),{dir:dir,name:name,fn:fn},function(data,status){ - layer.closeAll(); - if( data.code == 1 ) { - layer.msg(data.msg, {icon: 1}); - setTimeout(() => {location.reload();}, 500);//延迟刷新 - }else{ - //layer.msg(data.msg, {icon: 5}); - layer.alert(data.msg,{icon:5,title:"错误",anim: "slideDown",shadeClose: true,closeBtn: 0,btn: ['知道了']}); - } - }); -} -//删除主题 -function theme_del(dir,fn){ - layer.load(1, {shade:[0.1,'#fff']});//加载层 - layer.msg('正在删除,请稍后..', {offset: 'b',anim: 1,time: 60*1000}); - $.post(get_api('write_theme','del'),{dir:dir,fn:fn},function(data,status){ - layer.closeAll(); - if( data.code == 1 ) { - layer.msg(data.msg, {icon: 1}); - setTimeout(() => {location.reload();}, 500); - }else{ - layer.msg(data.msg, {icon: 5}); - } - }); -} -//载入主题配置 -function theme_config(key,name,fn){ - layer.open({ - type: 2, - title: name + ' - 主题配置', - shadeClose: true, - area : [( $(window).width() < 768 ? '100%' : '568px' ),'100%'], - scrollbar: false, - resize: false, - offset: 'rt', - content: './index.php?c=admin&page=config_home&u='+u+'&theme='+key+'&fn='+fn+'&source=admin', - }); -} -//使用主题提示框 -function set_theme(key,name,fn) { - layer.open({ - title:name - ,content: '请选择要应用的设备类型 ?' - ,btn: ['全部', 'PC', 'Pad'] - ,yes: function(index, layero){ - set_theme2(key,'PC/Pad',fn); - },btn2: function(index, layero){ - set_theme2(key,'PC',fn); - },btn3: function(index, layero){ - set_theme2(key,'Pad',fn); - },cancel: function(){ - return true; - } - }); -} -//使用主题 -function set_theme2(name,type,fn) { - console.log(type,name); - $.post(get_api('write_theme','set'),{type:type,name:name,fn:fn},function(data,status){ - if( data.code == 1 ) { - layer.msg(data.msg, {icon: 1}); - setTimeout(() => {location.reload();}, 500); - }else{ - layer.msg(data.msg, {icon: 5}); - } - }); -} -//主题详情 -function theme_detail(data){ - layer.open({type: 1,scrollbar: false,maxmin: false,shadeClose: true,resize: false,title: data.name + ' - 主题详情',area: ['60%', '59%'],content: '

'+data.name+'

描述:'+data.description+'

版本:'+data.version+'

更新时间:'+data.update+'

作者:'+data.author+'

主页:访问主页

'}); - -} \ No newline at end of file + //删除主题 + function theme_del(dir,fn){ + layer.load(1, {shade:[0.5,'black']});//加载层 + layer.msg('正在删除,请稍后..', {offset: 'b',anim: 1,time: 60*1000}); + $.post(get_api('write_theme','del'),{dir:dir,fn:fn},function(data,status){ + layer.closeAll(); + if( data.code == 1 ) { + layer.msg(data.msg, {icon: 1}); + setTimeout(() => {load_data(active);}, 800); + }else{ + layer.msg(data.msg, {icon: 5}); + } + }); + } + + //载入主题配置 + function theme_config(key,name,fn){ + layer.open({ + type: 2, + title: name + ' - 主题配置', + shadeClose: true, + area : [( $(window).width() < 768 ? '100%' : '666px' ),'100%'], + scrollbar: false, + resize: false, + offset: 'rt', + content: './index.php?c=admin&page=config_home&u='+u+'&theme='+key+'&fn='+fn+'&source=admin', + }); + } + + //使用主题提示框 + function set_theme(key,name,fn) { + layer.open({ + title:name + ,content: '请选择要应用的设备类型 ?' + ,btn: ['全部', 'PC', 'Pad'] + ,yes: function(index, layero){ + set_theme2(key,'PC/Pad',fn); + },btn2: function(index, layero){ + set_theme2(key,'PC',fn); + },btn3: function(index, layero){ + set_theme2(key,'Pad',fn); + },cancel: function(){ + return true; + } + }); + } + + //使用主题 + function set_theme2(name,type,fn) { + $.post(get_api('write_theme','set'),{type:type,name:name,fn:fn},function(data,status){ + if( data.code == 1 ) { + layer.msg(data.msg, {icon: 1}); + setTimeout(() => {load_data(active);}, 800); + }else{ + layer.msg(data.msg, {icon: 5}); + } + }); + } + + //主题详情 + function theme_detail(data){ + layer.open({type: 1,scrollbar: false,maxmin: false,shadeClose: true,resize: false,title: data.name + ' - 主题详情',area: ['60%', '59%'],content: '

'+data.name+'

描述:'+data.description+'

版本:'+data.version+'

更新时间:'+data.update+'

作者:'+data.author+'

主页:访问主页

'}); + + } +}); \ No newline at end of file diff --git a/templates/admin/page/expand/article-edit.php b/templates/admin/page/expand/article-edit.php index 6e28069..8d04a45 100644 --- a/templates/admin/page/expand/article-edit.php +++ b/templates/admin/page/expand/article-edit.php @@ -62,7 +62,7 @@ require dirname(__DIR__).'/header.php' ?>
- +
@@ -90,7 +90,7 @@ require dirname(__DIR__).'/header.php' ?>
- +
@@ -99,7 +99,7 @@ require dirname(__DIR__).'/header.php' ?>
- +
diff --git a/templates/admin/page/expand/article-list.php b/templates/admin/page/expand/article-list.php index ae1cd22..9e7f6cd 100644 --- a/templates/admin/page/expand/article-list.php +++ b/templates/admin/page/expand/article-list.php @@ -145,7 +145,7 @@ layui.use(['form','table','dropdown','miniTab'], function () { {type:'checkbox'} //开启复选框 ,{ title:'操作', toolbar: '#tablebar',width:110} ,{field: 'title', title: '标题', minWidth:200,templet: function(d){ - return ''+d.title+'' + return ''+htmlspecialchars(d.title)+'' }} ,{field:'category',title:'分类',width:100,templet: function(d){ return d.category_name; @@ -383,6 +383,9 @@ layui.use(['form','table','dropdown','miniTab'], function () { return false; }); + function htmlspecialchars(str) { + return $('
').text(str).html(); + } }); diff --git a/templates/admin/page/home.php b/templates/admin/page/home.php index 0c05f5a..668d696 100644 --- a/templates/admin/page/home.php +++ b/templates/admin/page/home.php @@ -202,7 +202,7 @@ require 'header.php';
- + 主题设置 diff --git a/templates/admin/page/set_transit.php b/templates/admin/page/set_transit.php index 9b2b31b..4a28e7c 100644 --- a/templates/admin/page/set_transit.php +++ b/templates/admin/page/set_transit.php @@ -4,7 +4,7 @@
-
注意: 存在备用链接时停留时间可能无效!
+
注意: 存在备用链接时停留时间可能无效,需模板支持!
@@ -33,7 +33,7 @@
-
+
@@ -60,6 +60,10 @@ layui.use(['jquery','form'], function () { }); return false; }); + //关闭按钮 + $(document).on('click', '#close', function() { + parent.layer.close(parent.layer.getFrameIndex(window.name)); + }); }); diff --git a/templates/admin/page/set_verify.php b/templates/admin/page/set_verify.php new file mode 100644 index 0000000..668d2ea --- /dev/null +++ b/templates/admin/page/set_verify.php @@ -0,0 +1,58 @@ + + +
+
+
+
+
注意事项: 需模板支持,提示内容以http开头则打开网页,其他内容则弹出提示
使用场景: 加密链接/加密分类/二级密码/书签分享等
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/templates/admin/page/theme.php b/templates/admin/page/theme.php new file mode 100644 index 0000000..016d935 --- /dev/null +++ b/templates/admin/page/theme.php @@ -0,0 +1,36 @@ + + +
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/templates/admin/page/updatelog.php b/templates/admin/page/updatelog.php index fed04f4..97eac00 100644 --- a/templates/admin/page/updatelog.php +++ b/templates/admin/page/updatelog.php @@ -5,7 +5,24 @@
  • -

    v2.0.36-20230823

    +

    v2.0.37-20230830

    +
      +
    • [变更] 优化前端前置处理代码,让模板调用数据更加灵活
    • +
    • [新增] 支持更换验证模板/收录模板/留言模板
    • +
    • [新增] 验证模板支持设置提示内容,如获取密码的提示
    • +
    • [新增] 挽风导航V1的收录模板和留言模板
    • +
    • [新增] 4个简约风格的验证模板
    • +
    • [修复] 文章编辑器输入HTML代码时在编辑存在异常的问题
    • +
    • [修复] 文章标题/摘要存在HTML标签时被解析的问题
    • +
    • [修复] WebStack-Hugo主页模板4个已知问题
    • +
    • [修复] 特定情况下安装时使用MySQL数据库可能乱码的问题
    • +
    +
    +
  • +
  • + +
    +

    v2.0.36-20230824

    • [修复] 判断是否显示收录的逻辑错误(导致设为无需审核时不显示)
    • [变更] 移除2个链接图标API,因稳定性欠佳
    • @@ -13,6 +30,7 @@
    • [新增] 挽风导航主页模板(内置文章模板/拟态风格),注:内置文章模板在预览状态下是不生效的!
    • [新增] 挽风导航登录模板/过度模板
    • [新增] 后台概要页可以点击报表统计获取访问的IP列表
    • +
    • [修复] 文章状态非公开且已登录无法预览文章
  • diff --git a/templates/apply/default/index.php b/templates/apply/default/index.php new file mode 100644 index 0000000..dd7e01b --- /dev/null +++ b/templates/apply/default/index.php @@ -0,0 +1,107 @@ + + + + + 申请收录 + + '> + + + +
    +
    +
    +

    申请收录

    +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    ' + ;} ?> +
    +
    +
    + + + + \ No newline at end of file diff --git a/templates/apply/default/info.json b/templates/apply/default/info.json new file mode 100644 index 0000000..fa1e91f --- /dev/null +++ b/templates/apply/default/info.json @@ -0,0 +1,8 @@ +{ + "name": "默认模板", + "description": "默认", + "homepage": "https://gitee.com/tznb/TwoNav", + "version": "2.0.0", + "update": "2023/08/25", + "author": "TwoNav" +} \ No newline at end of file diff --git a/templates/apply/default/screenshot.jpg b/templates/apply/default/screenshot.jpg new file mode 100644 index 0000000..fd24855 Binary files /dev/null and b/templates/apply/default/screenshot.jpg differ diff --git a/templates/article/default/info.json b/templates/article/default/info.json index 2c8daf5..0cff204 100644 --- a/templates/article/default/info.json +++ b/templates/article/default/info.json @@ -1,5 +1,5 @@ { - "name":"默认", + "name":"默认模板", "description":"系统默认的文章模板,支持代码段上色,支持自适应!", "homepage":"https://gitee.com/tznb/TwoNav", "version":"2.0.0", diff --git a/templates/guestbook/default/index.php b/templates/guestbook/default/index.php new file mode 100644 index 0000000..ba8f65a --- /dev/null +++ b/templates/guestbook/default/index.php @@ -0,0 +1,87 @@ + + + + + + + <?php echo $site['title'];?> - 极简留言板 + '> + + + +
    + + +
    + +
    +
    +
    +
    极简留言板
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + 提交';} ?> +
    +
    +
    +
    + + +
    +
    + +
    + + + + + \ No newline at end of file diff --git a/templates/guestbook/default/info.json b/templates/guestbook/default/info.json new file mode 100644 index 0000000..fa1e91f --- /dev/null +++ b/templates/guestbook/default/info.json @@ -0,0 +1,8 @@ +{ + "name": "默认模板", + "description": "默认", + "homepage": "https://gitee.com/tznb/TwoNav", + "version": "2.0.0", + "update": "2023/08/25", + "author": "TwoNav" +} \ No newline at end of file diff --git a/templates/guestbook/default/screenshot.jpg b/templates/guestbook/default/screenshot.jpg new file mode 100644 index 0000000..397897f Binary files /dev/null and b/templates/guestbook/default/screenshot.jpg differ diff --git a/templates/guide/default/info.json b/templates/guide/default/info.json index f35edbd..24911ff 100644 --- a/templates/guide/default/info.json +++ b/templates/guide/default/info.json @@ -1,5 +1,5 @@ { - "name": "默认", + "name": "默认模板", "description": "模板来自于html5up.net", "homepage": "https://gitee.com/tznb/TwoNav", "version": "2.0.0", diff --git a/templates/login/default/info.json b/templates/login/default/info.json index dc1626f..940c864 100644 --- a/templates/login/default/info.json +++ b/templates/login/default/info.json @@ -1,5 +1,5 @@ { - "name": "默认", + "name": "默认模板", "description": "默认", "homepage": "https://gitee.com/tznb/TwoNav", "version": "2.0.4", diff --git a/templates/register/default/info.json b/templates/register/default/info.json index 7247774..81fe5ed 100644 --- a/templates/register/default/info.json +++ b/templates/register/default/info.json @@ -1,5 +1,5 @@ { - "name": "默认", + "name": "默认模板", "description": "默认", "homepage": "https://gitee.com/tznb/TwoNav", "version": "2.0.0", diff --git a/templates/transit/default/info.json b/templates/transit/default/info.json index 4b288cf..e79e67d 100644 --- a/templates/transit/default/info.json +++ b/templates/transit/default/info.json @@ -1,5 +1,5 @@ { - "name":"OneNav1", + "name":"默认模板", "description":"OneNav旧版过渡页", "homepage":"https://www.xiaoz.me", "version":"2.0.2", diff --git a/templates/verify/default/index.php b/templates/verify/default/index.php new file mode 100644 index 0000000..0deff71 --- /dev/null +++ b/templates/verify/default/index.php @@ -0,0 +1,91 @@ + + + + + + <?php echo $data['title'];?> - <?php echo $site['subtitle']?> + + + + + + + + + + + +
    + +
    + + + + + + \ No newline at end of file diff --git a/templates/verify/default/info.json b/templates/verify/default/info.json new file mode 100644 index 0000000..fa1e91f --- /dev/null +++ b/templates/verify/default/info.json @@ -0,0 +1,8 @@ +{ + "name": "默认模板", + "description": "默认", + "homepage": "https://gitee.com/tznb/TwoNav", + "version": "2.0.0", + "update": "2023/08/25", + "author": "TwoNav" +} \ No newline at end of file diff --git a/templates/verify/default/screenshot.jpg b/templates/verify/default/screenshot.jpg new file mode 100644 index 0000000..b36bceb Binary files /dev/null and b/templates/verify/default/screenshot.jpg differ