Yaapi and PHP build a simple Content management system

Source: Internet
Author: User
Tags mail php class php file mysql database root directory

If you are a developer who is building a Web site with rich content, you may need to consider these solutions, including (a) a database for content, (b) a template system that separates the GUI from the content, (c) a user-friendly interface for maintaining data in the database, and (d) control over the final appearance of the generated page. A very interesting solution to providing all of the above is Yaapi, which is the initials of your article application programming interface (Your Article application Programming Interface). It is a PHP class that provides a built-in way to access content stored in a database. The management module is equipped with classes that assist in managing data, and the API itself is strong enough to handle most of the common tasks required by content management Systems (CMS).

Installation
To install and use YAAPI, you need a Web server that supports PHP, such as Apache, and, of course, PHP, as well as the MySQL database server. You can download a copy of the YAAPI and unzip it to a location in the server root directory.

You also need to create a MySQL database to accommodate the YAAPI data structure. Create the database using the Yaapi.sql file in the source file, and then open the Yaapi configuration in the class constructor (article.class.php file) and update it using the name and access parameters for the database.

Add content
To add content to the database, you must replace "Your-server" with the Yaapi Management module on the http://your-server/yaapi-root/admin/(with the name of the server where Yaapi is installed). Replace "Yaapi-root" with the Yaapi unpacked directory. You use this management module to create (and delete) content categories, and then put the articles in these categories. Here's a summary of the fields you'll encounter in this process:

Categories (Category): Categories of articles
Chapter ID (section ID): If your article has two levels, use this parameter to define the second level.
Title (title): Title of the article
Author (Author): Author of the article
e-mail (e-mail): Article author's email address
License (Approved): A flag used to indicate whether an article has been "licensed" to be displayed
Image: An optional image URL associated with an article
Content: Content of the article
A little note about the last item above: by inserting a separator in the text of the article, Yaapi is able to display a large section of your article in several small pages. See the following example:

Introduction of article here

#intro #
Page 1 Content here
#page #
Page 2 Content here
#page #
Page 3 Content here
#page #
And so on ...

Don't forget to make sure after you enter the article, because only confirmed articles can be retrieved using the API.

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.