Forum Design

Source: Internet
Author: User
Tags access database
Nowadays, online forums are everywhere, but I wonder if you have encountered such a situation: Looking for the content you want in the disorganized discussion information, it is a very time-consuming and laborious task. Later on, you don't want to go to any forums. So can we add a review function for the content of our website forum? That is, all the posts posted to the forum by netizens are not immediately displayed. They must be reviewed by the webmaster or moderator and considered valuable. If they are recommended to other netizens, they will be published. Otherwise, it will be deleted, so as not to waste space and make it a bit like an excellent area. In this way, your forum can provide clear and beneficial content compared with other forums. Put it on your website to attract more users. This idea can certainly be implemented. Next I will briefly introduce how to make it.
Note: this article applies to users who have some knowledge about ACCESS databases, HTML and ASP.
I. Forum Structure Analysis
Through the above functional requirements analysis, we can divide forum production into four parts:
(1) User Registration and Management Module: because webmasters or moderators are introduced, they must be able to authenticate in the forum. The function of this module is to manage registered users and provide related queries. For example, you can query all the articles published by the specified author and the Ten netizens who have published the most articles. If your forum is not very large, this module can be omitted as only having the moderator authentication function, and the registration and query sections are removed.
(2) Article Display Module: displays the articles that are recommended by all moderators for review.
(3) Post module: provides users with a place where they can post their posts. The Post will be reviewed by the moderator.
(4) Article Review Module: The moderator has decided whether to post or delete any published but unreviewed articles on the Internet.
After learning about the specific functional requirements, you can start designing the forum according to the module. Of course, these modules only divide the Forum structure in terms of functions. In fact, they cannot be completely designed independently. For such small applications, there is no need to fully modularize the design. It may be easier to directly write program code under good planning.
There are two methods to implement the Forum: Using files or databases. Relatively speaking, the use of databases should be simpler and more efficient, so as to better control the forum and provide some verification and protection for the materials. Here I am using an ACCESS database. For small and medium-sized applications, ACCESS should be competent.
From the above analysis, we can see that there should be four tables. Below I will show the structure of each table.
(1) Author table (used to store author information ):
ID: text type, required. It is a netizen code.
Password: text type, required.
Nickname: text type, required.
EMAIL: text type, required.
Title: number type, required. -1 stands for normal netizens and 0 stands for webmasters. A number greater than 0 indicates the moderator.
Number of articles: number type, required. Total number of articles published by netizens.
Name: text type. Optional.
Gender: text type. Optional.
Phone: text type. Optional.
(2) content table (used to store the content of a specific article and related information ):
ID: the ID is automatically numbered and indexed to speed up search.
Panel ID: number type, from the panel list, indicating the panel to which the article belongs.
Topic ID: number type, from the topic table, indicating the topic of the article.
Author ID: text type, from the author table, indicating the author of the article.
Date: Date/Time type. The preset initial value is NOW (), and the current system time is automatically set to its value.
Title: text type. The title of the article.
Published: Yes/No. If it is "true", the article has been reviewed and can be published. If it is "no", the article has yet to be reviewed.
Recommendation level: number type, article recommendation level.
Content: Remark type, specific content of the article.
Number of clicks: number type, number of clicks on an article. (3) Dashboard List (used to store information about Dashboard ):
ID: automatic ID. Similarly, an index is also set for it.
Name: text type, card name.
Banner: text type, the ID of the banner.
Number of topics: number type, the number of topics contained in the dashboard.
(4) topic table (used to store information about the topic ):
ID: automatically numbered and indexed.
Title: text type, indicating the topic name.
Panel: number type, from the panel list, indicating the panel to which the topic belongs.
Number of articles: number type, number of articles included in the topic.
All tables are designed, but the database design is not complete. Therefore, we need to establish a relationship between tables so that the database can perform correlation checks to avoid data errors. Another benefit of establishing the relationship between tables is that it can easily create complex JOIN queries.
Generally, when we operate databases in ASP, we use the query generated during execution, which is then passed to the database for interpretation and execution. Here we use storage queries. Compared with the query at execution time, the pre-stored program has more advantages.
It is stored in the database and is independent of ASP program code, making it easier to establish and modify, and the query efficiency is higher and faster. It can be used on the ASP page after debugging, it can avoid many problems. The stored query ASP program code is easier to read and modify. It may be annoying to use SQL queries in ASP, especially those with commas, semicolons, and so on. After using storage queries, you don't have to worry about these issues. Of course, there are some precautions for using the pre-stored program. I will explain in detail how to use it later. It is easy to create a pre-stored program in ACCESS. I will not talk about it here. Here, I only provide the SQL statement program code for each query.

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.