Dedecms5.7: sample code for clicking an image on the next page

Source: Internet
Author: User
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!

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.