Design of BBS based on MySQL (IV.)

Source: Internet
Author: User
5. Layout module Design
The so-called classification, more is for Telnet server to consider, in cq66 mode, users can press
According to their own wishes to classify, anyway, the final is directly to version as the basic unit of access.
For the access to the layout article, the time to store the whole article as a parameter, the article is divided into pieces by this layer
Complete, if the upper layer is routed in blocks, then all the upper layers are passed, combined, and then transferred to this level
decomposition; At the time of reading, this layer is accessed in block units, if the upper level is to be accessed in full text
, then do the merge work on the top, regardless of the level.
As for the independent index, does not affect the upper level of operation, the main and lower database structure has
, the main consideration is the feasibility, the efficiency demand and so on.
Where does the permission check go? Or put it on the top, in fact, Telnet server side,
And cq66 client, will not give the general User a special instruction menu, of course, users can
To send the cq66 instructions directly, the server side is still to check. But there should be no work under it.
Can you check the module layer again?
。 Class Boardmanage {
Private

Public
Action on sorting
int getclassnameinfo (int maxclass, char **classid,
char * * classname);
Returns the information for the category, in Chinese and English names.
int getboardname (int maxboards, char *classid,
Char **boardname);
Returns the layout information of a category, general classification, direct Select.
From Sboard
where Boardclass = = .... Special classification is to check the corresponding table ....

Modify the privileges required above the layout administrator
int Newclass (char * newclassname, int type);
New categories, general categories or special categories,
int Deleteclass (char *newclassname);
Delete classification, but not cascade, that is, this layer is not responsible for consistency, the upper level is responsible for the
The corresponding layout of the classification information changed to something else. Classification renaming is deleted and built first,
int Addclassboard (const char *classname, char *newboardname);
Add the already-built version to a category, specifically for special categories, for general classification,
The effect is the same as Modifyboardinfo,
int Deleteclassboard (const char *classname, char *boardname);
Delete a version from the category, but also for special categories, the general classification, the effect is
Is the same as Modifyboardinfo, a version of the classification attribute can be empty, that is, not a
In any category.

Information about the version of the operation.
int Newboard (const char *boardid,char *boardname);
Create a new version to create the corresponding table. Other parameters take the default values.
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 information of the page to be taken.
int Modifyboardid (const char *oldid, char *newid);
Change the version of the English ID, corresponding to the name of the table will also change,
int modifyboardinfo (const char *boardid, Char *boardname,
int numposts, char *masters, Char *class,
Long level);
You need privileges to modify the layout information.

Action on the layout article.
int addtext (char *boardid, Char *title, Char *writer,
Char *text);
Add articles to the layout, and divide the long articles into 2k pieces inside.
int DeleteText (char *boardid, int num);
Delete the article, just make a mark, do not immediately modify the corresponding table.
int flushtable (char *boardid);
Refresh the layout and delete the corresponding records of deleted articles.
int Marktext (char *boardid, int num, char mark);
Make a mark for the article.
int Modifytitle (char *boardid, int num, char *newtitle);
Modify the title of the article.
int Modifytext (char *boardid, int num, char *newtext);
Modify the content of the article, not your own articles need privileges.
int gettextinfo (const char *boardid, int num, char *title,
Char *writer, char& mark);
Gets the title information for the article.
int GetText (const char *boardid, int num, int block,
Char *text);
Reads the contents of the article, in blocks.

Articles and authors ' inquiries
Return all the results of a query at once?
int querywriter (const char *boardid, Char *writer,
Char **result);
Query layout, an author's article.
int querytitle (const char *boardid, Char *title,
Char **result);
In the query layout, the title contains the article for the specified content.
}
The transfer of parameters is a rather annoying thing, from an abstract point of view, you want to return the data with the
The bottom layer is irrelevant, so it should be dealt with, but from an efficiency standpoint, you don't want the data to be repeated
Replication, on the other hand, the release of space applications, whether it is done in the upper layer or in this tier
It? carelessly, it is easy to have memory error.

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.