帮助

猫咪vip亚洲日韩 黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站前黑料吃瓜总站省略号

2023-07-10 14:51 易优技巧

先上黑料吃瓜总站示例图


黑料吃瓜总站教程如下:

1、编辑黑料吃瓜总站模板,把黑料吃瓜总站黑料吃瓜总站黑料吃瓜总站加上一个标识pageno,dots,参考代码

{eyou:黑料吃瓜总站 listitem='pre,next,info,index,end,pageno,dots' listsize='1' /}


2、由于每个模板黑料吃瓜总站样式不同,涉及的黑料吃瓜总站php文件官方不会在线更新覆盖,请根据步骤找到黑料吃瓜总站php文件补充相关代码。

    2.1、用编辑器(非记事本工具)打开文件 core/library/paginator/driver/Eyou.php  (注:Eyou.php为pc黑料吃瓜总站文件,手机端的为:Mobile.php)

    2.2、在108行左右找到代码  protected function getLinks($listsize = 3)  替换成protected function getLinks($listsize = 3, $listitemArr = [])

    2.3、把109行大括号 { 开始,到对应大括号 } 结束的代码进行替换

                protected function getLinks($listsize  = 3, $listitemArr = [])

                {

                            这里全部代码都要被替换为2.4步骤的代码

                }

            替换成以下代码:

              protected function getLinks($listsize = 3, $listitemArr = [])
        {
            if ($this->simple)
                return '';

            $block = [
                'first'  => null,
                'slider' => null,
                'last'   => null
            ];

            $side   = $listsize;
            $window = $side * 2;

            if ($this->lastPage <$window + 2) {
                $block['first'] = $this->getUrlRange(1, $this->lastPage);
            } elseif ($this->currentPage <($side + 1)) {
                $block['first'] = $this->getUrlRange(1, $window + 1);
            } elseif ($this->currentPage > ($this->lastPage - $side)) {
                $block['last']  = $this->getUrlRange($this->lastPage - $window, $this->lastPage);
            } else {
                $block['slider'] = $this->getUrlRange($this->currentPage - $side, $this->currentPage + $side);
            }

            $html = '';

            if (is_array($block['first'])) {
                $html .= $this->getUrlLinks($block['first']);
                if (in_array('dots', $listitemArr)) {
                    if ($window + 1 <$this->lastPage) {
                        if ($window + 1 <$this->lastPage - 1) {
                            $html .= $this->getDots();
                        }
                        $html .= $this->getPageLinkWrapper2($this->url($this->lastPage), $this->lastPage);
                    }
                }
            }

            if (is_array($block['slider'])) {
                if (in_array('dots', $listitemArr)) {
                    if ($this->currentPage - $side > 1) {
                        $html .= $this->getPageLinkWrapper2($this->url(1), 1);
                        if ($this->currentPage - $side > 2) {
                            $html .= $this->getDots();
                        }
                    }
                }

                $html .= $this->getUrlLinks($block['slider']);

                if (in_array('dots', $listitemArr)) {
                    if ($this->currentPage + $side <$this->lastPage) {
                        if ($this->currentPage + $side <$this->lastPage - 1) {
                            $html .= $this->getDots();
                        }
                        $html .= $this->getPageLinkWrapper2($this->url($this->lastPage), $this->lastPage);
                    }
                }
            }

            if (is_array($block['last'])) {
                if (in_array('dots', $listitemArr)) {
                    if ($this->lastPage - $window <$this->lastPage) {
                        $html .= $this->getPageLinkWrapper2($this->url(1), 1);
                        if ($this->lastPage - $window > 2) {
                            $html .= $this->getDots();
                        }
                    }
                }
                $html .= $this->getUrlLinks($block['last']);
            }

            return $html;
        }


    2.4、看下图找到这个代码  array_push($pageArr, $this->getLinks($listsize));   替换成array_push($pageArr, $this->getLinks($listsize, $listitemArr));


    完结。



QQ在线咨询
Clicky