Browse Source

同步

tags/6.5.0
叙述、别离 1 week ago
parent
commit
b761d73441
2 changed files with 92 additions and 123 deletions
  1. +15
    -22
      src/system/archive/sglistview.class.php
  2. +77
    -101
      src/system/archive/taglist.class.php

+ 15
- 22
src/system/archive/sglistview.class.php View File

@@ -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 .= "<li class='page-item'><a href='".$purl."PageNo=$j{$geturl}' class='page-link'>$j</a></li>";
}
}
$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);


+ 77
- 101
src/system/archive/taglist.class.php View File

@@ -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 "<li class='page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>";
}
if ($this->TotalResult == 0) {
return "<li class='page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>";
}
$maininfo = "<li class='page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>";
$purl = $this->GetCurUrl();
$purl .= "?/".urlencode($this->Tag);
//获得上页和下页的链接
if ($this->PageNo != 1) {
$prepage .= "<li class='page-item'><a href='".$purl."/$prepagenum' class='page-link'>上页</a></li>";
$indexpage = "<li class='page-item'><a href='".$purl."/1' class='page-link'>首页</a></li>";
} else {
$indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>";
}
if ($this->PageNo != $totalpage && $totalpage > 1) {
$nextpage .= "<li class='page-item'><a href='".$purl."/$nextpagenum' class='page-link'>下页</a></li>";
$endpage = "<li class='page-item'><a href='".$purl."/$totalpage' class='page-link'>末页</a></li>";
} else {
$endpage = "<li class='page-item'><span class='page-link'>末页</span></li>";
}
//获得数字链接
$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 .= "<li class='page-item active'><span class='page-link'>$j</span></li>";
} else {
$listdd .= "<li class='page-item'><a href='".$purl."/$j' class='page-link'>$j</a></li>";
}
}
$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 "<li class='page-item disabled'><span class='page-link'>1页".$this->TotalResult."条</span></li>";
}
if ($this->TotalResult == 0) {
return "<li class='page-item disabled'><span class='page-link'>0页".$this->TotalResult."条</span></li>";
}
$maininfo = "<li class='page-item disabled'><span class='page-link'>{$totalpage}页".$this->TotalResult."条</span></li>";
$purl = $this->GetCurUrl();
$purl .= "?/".urlencode($this->Tag);
//获得上页和下页的链接
if ($this->PageNo != 1) {
$prepage .= "<li class='page-item'><a href='".$purl."/$prepagenum' class='page-link'>上页</a></li>";
$indexpage = "<li class='page-item'><a href='".$purl."/1' class='page-link'>首页</a></li>";
} else {
$indexpage = "<li class='page-item'><span class='page-link'>首页</span></li>";
}
if ($this->PageNo != $totalpage && $totalpage > 1) {
$nextpage .= "<li class='page-item'><a href='".$purl."/$nextpagenum' class='page-link'>下页</a></li>";
$endpage = "<li class='page-item'><a href='".$purl."/$totalpage' class='page-link'>末页</a></li>";
} else {
$endpage = "<li class='page-item'><span class='page-link'>末页</span></li>";
}
//获得数字链接
$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 .= "<li class='page-item active'><span class='page-link'>$j</span></li>";
} else {
$listdd .= "<li class='page-item'><a href='".$purl."/$j' class='page-link'>$j</a></li>";
}
}
$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;
}
/**
* 获得一个指定的栏目的链接
*


Loading…
Cancel
Save