#Forum 4.1

CREATE TABLE forum_user(
  user_id int(10) NOT NULL AUTO_INCREMENT,
  username varchar(30) default NULL,
  name_display varchar(50) default NULL,
  password varchar(30) default NULL,
  activation_code varchar(100) default NULL,
  activation_status varchar(10) default NULL,
  user_type varchar(10) default NULL,
  user_group int(10) default NULL,
  date_joined date NOT NULL default '0000-00-00',
  email varchar(50) default NULL,
  icq_no varchar(30) default NULL,
  msn_messenger varchar(30) default NULL,
  yahoo_messenger varchar(30) default NULL,
  website varchar(50) default NULL,
  avatar varchar(50) default NULL,
  signature text default NULL,
  lastlogin datetime NOT NULL default '0000-00-00 00:00:00',
  lastip varchar(15) NOT NULL default '',
  session text default NULL,
  PRIMARY KEY  (user_id),
  UNIQUE KEY username (username)
);

INSERT INTO forum_user(user_id,username,password,user_type,name_display,activation_status,user_group,date_joined,lastlogin) VALUES ('1','admin','admin','Admin','Administrator','Active','0',CURRENT_DATE(),'0000-00-00 00:00:00');

CREATE TABLE forum_forum(
  forum_id int(10) NOT NULL AUTO_INCREMENT,
  forum_name varchar(100) default NULL,
  visibility varchar(5) default NULL,
  sequence int(10) default NULL,
  PRIMARY KEY  (forum_id)
);


CREATE TABLE forum_category(
  category_id int(10) NOT NULL AUTO_INCREMENT,
  forum_id int(10) default NULL,
  category varchar(100) default NULL,
  cat_desc text default NULL,
  showpublic varchar(10) default NULL,
  visibility varchar(5) default NULL,
  sequence int(10) default NULL,
  redirect varchar(5) default 'No',
  redirect_url text,
  redirect_hit int(10) default '0',
  PRIMARY KEY  (category_id)
);


CREATE TABLE forum_post(
  post_id int(255) NOT NULL AUTO_INCREMENT,
  user_id int(10) default NULL,
  category_id int(10) default NULL,
  title varchar(100) default NULL,
  message text default NULL,
  type varchar(20) default NULL,
  status varchar(10) default NULL,
  date_post datetime NOT NULL default '0000-00-00 00:00:00',
  last_post datetime NOT NULL default '0000-00-00 00:00:00',
  views int(10) default NULL,
  PRIMARY KEY  (post_id)
);


CREATE TABLE forum_reply(
  reply_id int(255) NOT NULL AUTO_INCREMENT,
  post_id int(255) default NULL,
  user_id int(10) default NULL,
  message text default NULL,
  status varchar(10) default NULL,
  date_post datetime NOT NULL default '0000-00-00 00:00:00',
  quote_msg text default NULL,
  quote_userid int(10) default NULL,
  PRIMARY KEY  (reply_id)
);

CREATE TABLE forum_usergroup(
  group_id int(10) NOT NULL AUTO_INCREMENT,
  group_name varchar(50) default NULL,
  PRIMARY KEY  (group_id)
);

INSERT INTO forum_usergroup(group_id,group_name) VALUES ('1','Members');

CREATE TABLE forum_modcategory(
  user_id int(10) NOT NULL,
  category_id int(10) default NULL
);

CREATE TABLE forum_notifythread(
  user_id int(255) NOT NULL,
  post_id int(255) default NULL
);

CREATE TABLE forum_privateaccess(
  category_id int(10) NOT NULL,
  group_id int(10) default NULL
);


CREATE TABLE forum_unregpost(
  post_id int(10) default NULL,
  email varchar(100) default NULL,
  name_display varchar(255) default NULL
);

CREATE TABLE forum_unregreply(
  reply_id int(10) default NULL,
  email varchar(100) default NULL,
  name_display varchar(255) default NULL
);

