Mysql-based BBS design (4)

Source: Internet
Author: User

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 Layout Article When stored, the entire article is used as the parameter. 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 );
obtain the layout information.
int modifyboardid (const char * oldid, char * newid);
change the English version ID and the table name,
int modifyboardinfo (const char * boardid, char * boardname,
int numposts, char * masters, char * class,
long level );
to modify the layout information, you must have the privilege.

// operations on the layout.
int addtext (char * boardid, char * Title, char * Writer,
char * text);
add an article to the layout, split long articles into 2 k blocks internally.
int deletetext (char * boardid, int num);
delete an article, just mark it and do not immediately modify the corresponding table.
int flushtable (char * boardid);
refresh the layout and delete the corresponding records of the deleted Articles.
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 article content is not a privilege required by your own article.
int gettextinfo (const char * boardid, int num, char * Title,
char * Writer, char & mark);
get the title information of the article.
int gettext (const char * boardid, int num, int block,
char * text);
read the content of the article, in blocks.

// query by article and author
// returns all query results at a 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.
}< br> parameter transfer is an annoying task. From an abstract point of view, it is necessary to process the returned data because it is irrelevant to the
underlying layer, however, from the perspective of efficiency, data is not expected to be copied multiple times.
On the other hand, the application for space release, is it done in the upper layer or in the current layer
? 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.