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']; } |