Mysql-based bbs design (4)

Source: Internet
Author: User
Mysql-based bbs design (4) 5. Layout module design
The so-called classification is mostly for the telnet Server. in cq66 mode, you can press
Classification according to your own wishes. In the end, access is directly based on the version.
For access to layout articles, the entire article is used as the parameter during storage. the sections of the article are divided by the current layer.
Complete. if the upper layer is transmitted in blocks, all parameters are transmitted on the upper layer. after the combination, the parameters are transmitted to the current layer.
Break down; during reading, this layer is accessed in blocks. if the upper layer is accessed in full text
In the upper layer.
As for the need for independent indexing, the upper-layer operations are not affected, and the primary and lower-layer database structures are:
It mainly considers feasibility and efficiency requirements.
Where can I check permissions? Put it on the upper layer. In fact, telnet the server,
And cq66 clients do not display the menu of special commands to general users. of course, you can
To directly send the command cq66, the server still needs to check. However, you do not need to perform the following operations.
Check the module layer again.
. Class BoardManage {
Private:

Public:
// Operation on classification
Int GetClassNameInfo (int maxclass, char ** classid,
Char ** classname );
Returns the category information, which is a Chinese name.
Int GetBoardName (int maxboards, char * classid,
Char ** boardname );
Returns the layout information of a category. Generally, the layout information is directly selected ..
From sboard
Where boardclass =... for special classification, query the corresponding table ....

// Modify the privileges above the layout administrator
Int NewClass (char * newclassname, int type );
New category, General category or special category,
Int DeleteClass (char * newclassname );
This layer is not responsible for consistency, and the upper layer is responsible
The category information of the corresponding layout is changed to another one. The category name is also deleted first and then created,
Int AddClassBoard (const char * classname, char * newboardname );
Adds an existing version to a specific category, specifically for a special category.
The effect is the same as that of modifyboardinfo,
Int DeleteClassBoard (const char * classname, char * boardname );
Deleting a version from a category also applies to special categories.
Is the same as modifyboardinfo, the classification attribute of a version can be empty, that is, not
In any category.

// Operations on version information.
Int NewBoard (const char * boardid, char * boardname );
Create a new version and create a corresponding table. For other parameters, use the default value.
Int DeleteBoard (const char * boardid );
Delete a version and delete the corresponding table.
Int GetBoardInfo (const char * boardid, char * boardname,
Int & numposts, char * masters, char * class,
Long & level );
The layout information.
Int ModifyBoardId (const char * oldid, char * newid );
Change the English version id. The table name must also be changed,
Int ModifyBoardInfo (const char * boardid, char * boardname,
Int numposts, char * masters, char * class,
Long level );
Privilege is required to modify layout information.

// Operations on the layout.
Int AddText (char * boardid, char * title, char * writer,
Char * text );
Add an article to the layout and divide the long article into 2 k blocks.
Int DeleteText (char * boardid, int num );
Deleting an article only makes a tag and does not immediately modify the corresponding table.
Int FlushTable (char * boardid );
Refresh the layout and delete the corresponding records of the deleted article.
Int MarkText (char * boardid, int num, char mark );
Mark the article.
Int ModifyTitle (char * boardid, int num, char * newtitle );
Modify the title of an article.
Int ModifyText (char * boardid, int num, char * newtext );
Modifying the content of an article does not require the privilege of your own article.
Int GetTextInfo (const char * boardid, int num, char * title,
Char * writer, char & mark );
Obtain the title information of an article.
Int GetText (const char * boardid, int num, int block,
Char * text );
Reads the content of an article, in blocks.

// Query of articles and authors
// Return all query results at one time?
Int QueryWriter (const char * boardid, char * writer,
Char ** result );
Query an author's article on the layout.
Int QueryTitle (const char * boardid, char * title,
Char ** result );
On the query page, the title contains the specified content.
}
Parameter passing is a very annoying thing. from an abstract point of view, you want
It is irrelevant to the underlying layer, so it should be processed. However, from the perspective of efficiency, data is not expected to be processed multiple times.
Replication, on the other hand, whether the application for space release is completed in the upper layer or in the current layer
What about it? Accidentally, memory errors may easily occur.

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.