Enough to build a website: Press release system

Source: Internet
Author: User
How to set up a news system? A complete news system includes more than just the media for browsing, but it also includes many features and strong background management capabilities.
So how do you schedule allocations for these functions? Here is a brief introduction to the various functions of the deployment control. The implementation of the news system is simple, but it can be said to be very complex.
The news system can be divided into three parts: administrator login system, news management system, user browsing system. The whole process is simple:
1. Managers release News--> database--> users to browse news
2. Discovery problem--> Login Management System--> Edit Modify News
The above process seems simple, but the realization is not so simple, this is a system development, far more complex than the message version of the implementation, but the basic principle of operation and message version of the same. The key point of the news publishing system is the realization of the database planning and management system.
Now come to the news have what content: News classification, Information ontology.
In the database package these two items in a data table can be implemented, but not economical, so we can use two data tables to store content, one is dedicated to store news classification, and another to store information ontology. How do I invoke the sharing of two-table content? Use Table associations to implement this problem ( Here does not introduce this knowledge, the reader can refer to the database related knowledge content, rely on their own efforts to get the most valuable knowledge, is not it?
The following is a description of the implementation of the management function:
1. First, the release of the News
This is a series of submitting forms together, and here are two categories, create news classification and release news, create the news classification, and then in various categories to publish related news, very simple! Not so, think of all the information ontology is concentrated in a data table, how to distinguish the classification of information, The table association mentioned above is very important, of course, but it's also a good deal to create a separate table for each category, but is it worth it? What about maintainability and scalability?
The related call of news classification and information ontology has caused trouble, and the solution is to utilize Table association.
2. Edit, modify, delete the question
This is the basic use of php+mysql knowledge, to achieve these functions without difficulty, here do not make too much introduction, just want to note is to change or delete a classification, how to deal with the information ontology under the classification? Because of the use of table associations, handling these functions is like working in a table.
3. Multi-worker processing
But what happens when many people edit a piece of news at the same time? In the case of the database will only store the last edited content, this situation will mean that the previous modification of the people's hard work in vain, the reactive treatment is to solve this problem, the method is to take the preconceived, that is, first into the editor of the editing permission, You then enter only the browsing permission until the edit is complete. This feature is much like Linux's access control, isn't it?
There are several ways to do this: 1. Use cookies to control, 2. Add the right control field to the table. Of course, cookies are simpler, and cookies are implemented in the same way and process:
When an administrator enters the edit, set cookies, edit the function of the program section to determine the cookie value, for the empty allow editing, not null to edit, exit the cookie will be empty, so cycle; multi-worker function is an effective function, at least can reduce the time and human waste.
The realization of the news browsing function is very simple, plus the function of the page (this site has been introduced), the powerful news system is basically completed, it seems that a very important function, is a good search engine, this feature will be introduced in detail later.

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.