Dede List page Call article body content

Source: Internet
Author: User

Dede List page Call article description compared with simple label [Field:description function= ' Cn_substr (@me, 180) '/] 180 is the number of words

Another way is to invoke the content of the body of the article call in the list page instead of the description, this need to do two times to develop as follows (Beta version dede5.7 GBK November 4, 2015)

Add the following custom function in include/extend.func.php

123456789101112131415 function Getonearchivebody ($aid, $length) {global $dsql; $aid = Trim (ereg_replace (' [^0-9] ', ' ", $aid)); $body ="; $query = "Select Art.body from ' dede_addonarticle ' art, ' dede_archives ' arc where art.aid= ' $aid ' and art.aid=arc.id '; $arcRow = $d Sql->getone ($query), if (!is_array ($arcRow)) {return $body;} if (Isset ($arcRow [' body ')]) {$body = Cn_substr ($arcRow [' body '], $length);} return $body;}

The list uses [Field:id function=] Getonearchivebody (@me, 1000) "/" Call, and 1000 is the number of words to call

The above call is not filtered in the body HTML if you need to filter then put

1 $body = Cn_substr ($arcRow [' body '], $length);

Replaced by

1 $body = Cn_substr (Html2text ($arcRow [' body ']), $length);

You can filter out the HTML.

If there is a problem, please contact the technical.

Dede List page Call article body content

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.