I believe that everyone who has been to the Oso will be very impressed by the Oso forum, which is a very good forum on the one hand. Do you want your homepage to have such a beautiful forum, in fact, not too complicated, below we only from some basic part of the Oso forum to achieve the imitation.
Because I only use this forum as my message board, so my forum can be regarded as the Oso forum of the simple match. 1, in my forum only after the user login to speak, the user ID is there is a "cookie_user" cookie variable, 2, my forum does not have sub-forum, 3, I do not count the number of clicks on a theme, 4, In the OSO forum in front of each topic to indicate that there are no new posts icon I did not design, 5, for the Oso forum to provide the choice of topic arrangement and display time period I did not consider, 6, no member posts points statistics, 7, no moderator management forum function, 8, no post editing function. In the end, we'll mention how to expand these eight features on my program.
The first is a database design, in fact, a forum involving two data tables, we will temporarily name it user, guestbook, in the user table is stored in the user's information. Its creation statement is as follows:
CREATE TABLE My_user (
user_id Char (a) not null,/* username */
User_password varchar (8) Not null,/* user password */
PRIMARY KEY (user_id)
)
The contents of the posts are stored in the guestbook. It is created as follows:
CREATE TABLE Guestbook (
ID bigint DEFAULT ' 0 ' not NULL auto_increment,/* speaker ID, self-added field * *
Name varchar not null,/* Theme Creator */
Type tinyint not null,/* 0-reply; 1-Main Post * *
Theme varchar () null,/* Theme * *
Content blob not null,/* contents * *
Icon tinyint not null,/* emoticons * *
Time_open datetime not null,/* Theme creation time * *
Time_close datetime not null,/* final reply time * *
Answer_count int not null,/* reply number * *
Answer_name varchar (a) Not null,/* final reply person * *
main_id bigint null,/* Main paste id*/
PRIMARY KEY (ID)/**/
);
The program contains five PHP source code: connect.inc.php,faq.php,read.php,post.php,reply.php,post_end.php
connect.inc.php: (Used to connect to the database)
?
$dbhostname = "localhost";
$dbusername = "";
$dbpassword = "";
$dbName = "";
Mysql_connect ($dbhostname, $dbusername, $dbpassword) or DIE ("Unable to CONNECT to database");
@mysql_select_db ("$dbName") or Die ("Unable to select database");
?>
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.