diff --git a/docs/changelog.md b/docs/changelog.md
index f69e3a0f..bdf5ee59 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -1,6 +1,10 @@
# 更新记录
通过访问 https://www.dedebiz.com/git 获取完整更新记录
+# V6.5.8
+- 流量统计功能增加蜘蛛判断及查询;
+- 修复自定义模型中字段禁止会员投稿的问题;
+
# V6.5.6
- PHP8高版本兼容性调整;
- SQLite支持兼容性调整;
@@ -79,7 +83,7 @@
- 修正TAG生成目录错误;
- 移除FTP的支持;
- 其他常规问题修复;
--
+
# V6.2.10
- DedeBIZ基于自由软件基金会发行的GPL v2许可证发布
- 修正后台功能说明提示;
diff --git a/src/admin/statistics_list.php b/src/admin/statistics_list.php
index 41467b60..445605b5 100644
--- a/src/admin/statistics_list.php
+++ b/src/admin/statistics_list.php
@@ -12,6 +12,8 @@ require_once(dirname(__FILE__)."/config.php");
require_once(DEDEINC.'/datalistcp.class.php');
function RenderUrlType($t) {
switch ($t) {
+ case -1:
+ return "蜘蛛";
case 1:
return "列表";
case 2:
@@ -31,6 +33,7 @@ if (isset($id) && isset($reid)) {
}
}
$ip = isset($ip) ? HtmlReplace(trim($ip)) : '';
+$url_type = isset($url_type) ? intval($url_type) : 0;
if (empty($mobile)) $mobile = '';
if (isset($dopost) && $dopost == "delete") {
$ids = explode('`',$aids);
@@ -47,12 +50,18 @@ if (isset($dopost) && $dopost == "delete") {
exit();
} else {
$addsql = " WHERE ip LIKE '%$ip%' ";
+ if ($url_type === -1) {
+ $addsql .= " AND url_type = -1 ";
+ } else if ($url_type === 1) {
+ $addsql .= " AND url_type > 0 ";
+ }
$sql = "SELECT * FROM `#@__statistics_detail` $addsql ORDER BY id DESC";
$dlist = new DataListCP();
//流量列表数
$dlist->pagesize = 30;
$tplfile = DEDEADMIN."/templets/statistics_list.htm";
$dlist->SetParameter("ip",$ip);
+ $dlist->SetParameter("url_type",$url_type);
$dlist->SetTemplate($tplfile);
$dlist->SetSource($sql);
$dlist->Display();
diff --git a/src/admin/templets/statistics_list.htm b/src/admin/templets/statistics_list.htm
index d9bf3ac0..573a16da 100644
--- a/src/admin/templets/statistics_list.htm
+++ b/src/admin/templets/statistics_list.htm
@@ -21,6 +21,11 @@
diff --git a/src/system/archive/archives.class.php b/src/system/archive/archives.class.php
index db3af124..2e236142 100755
--- a/src/system/archive/archives.class.php
+++ b/src/system/archive/archives.class.php
@@ -60,6 +60,9 @@ class Archives
//如果当前文档不是系统模型,为自定义模型
$query = "SELECT arc.*,tp.reid,tp.typedir,ch.addtable,mb.uname,mb.face,mb.userid,mb.sex FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` as ch on arc.channel = ch.id LEFT JOIN `#@__member` mb on arc.mid = mb.mid WHERE arc.id='$aid' ";
$this->Fields = $this->dsql->GetOne($query);
+ if (!is_array($this->Fields)) {
+ echo DedeAlert('id:'.$aid.'的文档数据不存在',ALERT_DANGER);
+ }
} else {
$this->Fields['title'] = '';
$this->Fields['money'] = $this->Fields['arcrank'] = 0;
diff --git a/src/system/libraries/crawlerdetect.class.php b/src/system/libraries/crawlerdetect.class.php
index 36420d9c..ce6abc10 100644
--- a/src/system/libraries/crawlerdetect.class.php
+++ b/src/system/libraries/crawlerdetect.class.php
@@ -64,7 +64,7 @@ class CrawlerDetect
/**
* Class constructor.
*/
- public function __construct(array $headers = null, $userAgent = null)
+ public function __construct($headers = null, $userAgent = null)
{
$this->crawlers = new Crawlers();
$this->exclusions = new Exclusions();
diff --git a/src/system/libraries/fixtures/crawlers.php b/src/system/libraries/fixtures/crawlers.php
index 71237bee..991c4bb1 100644
--- a/src/system/libraries/fixtures/crawlers.php
+++ b/src/system/libraries/fixtures/crawlers.php
@@ -1,5 +1,5 @@
isRobot()) {
- return "";
- }
$pm = array();
$pm['dduuid'] = GetCookie("DedeStUUID");
if (empty($pm['dduuid'])) {
@@ -46,6 +42,10 @@ class DedeStatistics {
$pm['created_date'] = MyDate("Ymd",$pm['t']);
$pm['created_hour'] = MyDate("H",$pm['t']);
$pm['url_type'] = isset($envs['url_type'])? $envs['url_type'] : $url_type;
+ if ($crawler = $agent->robot($agent->getUserAgent())) {
+ $pm['url_type'] = -1;
+ $pm['browser'] = $crawler;
+ }
$pm['typeid'] = isset($envs['typeid'])? $envs['typeid'] : $typeid;
$pm['aid'] = isset($envs['aid'])? $envs['aid'] : $aid;
$pm['value'] = isset($envs['value'])? $envs['value'] : $value;
@@ -156,10 +156,10 @@ class DedeStatistics {
if (is_array($info)) {
return $info;
}
- $pv = $dsql->GetOne("SELECT COUNT(*) as total FROM `#@__statistics_detail` WHERE created_date = $d");
- $uv = $dsql->GetOne("SELECT COUNT(DISTINCT dduuid) as total FROM `#@__statistics_detail` WHERE created_date = $d");
- $ip = $dsql->GetOne("SELECT COUNT(DISTINCT ip) as total FROM `#@__statistics_detail` WHERE created_date = $d");
- $vv = $dsql->GetOne("SELECT COUNT(DISTINCT ssid) as total FROM `#@__statistics_detail` WHERE created_date = $d");
+ $pv = $dsql->GetOne("SELECT COUNT(*) as total FROM `#@__statistics_detail` WHERE created_date = $d AND url_type >= 0");
+ $uv = $dsql->GetOne("SELECT COUNT(DISTINCT dduuid) as total FROM `#@__statistics_detail` WHERE created_date = $d AND url_type >= 0");
+ $ip = $dsql->GetOne("SELECT COUNT(DISTINCT ip) as total FROM `#@__statistics_detail` WHERE created_date = $d AND url_type >= 0");
+ $vv = $dsql->GetOne("SELECT COUNT(DISTINCT ssid) as total FROM `#@__statistics_detail` WHERE created_date = $d AND url_type >= 0");
if ($d < intval($today)) {
//缓存数据
$insql = "INSERT INTO `#@__statistics` (`sdate`,`pv`,`uv`,`ip`,`vv`) VALUES ('$d', '{$pv['total']}','{$uv['total']}','{$ip['total']}','{$vv['total']}')";