Weaving dream Dedecms Get the next article link method

Source: Internet
Author: User
This article mainly introduces the weaving dream dedecms to obtain the next article link of the method, this article explains the way to get the next article in PHP's link, the need for friends can refer to the next

We know that in the article page call before and after the link and title of the article, dedecms default on the previous and next article of the label is {dede:prenext get= ' pre '/} {dede:prenext get= ' next '/}. Sometimes we just need links instead of headings, and how do we do that? We should be able to think of a regular, right? That's right! The final implementation code is given below.

Dedecms template Download Address: www.php.cn/xiazai/code/dedecms

Previous Address

The code is as follows:

{dede:prenext get= ' pro ' runphp= "yes"}preg_match_all ('/(. +?) <\/a.*?>/sim ', @me, $strResult, preg_pattern_order); @me = $strResult [1][0]; {/dede:prenext}

Next Address

The code is as follows:

{dede:prenext get= ' next ' runphp= "yes"}preg_match_all ('/(. +?) <\/a.*?>/sim ', @me, $strResult, preg_pattern_order); @me = $strResult [1][0]; {/dede:prenext}

Extension: How to modify the word count of the upper and lower articles

Edit Open include/arc.archives.class.php file
Find: $this->prenext[' pre '] = "previous: {$preRow [' title ']}";
Add the following code to this line $prerow[' title ']=cn_substr ($preRow [' title '],30);//display up to 15 characters
Find: $this->prenext[' next '] = "Next: { $nextRow [' title ']} ";
Add the following code to this line $nextrow[' title ']=cn_substr ($nextRow [' title '],30);//display up to 15 kanji
and then regenerate all pages.

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.