INSERT INTO sys_component VALUES (NULL, 'Forum', 'forum', 'forum', 'Multi-moderation feature allows you to effortlessly build, manage your online community, thus promoting customer service by allowing staff to interact with clients.', '4.1', 'wce.manageforum.php', 0, 'Show','');
INSERT INTO sys_variable VALUES ('forum_imageverify', 'Yes');
INSERT INTO sys_variable VALUES ('forum_pageurl', '');
INSERT INTO sys_variable VALUES ('forum_moderatorlistno', '20');
INSERT INTO sys_variable VALUES ('forum_userlistno', '20');
INSERT INTO sys_variable VALUES ('forum_frontuserlistno', '20');
INSERT INTO sys_variable VALUES ('forum_postlistno', '20');
INSERT INTO sys_variable VALUES ('forum_replylistno', '15');
INSERT INTO sys_variable VALUES ('forum_replysort', 'ASC');
INSERT INTO sys_variable VALUES ('forum_searchlistno', '20');
INSERT INTO sys_variable VALUES ('forum_approvepostlistno', '10');
INSERT INTO sys_variable VALUES ('forum_approvereplylistno', '10');

INSERT INTO sys_variable VALUES ('forum_activation', 'Yes');
INSERT INTO sys_variable VALUES ('forum_allowban', 'Yes');
INSERT INTO sys_variable VALUES ('forum_approvesignup', 'Yes');
INSERT INTO sys_variable VALUES ('forum_approvepost', 'No');
INSERT INTO sys_variable VALUES ('forum_avatarsize', '100');
INSERT INTO sys_variable VALUES ('forum_gd', '20');
INSERT INTO sys_variable VALUES ('forum_formatdatejoin', 'Y-m-d');
INSERT INTO sys_variable VALUES ('forum_formatpostdate', 'Y-m-dH:i:s');

INSERT INTO sys_variable VALUES ('forum_headerbgcolor', '#CCCCCC');
INSERT INTO sys_variable VALUES ('forum_forumbgcolor', '#E6E6E6');
INSERT INTO sys_variable VALUES ('forum_categorybgcolor', '#F6F6F6');
INSERT INTO sys_variable VALUES ('forum_bordercolor', '#FFFFFF');
INSERT INTO sys_variable VALUES ('forum_quotebgcolor', '#FFFFFF');
INSERT INTO sys_variable VALUES ('forum_quotebordercolor', '#000000');
INSERT INTO sys_variable VALUES ('forum_unregisterpost', 'Yes');

INSERT INTO sys_variable VALUES ('forum_approvesignupsubject', 'New Member Sign Up Request Approval');
INSERT INTO sys_variable VALUES ('forum_approvesignupbody', 'Dear [[name_display]],\n\nFirst and foremost, we would like to notify you about new sign up request approval by you. Besides, we feel greatful to thanks for your approval.\n\nBelow are member username for new register:\nUsername : [[username]]\n\n\nRegards\nYourDomain.com');
INSERT INTO sys_variable VALUES ('forum_approvepostsubject', 'New [[postreply]] Request Approval');
INSERT INTO sys_variable VALUES ('forum_approvepostbody', 'Dear [[name_display]],\n\nFirst and foremost, we would like to notify you about new [[postreply]] request approval by you. Besides, we feel greatful to thanks for your approval.\n\nBelow are [[postreply]] information:\n\nTopic: [[topic]]\n[[postreply]] Date:[[postdate]]\n\n\nRegards\nYourDomain.com');

