This article describes how to click an image on the next page and how to modify it, for more information about how to click images on the next page in dedecms 5.7, see the next article.
Dedecms Template: www.php1.cn/xiazai/code/dedecms
Modify the/include/arc. archives. class. php file
1. find "resolution template, assign values to changes in the internal volume" and add the following code before.
Copy content from PHP Code to clipboard
Function ClickPicNext ($ ismake = 1, $ aid, $ body) {global $ response _rewrite; if ($ this-> NowPage! = $ This-> TotalPage) {$ lPage = $ this-> NowPage + 1; if ($ ismake = 0) {$ body = preg_replace ("/<(img | IMG) (. *) (src | SRC) = [\ "| '|] {0 ,}((. *)>)/isU "," click the image to go to the next page.
NameFirst. "_". $ lPage. ". ". $ this-> ShortName. "'> ". "\ ${0 }". "", $ body);} else {$ PageList = "NameFirst. "_". $ lPage. ". ". $ this-> ShortName. "'> ". "\ ${0 }". ""; if ($ pai_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. find "$ this-> Fields [$ this-> SplitPageField] = $ this-> SplitFields [$ pageNo-1];" and add the following code under this code:
Copy content from PHP Code to clipboard
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 Group ";" and add the following code under this code:
Copy content from PHP Code to clipboard
$this->PreNext['imgnext'] =""."\${0}"."";
4. find "$ this-> PreNext ['Next'] =" next: No ";" and add the following code under this code:
Copy content from PHP Code to clipboard
$this->PreNext['imgnext'] ="\${0}";
5. find the following code:
Copy content from PHP Code to clipboard
else if($gtype=='next') { $rs = $this->PreNext['next']; }
Add the following code below:
else if($gtype=='imgnext') { $rs = $this->PreNext['imgnext']; }
{Dede: field name = 'imgurls' alt = 'image output'} [field: pagestyle runphp = 'yes'] @ me = (@ me = 3? '': ''); [/Field: pagestyle] {/dede: field}
The above is the details of the sample code for clicking images to the next page in dedecms5.7. For more information, see other related articles in the first PHP community!