When you click the last page of the DedeCMS atlas, you will be prompted with "No more", which is not good for the user experience. We can click the last page to enter the next atlas, which is very practical.
The modification method is as follows:
Modify include/arc.archives.class.php File
1. Find the "parse template and assign values to changes in content" and add the following code to this paragraph:
function ClickPicNext($ismake=1,$aid,&$body)
{
global $cfg_rewrite;
if($this->NowPage!=$this->TotalPage)
{
$lPage=$this->NowPage+1;
if($ismake=1)
{
$body=preg_replace ("/< (img | IMG) (. *) (src | SRC)=[" | '|] {0,} ((. *)>)/isU "," Click the picture to enter the next page<br/><a href=' ". $this ->NameFirst." _ ". $lPage." ".$this->ShortName."'>"."${0}"."</a>",$body);
}
else
{
$PageList="<a href='view.php?aid=$aid&pageno=$lPage'>". "${0}". "</a>";
if($cfg_rewrite == 'Y')
{
$PageList = str_replace(".php?aid=","-",$PageList);
$PageList = preg_replace("/&pageno=(d+)/i",'-\1.html',$PageList);
}
$body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$PageList,$body);
}
}
else
{
$body=preg_replace("/<(img|IMG)(.*)(src|SRC)=["|'| ]{0,}((.*)>)/isU",$this->GetPreNext('imgnext'),$body);
}
return $body;
}
2. Search
$this->Fields[$this->SplitPageField] = $this->SplitFields[$pageNo - 1];
Add below
if($ClickPicNext){
$this->Fields[$this->SplitPageField]=$this->Fields[$this->SplitPageField];
}else{
$this->Fields[$this->SplitPageField]=$this->ClickPicNext($ismake,$this->Fields['id'],$this->Fields[$this->SplitPageField]);
}
3. Find
$this ->PreNext ['next ']="Next:<a href=' $mlink '>{$nextRow ['title']}</a>";
Add below
$this->PreNext['imgnext'] ="<a href='$mlink'>". "${0}". "</a>";
4. Search
$this ->PreNext ['next ']="Next: None";
Add below
$this->PreNext['imgnext'] ="${0}";
5. Find
else if($gtype=='next')
{
$rs = $this->PreNext['next'];
}
Add below
else if($gtype=='imgnext')
{
$rs = $this->PreNext['imgnext'];
}
Follow the above steps to modify the atlas. Click the picture to enter the next chapter. It is available for personal testing. Try it now.
Statement: All articles on this site, unless otherwise specified or marked, are originally published on this site. No individual or organization is allowed to copy, embezzle, collect and publish the content of this website to any website, book and other media platforms without the consent of this website. If the content of this website infringes upon the legitimate rights and interests of the original author, please contact us for handling.