INSERT INTO sys_variable VALUES ('forum_signupsubject', 'Thank you for your signup at YourDomain.com');
INSERT INTO sys_variable VALUES ('forum_signupbody', 'Dear [[name_display]],\n\nFirst and foremost, we would like to thank you for your kind support to our website. Besides, we feel greatful to receive your sign up for your free membership account.\n\nBelow are your account information:\n\nUsername : [[username]]\nPassword : [[password]]\n\nPlease keep us informed if you need any of our assistance.\n\n\nRegards\nYourDomain.com');
INSERT INTO sys_variable VALUES ('forum_forgetsubject', 'Your login information at YourDomain.com');
INSERT INTO sys_variable VALUES ('forum_forgetbody', 'Dear [[name_display]],\n\nThank you for contacting us. \n\nBelow are your account information:\n\nUsername : [[username]]\nPassword : [[password]]\n\nPlease keep us informed if you need any of our assistance.\n\n\nRegards\nYourDomain.com');
INSERT INTO sys_variable VALUES ('forum_activationsubject', 'Your Activation Account information at YourDomain.com');
INSERT INTO sys_variable VALUES ('forum_activationbody', 'Dear [[name_display]],\n\nThis email has been sent from \nYourDomain.com \n\nYou have received this email because this email address was used during registration for our forums. \nIf you did not register at our forums, please disregard this email. \nYou do not need to unsubscribe or take any further action. \n\nThank you for registering. \nWe require that you \"validate\" your registration to ensure that the email address you entered was correct. This protects against unwanted spam and malicious abuse. \n\n[[activatecodelink]] \n\n------------------------------------------------ \nNot working? \n------------------------------------------------ \nIf you could not validate your registration by clicking on the link, please visit this page:\n\n[[activatelinkpage]]\n\nIt will ask you for a Username, and your validation key. These are shown below: \n\nUsername: [[username]] \nValidation Key: [[activatationkey]] \n\nPlease cut and paste, or type those numbers into the corresponding fields in the form. \n\nIf you still cannot validate your account, it is possible that the account has been removed. \nIf this is the case, please contact an administrator to rectify the problem. \n\nThank you for registering and enjoy your stay! \n\nRegards \nYourDomain.com');
INSERT INTO sys_variable VALUES ('forum_notifysubject', 'Topic Reply Notification - [[topic]]');
INSERT INTO sys_variable VALUES ('forum_notifybody', 'Dear [[name_display]],\n\nYou are receiving this email because you are watching the topic, \" [[topic]] \" at YourDomain.com. This topic has received a reply since your last visit.\n\nYou can use the following link to view the replies made, no more notifications will be sent until you visit the topic.\n\n[[view_link]]');
INSERT INTO sys_variable VALUES ('forum_approvenotifysubject', 'Approve [[postreply]] Notification - [[topic]]');
INSERT INTO sys_variable VALUES ('forum_approvenotifybody', 'Dear [[name_display]],\n\nYou are receiving this email because your [[postreply]] topic \" [[topic]] \" at YourDomain.com are approve by administrator or moderator.\n\nYou can use the following link to view more details, no more notifications will be sent until you visit the topic.\n\n[[view_link]]');
INSERT INTO sys_variable VALUES ('forum_termagreement','While the administrators and moderators of this forum will attempt to remove or edit any generally objectionable material as quickly as possible, it is impossible to review every message. Therefore you acknowledge that all posts made to these forums express the views and opinions of the author and not the administrators, moderators or webmaster (except for posts by these people) and hence will not be held liable.\n\nYou agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-oriented or any other material that may violate any applicable laws. Doing so may lead to you being immediately and permanently banned (and your service provider being informed). The IP address of all posts is recorded to aid in enforcing these conditions. You agree that the webmaster, administrator and moderators of this forum have the right to remove, edit, move or close any topic at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While this information will not be disclosed to any third party without your consent the webmaster, administrator and moderators cannot be held responsible for any hacking attempt that may lead to the data being compromised.\n\nThis forum system uses session to store information on the server. These sessions do not contain any of the information you have entered above; they serve only to improve your viewing pleasure. The e-mail address is used only for confirming your registration details and password (and for sending new passwords should you forget your current one).\n\nBy clicking Register below you agree to be bound by these conditions.');
