Dedecms v5.7 implementation click the image to go to the next page for details

Source: Internet
Author: User

Today, when I got a picture station, I found that all other websites could click an image and go directly to the next page. So baidu searched for it and found a method that was feasible after testing.

Follow these five steps.

Modify include/arc. archives. class. php

1. Find the "// resolution template, assign values to changes in the internal volume" field, and add the following code in this section:

The code is as follows: Copy code

Function ClickPicNext ($ ismake = 1, $ aid, & $ body)
{
Global $ pai_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 <br/> <a href = '". $ this-> NameFirst. "_". $ lPage. ". ". $ this-> ShortName. "'> ". "$ {0 }". "</a>", $ body );
}
Else
{

// Static page

$ PageList = "<a href = '". $ this-> NameFirst. "_". $ lPage. ". ". $ this-> ShortName. "'> ". "$ {0 }". "</a> ";

// Dynamic page
// $ PageList = "<a href = 'View. php? Aid = $ aid & pageno = $ lPage '> "." $ {0} "." </a> ";
If ($ response _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]; add

The code is as follows: Copy code

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 article: <a href = '$ mlink' >{$ nextRow ['title']} </a>"; add

The code is as follows: Copy code

$ This-> PreNext ['imgnext'] = "<a href = '$ mlink'>". "$ {0}". "</a> ";

4. Search for $ this-> PreNext ['Next'] = "next: No"; add

The code is as follows: Copy code

$ This-> PreNext ['imgnext'] = "$ {0 }";

5. Search

The code is as follows: Copy code

Else if ($ gtype = 'next ')
{
$ Rs = $ this-> PreNext ['Next'];
}

Add

The code is as follows: Copy code

Else if ($ gtype = 'imgnext ')
{
$ Rs = $ this-> PreNext ['imgnext'];
}

Related Article

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.