Empire CMS Article List page read Newstext content

Source: Internet
Author: User

Imperial CMS article system content is stored in the text rather than stored in the database, the database is stored in the text of the path, placed with the D\txt directory, in the article system to make a single page, may be in the list page read Newstext fields, such as:


[e:loop={Select Title,newstext from {$dbtbpre}ecms_article WHERE classid= $classid ORDER by ID LIMIT 1 ", 0,24,0}]
<div class= "Foabout" >
<?= $BQR [newstext]?>
</div>
[/e:loop]

But this read out value is the path of the article content, find the source code, in the e\class\connect.php file about 3630 lines have a method function Gettxtfieldtext ($pagetexturl)


function Gettxtfieldtext ($pagetexturl) {
Global $ecms _config;
if (empty ($pagetexturl))
{
Return ";
}
$file = $ecms _config[' sets '] [' Txtpath ']. $pagetexturl. " PHP ";
$text =readfiletext ($file);
$text =substr ($text, 12);//Remove Exit
return $text;
}

This method can be called to read the contents of the article, so the above code can be changed as follows:

[e:loop={Select Title,newstext from {$dbtbpre}ecms_article WHERE classid= $classid ORDER by ID LIMIT 1 ", 0,24,0}]
<div class= "Foabout" >
<?=gettxtfieldtext ($BQR [newstext])?>
</div>
[/e:loop]

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.