Dedecms's article links are restricted to the current topic.

Source: Internet
Author: User

Modification method:
Find the function getprenext () in include/inc_archives_view.php and modify it: CopyCode The Code is as follows ://--------------------------
// Obtain the previous and next links
//--------------------------
Function getprenext ()
{
$ Rs = "";
$ Aid = $ this-> arcid;
$ Rid = $ this-> fields ['typeid'];
$ Next = "#@__ archives. ID> '$ aid' and ##__ archives. typeid = '$ rid' order by #@__ archives. id asc ";
$ Pre = "#@__ archives. ID <'$ aid' and ##__ archives. typeid = '$ rid' order by #@__ archives. id desc ";
// $ Next = "##__ archives. ID> '$ aid 'order by #@__ archives. id asc ";
// $ Pre = "#@__ archives. ID <'$ aid 'order by #@__ archives. id desc ";
$ Query = "select #@__ archives. ID, #@__ archives. title,
##__ Archives. typeid, #@__ archives. ismake, #@__ archives. senddate, #@__ archives. arcrank, ##__ archives. Money,
##__ Arctype. typedir, #@__ arctype. typename, #@__ arctype. namerule, #@__ arctype. namerule2, #@__ arctype. ispart,
##__ Arctype. moresite, #@__ arctype. siteurl
From #@__ archives left join #@__ arctype on #@__ archives. typeid =#@__ arctype. ID
Where ";
$ Nextrow = $ this-> dsql-> getone ($ query. $ next );
$ Prerow = $ this-> dsql-> getone ($ query. $ pre );
If (is_array ($ prerow )){
$ Mlink = getfileurl ($ prerow ['id'], $ prerow ['typeid'], $ prerow ['senddate'], $ prerow ['title'], $ prerow ['ismake'], $ prerow ['arcrank '], $ prerow ['namerule'], $ prerow ['typedir'], $ prerow ['money'], true, $ prerow ['siteurl']);
$ Rs. = "previous: <a href = '$ mlink' >{$ prerow ['title']} </a> ";
}
Else {
$ Rs. = "previous: No ";
}
If (is_array ($ nextrow )){
$ Mlink = getfileurl ($ nextrow ['id'], $ nextrow ['typeid'], $ nextrow ['senddate'], $ nextrow ['title'], $ nextrow ['ismake'], $ nextrow ['arcrank '], $ nextrow ['namerule'], $ nextrow ['typedir'], $ nextrow ['money'], true, $ nextrow ['siteurl']);
$ Rs. = "next article: <a href = '$ mlink' >{$ nextrow ['title']} </a> ";
}
Else {
$ Rs. = "next article: No ";
}
Return $ RS;
}

If you do not modify it, You can also download the modified: inc_archives_view.php.

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.