From b761d73441e3e6a21fcd3acb3664544ae4c364c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?=
<93301500+xushubieli@users.noreply.github.com>
Date: Tue, 25 Mar 2025 12:49:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/system/archive/sglistview.class.php | 37 ++---
src/system/archive/taglist.class.php | 178 ++++++++++--------------
2 files changed, 92 insertions(+), 123 deletions(-)
diff --git a/src/system/archive/sglistview.class.php b/src/system/archive/sglistview.class.php
index d19640cd..d0bb2f3a 100755
--- a/src/system/archive/sglistview.class.php
+++ b/src/system/archive/sglistview.class.php
@@ -928,27 +928,13 @@ class SgListView
}
}
$plist = '';
- if (preg_match('/info/i', $listitem)) {
- $plist .= $maininfo.' ';
- }
- if (preg_match('/index/i', $listitem)) {
- $plist .= $indexpage.' ';
- }
- if (preg_match('/pre/i', $listitem)) {
- $plist .= $prepage.' ';
- }
- if (preg_match('/pageno/i', $listitem)) {
- $plist .= $listdd.' ';
- }
- if (preg_match('/next/i', $listitem)) {
- $plist .= $nextpage.' ';
- }
- if (preg_match('/end/i', $listitem)) {
- $plist .= $endpage.' ';
- }
- if (preg_match('/option/i', $listitem)) {
- $plist .= $optionlist;
- }
+ if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
+ if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
+ if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
+ if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
+ if (preg_match('/end/i', $listitem)) $plist .= $endpage;
+ if (preg_match('/option/i', $listitem)) $plist .= $optionlist;
+ if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
return $plist;
}
/**
@@ -1028,7 +1014,14 @@ class SgListView
$listdd .= "
$j";
}
}
- $plist = $indexpage.$prepage.$listdd.$nextpage.$endpage;
+ $plist = '';
+ if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
+ if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
+ if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
+ if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
+ if (preg_match('/end/i', $listitem)) $plist .= $endpage;
+ if (preg_match('/option/i', $listitem)) $plist .= $optionlist;
+ if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
//伪静态栏目分页
if ($cfg_rewrite == 'Y') {
$plist = str_replace("?tid=", "", $plist);
diff --git a/src/system/archive/taglist.class.php b/src/system/archive/taglist.class.php
index 01a2bbbb..50cda481 100755
--- a/src/system/archive/taglist.class.php
+++ b/src/system/archive/taglist.class.php
@@ -390,89 +390,6 @@ class TagList
$this->dsql->FreeResult('al');
return $artlist;
}
- /**
- * 获取动态的分页列表
- *
- * @access public
- * @param int $list_len 列表宽度
- * @param string $listitem 列表样式
- * @return string
- */
- function GetPageListDM($list_len, $listitem = "info,index,end,pre,next,pageno")
- {
- $prepage = '';
- $nextpage = '';
- $prepagenum = $this->PageNo - 1;
- $nextpagenum = $this->PageNo + 1;
- if ($list_len == "" || preg_match("/[^0-9]/", $list_len)) {
- $list_len = 3;
- }
- $totalpage = $this->TotalPage;
- if ($totalpage <= 1 && $this->TotalResult > 0) {
- return "1页".$this->TotalResult."条";
- }
- if ($this->TotalResult == 0) {
- return "0页".$this->TotalResult."条";
- }
- $maininfo = "{$totalpage}页".$this->TotalResult."条";
- $purl = $this->GetCurUrl();
- $purl .= "?/".urlencode($this->Tag);
- //获得上页和下页的链接
- if ($this->PageNo != 1) {
- $prepage .= "上页";
- $indexpage = "首页";
- } else {
- $indexpage = "首页";
- }
- if ($this->PageNo != $totalpage && $totalpage > 1) {
- $nextpage .= "下页";
- $endpage = "末页";
- } else {
- $endpage = "末页";
- }
- //获得数字链接
- $listdd = '';
- $total_list = $list_len * 2 + 1;
- if ($this->PageNo >= $total_list) {
- $j = $this->PageNo - $list_len;
- $total_list = $this->PageNo + $list_len;
- if ($total_list > $totalpage) {
- $total_list = $totalpage;
- }
- } else {
- $j = 1;
- if ($total_list > $totalpage) {
- $total_list = $totalpage;
- }
- }
- for ($j; $j <= $total_list; $j++) {
- if ($j == $this->PageNo) {
- $listdd .= "$j";
- } else {
- $listdd .= "$j";
- }
- }
- $plist = '';
- if (preg_match('/info/i', $listitem)) {
- $plist .= $maininfo.' ';
- }
- if (preg_match('/index/i', $listitem)) {
- $plist .= $indexpage.' ';
- }
- if (preg_match('/pre/i', $listitem)) {
- $plist .= $prepage.' ';
- }
- if (preg_match('/pageno/i', $listitem)) {
- $plist .= $listdd.' ';
- }
- if (preg_match('/next/i', $listitem)) {
- $plist .= $nextpage.' ';
- }
- if (preg_match('/end/i', $listitem)) {
- $plist .= $endpage.' ';
- }
- return $plist;
- }
/**
* 获取静态的分页列表
*
@@ -535,24 +452,12 @@ class TagList
}
}
$plist = '';
- if (preg_match('/info/i', $listitem)) {
- $plist .= $maininfo.' ';
- }
- if (preg_match('/index/i', $listitem)) {
- $plist .= $indexpage.' ';
- }
- if (preg_match('/pre/i', $listitem)) {
- $plist .= $prepage.' ';
- }
- if (preg_match('/pageno/i', $listitem)) {
- $plist .= $listdd.' ';
- }
- if (preg_match('/next/i', $listitem)) {
- $plist .= $nextpage.' ';
- }
- if (preg_match('/end/i', $listitem)) {
- $plist .= $endpage.' ';
- }
+ if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
+ if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
+ if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
+ if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
+ if (preg_match('/end/i', $listitem)) $plist .= $endpage;
+ if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
return $plist;
}
function GetTruePath()
@@ -613,6 +518,77 @@ class TagList
}
}
}
+ /**
+ * 获取动态的分页列表
+ *
+ * @access public
+ * @param int $list_len 列表宽度
+ * @param string $listitem 列表样式
+ * @return string
+ */
+ function GetPageListDM($list_len, $listitem = "info,index,end,pre,next,pageno")
+ {
+ $prepage = '';
+ $nextpage = '';
+ $prepagenum = $this->PageNo - 1;
+ $nextpagenum = $this->PageNo + 1;
+ if ($list_len == "" || preg_match("/[^0-9]/", $list_len)) {
+ $list_len = 3;
+ }
+ $totalpage = $this->TotalPage;
+ if ($totalpage <= 1 && $this->TotalResult > 0) {
+ return "1页".$this->TotalResult."条";
+ }
+ if ($this->TotalResult == 0) {
+ return "0页".$this->TotalResult."条";
+ }
+ $maininfo = "{$totalpage}页".$this->TotalResult."条";
+ $purl = $this->GetCurUrl();
+ $purl .= "?/".urlencode($this->Tag);
+ //获得上页和下页的链接
+ if ($this->PageNo != 1) {
+ $prepage .= "上页";
+ $indexpage = "首页";
+ } else {
+ $indexpage = "首页";
+ }
+ if ($this->PageNo != $totalpage && $totalpage > 1) {
+ $nextpage .= "下页";
+ $endpage = "末页";
+ } else {
+ $endpage = "末页";
+ }
+ //获得数字链接
+ $listdd = '';
+ $total_list = $list_len * 2 + 1;
+ if ($this->PageNo >= $total_list) {
+ $j = $this->PageNo - $list_len;
+ $total_list = $this->PageNo + $list_len;
+ if ($total_list > $totalpage) {
+ $total_list = $totalpage;
+ }
+ } else {
+ $j = 1;
+ if ($total_list > $totalpage) {
+ $total_list = $totalpage;
+ }
+ }
+ for ($j; $j <= $total_list; $j++) {
+ if ($j == $this->PageNo) {
+ $listdd .= "$j";
+ } else {
+ $listdd .= "$j";
+ }
+ }
+ $plist = '';
+ if (preg_match('/index/i', $listitem)) $plist .= $indexpage;
+ if (preg_match('/pre/i', $listitem)) $plist .= $prepage;
+ if (preg_match('/pageno/i', $listitem)) $plist .= $listdd;
+ if (preg_match('/next/i', $listitem)) $plist .= $nextpage;
+ if (preg_match('/end/i', $listitem)) $plist .= $endpage;
+ if (preg_match('/info/i', $listitem)) $plist .= $maininfo;
+ return $plist;
+ }
/**
* 获得一个指定的栏目的链接
*