From 3148791fd71d29b60f16c0112f9afe936cf6275d Mon Sep 17 00:00:00 2001 From: tianya Date: Wed, 2 Aug 2023 21:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtag=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/system/archive/taglist.class.php | 54 ++++++++++++++-------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/system/archive/taglist.class.php b/src/system/archive/taglist.class.php index 4c7e8700..0793a32c 100755 --- a/src/system/archive/taglist.class.php +++ b/src/system/archive/taglist.class.php @@ -572,32 +572,34 @@ class TagList MkdirAll($this->GetTruePath().$this->tagsDir, $cfg_dir_purview); $this->dtp->SaveTo($this->GetTruePath().$this->tagsDir."/index.html"); } else { - $totalpage = ceil($this->TotalResult / $this->pagesize); - if ($totalpage == 0) { - $totalpage = 1; - } - if ($makepagesize > 0) { - $endpage = $startpage + $makepagesize; - } else { - $endpage = ($totalpage + 1); - } - if ($endpage >= $totalpage + 1) { - $endpage = $totalpage + 1; - } - if ($endpage == 1) { - $endpage = 2; - } - $makeDir = $this->GetTruePath().$this->tagsDir.'/'.$this->TagInfos['id']."/"; - MkdirAll($makeDir, $cfg_dir_purview); - for ($this->PageNo = $startpage; $this->PageNo < $endpage; $this->PageNo++) { - $this->ParseDMFields($this->PageNo, 1); - $fileDir = $makeDir."/".$this->PageNo; - MkdirAll($fileDir, $cfg_dir_purview); - $this->dtp->SaveTo($fileDir."/index.html"); - } - if ($startpage == 1) { - $list_1 = $makeDir."/1/index.html"; - copy($list_1, $makeDir."/index.html"); + if ($this->TagInfos) { + $totalpage = ceil($this->TotalResult / $this->pagesize); + if ($totalpage == 0) { + $totalpage = 1; + } + if ($makepagesize > 0) { + $endpage = $startpage + $makepagesize; + } else { + $endpage = ($totalpage + 1); + } + if ($endpage >= $totalpage + 1) { + $endpage = $totalpage + 1; + } + if ($endpage == 1) { + $endpage = 2; + } + $makeDir = $this->GetTruePath().$this->tagsDir.'/'.$this->TagInfos['id']."/"; + MkdirAll($makeDir, $cfg_dir_purview); + for ($this->PageNo = $startpage; $this->PageNo < $endpage; $this->PageNo++) { + $this->ParseDMFields($this->PageNo, 1); + $fileDir = $makeDir."/".$this->PageNo; + MkdirAll($fileDir, $cfg_dir_purview); + $this->dtp->SaveTo($fileDir."/index.html"); + } + if ($startpage == 1) { + $list_1 = $makeDir."/1/index.html"; + copy($list_1, $makeDir."/index.html"); + } } } }