diff --git a/system/admin.php b/system/admin.php index 230246d..941b6b5 100644 --- a/system/admin.php +++ b/system/admin.php @@ -208,7 +208,7 @@ if ($page == 'menu') { 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'] == 1 && check_purview('article',1)){ + 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)){ diff --git a/system/api.php b/system/api.php index 1326b9a..a570f30 100644 --- a/system/api.php +++ b/system/api.php @@ -1820,6 +1820,22 @@ function read_data(){ $data = ['dates'=>$dates,'day_data'=>$day_data]; msgA(['code'=>1,'data'=>$data]); + }elseif($_GET['type'] == 'tongji_ip_list'){ + $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 = []; + foreach ($dates as $date) { + $list = get_db('user_count', 'e', ['uid' => UID, 'k' => $date, 't' => 'ip_list']); + $list = unserialize($list); + $day_data[$date] = empty($list) ? [] : $list ; + } + msgA(['code'=>1,'data'=>$day_data]); } } diff --git a/system/api_article.php b/system/api_article.php index 51a9bcb..da291c0 100644 --- a/system/api_article.php +++ b/system/api_article.php @@ -3,7 +3,7 @@ $type = htmlspecialchars(trim($_GET['type']),ENT_QUOTES); if (function_exists($type) ) { - if($GLOBALS['global_config']['article'] != 1 || !check_purview('article',1)){ + if($GLOBALS['global_config']['article'] < 1 || !check_purview('article',1)){ msg(-1,'无权限'); } $type(); diff --git a/system/api_root.php b/system/api_root.php index 46e0893..635157e 100644 --- a/system/api_root.php +++ b/system/api_root.php @@ -574,7 +574,7 @@ function write_sys_settings(){ 'apply'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'收录管理参数错误'], 'guestbook'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'留言管理参数错误'], 'link_extend'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'链接扩展参数错误'], - 'article'=>['int'=>true,'min'=>0,'max'=>1,'msg'=>'文章管理参数错误'] + 'article'=>['int'=>true,'min'=>0,'max'=>2,'msg'=>'文章管理参数错误'] ]; $o_config = []; foreach ($datas as $key => $data){ diff --git a/system/expand/article.php b/system/expand/article.php index 3a4834e..0768b54 100644 --- a/system/expand/article.php +++ b/system/expand/article.php @@ -1,5 +1,5 @@ "apply","uid"=>UID])); - return ($global_config['apply'] == 1 && $apply_user['apply'] == 1); + return ($global_config['apply'] == 1 && $apply_user['apply'] > 0); } //是否启用留言 function is_guestbook(){ diff --git a/system/version.txt b/system/version.txt index 815095b..2144984 100644 --- a/system/version.txt +++ b/system/version.txt @@ -1 +1 @@ -v2.0.35-20230816 \ No newline at end of file +v2.0.36-20230823 \ No newline at end of file diff --git a/templates/admin/page/SiteSetting.php b/templates/admin/page/SiteSetting.php index 0c0e914..a63330b 100644 --- a/templates/admin/page/SiteSetting.php +++ b/templates/admin/page/SiteSetting.php @@ -69,15 +69,16 @@
| 日期 | IP列表 |
|---|---|
| ' + date + ' | ';
+ $.each(ipAddresses, function (index, ipAddress) {
+ content += ipAddress + ' '; + }); + content += ' |