-- 论坛角色表
DROP TABLE IF EXISTS ntsky_t_role;
CREATE TABLE ntsky_t_role(
	id			SMALLINT NOT NULL ,			-- 角色编号
	name			VARCHAR(255) NOT NULL ,			-- 角色名称
	type			TINYINT NOT NULL ,			-- 角色类别 (0、注册用户组;1、系统用户组)
	description		TEXT default '',			-- 角色描述
	-- permissions		TEXT NOT NULL ,				-- 角色对应的权限
	-- parentRole		INT NOT NULL ,				-- 父角色
	icon			VARCHAR(255) NOT NULL ,			-- 等级图片
	min_topic		INT NOT NULL ,				-- 最少主题
	permissions		TEXT NOT NULL ,				-- 权限数组 (权限点=值|权限点=值)

	PRIMARY KEY(id)
)
TYPE=InnoDB DEFAULT CHARSET=utf8 COMMENT '论坛角色表';
-- 系统用户
INSERT INTO ntsky_t_role VALUES(0,'guest',1,'过客','level1.gif',-1,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canEditPost=0|canDeleteOwnPost=0|canMoveOwn=0|canPostPoll=0|canVote=0|canGetAttachment=0|canUploadAttachment=0|uploadAttachmentSize=0|canViewUser=1|canUseSignature=0|canCustomFace=0|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=0|mostReceiverUsers=10|messageMaxSize=100|inboxSize=1024');
INSERT INTO ntsky_t_role VALUES(1,'系统管理员',1,'system manager','level100.gif',-1,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=30720|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=1|canMove=0|canTopTopic=1|canEditOther=1|canBestTopic=1|canLockTopic=1|canAnnounce=1|canEditForum=1|canCategory=1|canBatchDelete=1|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=30720');
INSERT INTO ntsky_t_role VALUES(2,'超级版主',1,'可以管理多个版块','level101.gif',-1,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=30720|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=1|canMove=0|canTopTopic=1|canEditOther=1|canBestTopic=1|canLockTopic=1|canAnnounce=1|canEditForum=1|canCategory=1|canBatchDelete=1|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=20480');
INSERT INTO ntsky_t_role VALUES(3,'版主',1,'可以管理单个版块','level102.gif',-1,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=20480|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=1|canMove=0|canTopTopic=1|canEditOther=1|canBestTopic=1|canLockTopic=1|canAnnounce=1|canEditForum=1|canCategory=1|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=10240');
INSERT INTO ntsky_t_role VALUES(4,'注册用户',1,'刚注册的用户','level1.gif',0,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=0|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=1024|canViewUser=1|canUseSignature=0|canCustomFace=0|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=1024');

-- 注册用户
INSERT INTO ntsky_t_role VALUES(5,'初级会员',0,'注册基本会员','level1.gif',0,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canPostNew=1|canReplyPost=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=0|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=1024|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=1024');
INSERT INTO ntsky_t_role VALUES(6,'中级会员',0,' ','level2.gif',50,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canReplyOther=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=1024|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=1024');
INSERT INTO ntsky_t_role VALUES(7,'高级会员',0,' ','level3.gif',100,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canReplyOther=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=2048|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=2048');
INSERT INTO ntsky_t_role VALUES(8,'铜牌会员',0,' ','level4.gif',200,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canReplyOther=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=3072|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=3072');
INSERT INTO ntsky_t_role VALUES(9,'银牌会员',0,' ','level5.gif',400,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canReplyOther=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=4096|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=4096');
INSERT INTO ntsky_t_role VALUES(10,'金牌会员',0,' ','level6.gif',1000,'canViewForum=1|canViewTopic=1|canViewBestTopic=1|canPostNew=1|canReplyPost=1|canReplyOther=1|canEditPost=1|canDeleteOwnPost=1|canMoveOwn=1|canPostPoll=1|canVote=1|canGetAttachment=1|canUploadAttachment=1|uploadAttachmentSize=5120|canViewUser=1|canUseSignature=1|canCustomFace=1|canDelete=0|canMove=0|canTopTopic=0|canEditOther=0|canBestTopic=0|canLockTopic=0|canAnnounce=0|canEditForum=0|canCategory=0|canBatchDelete=0|canSendMessage=1|mostReceiverUsers=10|messageMaxSize=100|inboxSize=5120');


-- delete from `ntsky_t_act_log` where act_id=1;


-- update ntsky_t_forum set parent_enum=concat(parent_enum,',') WHERE parent_id!=0;


-- alter table ntsky_t_user add column online_time int default '0';


-- 论坛表分类
DROP TABLE IF EXISTS ntsky_t_common;
CREATE TABLE ntsky_t_common(
	id			INT NOT NULL  ,
	name			VARCHAR(255) NOT NULL ,
	type			TINYINT(2) NOT NULL , -- 1、头像 2、帮助
	ordering		TINYINT(2) default 0,
	PRIMARY KEY(id)
)
TYPE=InnoDB DEFAULT CHARSET=utf8 ;
INSERT INTO ntsky_t_common(id,name,type) VALUES(10,'登录和注册','2');
INSERT INTO ntsky_t_common(id,name,type) VALUES(11,'用户设置','2');
INSERT INTO ntsky_t_common(id,name,type) VALUES(12,'论坛使用','2');
INSERT INTO ntsky_t_common(id,name,type) VALUES(13,'关于 NTsky','2');
INSERT INTO ntsky_t_common(id,name,type) VALUES(14,'其它','2');


INSERT INTO ntsky_t_common(id,name,type) VALUES(1,'动物','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(2,'卡通','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(3,'景点','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(4,'自然','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(5,'浪漫','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(6,'科幻','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(7,'笑脸','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(8,'运动','1');
INSERT INTO ntsky_t_common(id,name,type) VALUES(9,'其它','1');

INSERT INTO ntsky_t_help(id,title,content,type,date_created) VALUES(13,'什么是RSS?','RSS是在线共享内容的一种简易方式（也叫聚合内容，Really Simple Syndication）。通常在时效性比较强的内容上使用RSS订阅能更快速获取信息，网站提供RSS输出，有利于让用户获取网站内容的最新更新。网络用户可以在客户端借助于支持RSS的聚合工具软件（例如SharpReader,NewzCrawler、FeedDemon），在不打开网站内容页面的情况下阅读支持RSS输出的网站内容。',14,'2006-01-01 00:00:01');

