dede點擊圖片進入下一頁方法

字號:


    關(guān)鍵字描述:方法 進入 圖片 點擊 " this-> ." < body dede點擊圖片進入下一頁方法: 打開include/inc_archives_view.php 大概在444行左右,找到 $this->Fields[$this->SplitPageField]=$this->Fields[$this->SplitPageField]; 注釋掉,改
    關(guān)鍵字描述:方法 進入 圖片 點擊 " this-> ." < body
    dede點擊圖片進入下一頁方法:
    打開include/inc_archives_view.php
    大概在444行左右,找到
    $this->Fields[$this->SplitPageField]=$this->Fields[$this->SplitPageField];
    注釋掉,改為
    $this->Fields[$this->SplitPageField]=$this->ClickPicNext($this->Fields[$this->SplitPageField]);
    然后,最后加上函數(shù),注重在最后一個括號里面!
    //把圖片替換成鏈接
    //----------------------------
    function ClickPicNext(&$body)
    {
    if($this->NowPage!=$this->TotalPage){
    $lPage=$this->NowPage 1;
    $body=preg_replace("/<(img|IMG)(.*)(src|SRC)=[\"|'| ]{0,}((.*)>)/isU","<a href='".$this->NameFirst."_".$lPage.".".$this->ShortName."'>"."\${0}"."</a>",$body);
    //$body="<a href='".$this->NameFirst."_".$lPage.".".$this->ShortName."'>".$body."</a> ";
    }else{
    if($this->GetNext()){
    $body=preg_replace("/<(img|IMG)(.*)(src|SRC)=[\"|'| ]{0,}((.*)>)/isU","<a href='".$this->GetNext()."'>"."\${0}"."</a>",$body);
    //$body="<a href='".$this->GetNext()."'>".$body."</a> ";
    }
    }
    return $body;
    }
    自動地把文章中的圖片替換為下一頁的鏈接,假如是最后一頁,則為下一篇!
    注重:先要按下面的改法,把上一篇下一篇分開才行!