Website construction: news publishing system _ PHP
Source: Internet
Author: User
How can we build a news system? A complete news system includes not only the news interface for browsing, but also the powerful functions of control and background management. how can we schedule and allocate sub-functions in these functions? Next we will introduce the allocation control of various functions. the implementation of news systems is simple, but it can be said that it is very complicated. how can we set up a news system in three ways? A complete news system includes not only the news interface for browsing, but also the powerful functions of many functions and background management.
How can we schedule the allocation of sub-functions in these functions? The following describes the configuration control of various functions. the implementation of the news system is simple, but it can be said that it is very complicated.
The news system can be divided into three parts: the administrator logs on to the system, the news management system, and the user browses the system. The whole process is simple:
1. management personnel publish news --> database --> Users browse news
2. locate the problem --> log on to the management system --> edit and modify the news
The above process seems simple, but it is not so simple to implement. this is a system development that is far more complicated than the implementation of the message board, but the basic operation principle is the same as that of the message board. the top priority of the news publishing system lies in the database planning and management system implementation.
What are news content: news classification and information ontology.
The two items in the database package letter can be implemented in one data table, but they are not economical. Therefore, we can use two data tables to store the content separately, and one specifically stores the news classification, another ontology is used to store information. how can we call this function to share two tables? Table join is used to solve this problem (this section does not introduce this knowledge. you can refer to the database-related knowledge and obtain the most valuable knowledge from your own efforts, right ?)
The following describes how to implement the management function:
1. first, publishing news
This is a combination of a series of submission forms. here there are two categories: creating news categories and publishing news; creating news categories, and then publishing relevant news in each category, easy! This is not the case. think about how all the information ontology is concentrated in a data table and how to distinguish information classification. The Table Association mentioned above is very important, of course, this method is not required. creating an independent table for each category can solve the problem, but is it cost-effective? What about maintainability and scalability?
The call of news classification and information ontology causes trouble. right, the solution is to use table Association.
2. Editing, modification, and deletion problems
This is the basic application of php + mysql knowledge. it is not difficult to implement these functions. I will not introduce them much here, but note that when you change or delete a category, how can we process the information ontology under this category? Because table Association is used, these functions are processed in the same table.
3. handling multiple jobs
But what happens when many people edit a piece of news at the same time? In this case, the database will only store the Last Edited content. this situation will mean that the previous modified users are working hard in vain. to solve this problem with multiple efforts, the primary approach is to take the lead, that is, you have the editing permission first, and then you have only the browsing permission until the editing is complete. this function is like linux permission control, isn't it?
There are several methods to complete this function: 1. use cookies for control, 2. add weighted control fields in the table. of course, it is easier to use cookies. the cookie implementation method and process are as follows:
When an administrator enters the editing process and sets the cookie, the cookie value is determined by the program segment of the editing function. If this parameter is set to null, the cookie value can be edited. if it is not null, the cookie is denied. when you exit the editing process, the cookie is cleared; the multi-job function is an effective function, which can at least reduce the waste of time and manpower.
The implementation of the news browsing function is very simple. with the page flip function (introduced on this site), the powerful news system is basically completed, and it seems that a very important function is missing. good news is the search engine, this function will be described in detail later.
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.