if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_albumcategories'))
begin
CREATE TABLE [dnt_albumcategories] (
	[albumcateid] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nchar] (50)  NOT NULL ,
	[description] [nchar] (300)  NULL ,
	[albumcount] [int] NOT NULL ,
	[displayorder] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_albums'))
begin
CREATE TABLE [dnt_albums] (
	[albumid] [int] IDENTITY (1, 1) NOT NULL ,
	[albumcateid] [int] NOT NULL ,
	[userid] [int] NOT NULL ,
	[username] [nchar] (20)  NOT NULL ,
	[title] [nchar] (50)  NOT NULL ,
	[description] [nchar] (200)  NOT NULL ,
	[logo] [nchar] (255)  NOT NULL ,
	[password] [nchar] (50)  NOT NULL ,
	[imgcount] [int] NOT NULL ,
	[views] [int] NOT NULL ,
	[type] [int] NOT NULL ,
	[createdatetime] [datetime] NOT NULL 
) ON [PRIMARY]
end
;

DROP TABLE dnt_help;
CREATE TABLE [dnt_help] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (100)  NOT NULL ,
	[message] [ntext]  NULL ,
	[pid] [int] NOT NULL ,
	[orderby] [int] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_myposts'))
begin
CREATE TABLE [dnt_myposts] (
	[uid] [int] NOT NULL ,
	[tid] [int] NOT NULL ,
	[pid] [int] NOT NULL ,
	[dateline] [smalldatetime] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_mytopics'))
begin
CREATE TABLE [dnt_mytopics] (
	[uid] [int] NOT NULL ,
	[tid] [int] NOT NULL ,
	[dateline] [smalldatetime] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_photocomments'))
begin
CREATE TABLE [dnt_photocomments] (
	[commentid] [int] IDENTITY (1, 1) NOT NULL ,
	[photoid] [int] NOT NULL ,
	[username] [nvarchar] (20)  NOT NULL ,
	[userid] [int] NOT NULL ,
	[ip] [varchar] (100)  NOT NULL ,
	[postdatetime] [smalldatetime] NOT NULL ,
	[content] [nvarchar] (2000)  NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_photos'))
begin
CREATE TABLE [dnt_photos] (
	[photoid] [int] IDENTITY (1, 1) NOT NULL ,
	[filename] [char] (255)  NOT NULL ,
	[attachment] [nchar] (255)  NOT NULL ,
	[filesize] [int] NOT NULL ,
	[title] [nchar] (20)  NOT NULL ,
	[description] [nchar] (200)  NOT NULL ,
	[postdate] [datetime] NOT NULL ,
	[albumid] [int] NOT NULL ,
	[userid] [int] NOT NULL ,
	[username] [nchar] (20)  NOT NULL ,
	[views] [int] NOT NULL ,
	[commentstatus] [tinyint] NOT NULL ,
	[tagstatus] [tinyint] NOT NULL ,
	[comments] [int] NOT NULL ,
	[isattachment] [int] NOT NULL
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_phototags'))
begin
CREATE TABLE [dnt_phototags] (
	[tagid] [int] NOT NULL ,
	[photoid] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spaceattachments'))
begin
CREATE TABLE [dnt_spaceattachments] (
	[aid] [int] IDENTITY (1, 1) NOT NULL ,
	[uid] [int] NOT NULL ,
	[spacepostid] [int] NOT NULL ,
	[postdatetime] [datetime] NOT NULL ,
	[filename] [nchar] (100)  NOT NULL ,
	[filetype] [nchar] (50)  NOT NULL ,
	[filesize] [int] NOT NULL ,
	[attachment] [nchar] (100)  NOT NULL ,
	[downloads] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacecategories'))
begin
CREATE TABLE [dnt_spacecategories] (
	[categoryid] [int] IDENTITY (1, 1) NOT NULL ,
	[title] [nvarchar] (50)  NOT NULL ,
	[uid] [int] NOT NULL ,
	[description] [nvarchar] (1000)  NOT NULL ,
	[typeid] [int] NOT NULL ,
	[categorycount] [int] NOT NULL ,
	[displayorder] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacecomments'))
begin
CREATE TABLE [dnt_spacecomments] (
	[commentid] [int] IDENTITY (1, 1) NOT NULL ,
	[postid] [int] NOT NULL ,
	[author] [nvarchar] (50)  NOT NULL ,
	[email] [nvarchar] (100)  NOT NULL ,
	[url] [nvarchar] (255)  NOT NULL ,
	[ip] [varchar] (100)  NOT NULL ,
	[postdatetime] [smalldatetime] NOT NULL ,
	[content] [nvarchar] (2000)  NOT NULL ,
	[parentid] [int] NOT NULL ,
	[uid] [int] NOT NULL ,
	[posttitle] [nvarchar] (60)  NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spaceconfigs'))
begin
CREATE TABLE [dnt_spaceconfigs] (
	[spaceid] [int] IDENTITY (1, 1) NOT NULL ,
	[userid] [int] NOT NULL ,
	[spacetitle] [nchar] (100)  NOT NULL ,
	[description] [nchar] (200)  NOT NULL ,
	[blogdispmode] [tinyint] NOT NULL ,
	[bpp] [int] NOT NULL ,
	[commentpref] [tinyint] NOT NULL ,
	[messagepref] [tinyint] NOT NULL ,
	[rewritename] [char] (100)  NOT NULL ,
	[themeid] [int] NOT NULL ,
	[themepath] [nchar] (50)  NOT NULL ,
	[postcount] [int] NOT NULL ,
	[commentcount] [int] NOT NULL ,
	[visitedtimes] [int] NOT NULL ,
	[createdatetime] [smalldatetime] NOT NULL ,
	[updatedatetime] [smalldatetime] NOT NULL ,
	[defaulttab] [int] NOT NULL ,
	[status] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacecustomizepanels'))
begin
CREATE TABLE [dnt_spacecustomizepanels] (
	[moduleid] [int] NOT NULL ,
	[userid] [int] NOT NULL ,
	[panelcontent] [ntext]  NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacelinks'))
begin
CREATE TABLE [dnt_spacelinks] (
	[linkid] [int] IDENTITY (1, 1) NOT NULL ,
	[userid] [int] NOT NULL ,
	[linktitle] [nvarchar] (50)  NOT NULL ,
	[linkurl] [varchar] (255)  NOT NULL ,
	[description] [nvarchar] (200)  NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacemoduledefs'))
begin
CREATE TABLE [dnt_spacemoduledefs] (
	[moduledefid] [int] IDENTITY (1, 1) NOT NULL ,
	[modulename] [nvarchar] (20)  NOT NULL ,
	[cachetime] [int] NOT NULL ,
	[configfile] [varchar] (100)  NOT NULL ,
	[controller] [varchar] (255)  NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacemodules'))
begin
CREATE TABLE [dnt_spacemodules] (
	[moduleid] [int] NOT NULL ,
	[tabid] [int] NOT NULL ,
	[uid] [int] NOT NULL ,
	[moduledefid] [int] NOT NULL ,
	[panename] [varchar] (10)  NOT NULL ,
	[displayorder] [int] NOT NULL ,
	[userpref] [nvarchar] (4000)  NULL ,
	[val] [tinyint] NOT NULL ,
	[moduleurl] [varchar] (255)  NOT NULL ,
	[moduletype] [tinyint] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacepostcategories'))
begin
CREATE TABLE [dnt_spacepostcategories] (
	[id] [int] IDENTITY (1, 1) NOT NULL ,
	[postid] [int] NOT NULL ,
	[categoryid] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spaceposts'))
begin
CREATE TABLE [dnt_spaceposts] (
	[postid] [int] IDENTITY (1, 1) NOT NULL ,
	[author] [nvarchar] (40)  NOT NULL ,
	[uid] [int] NOT NULL ,
	[postdatetime] [datetime] NOT NULL ,
	[content] [ntext]  NOT NULL ,
	[title] [nvarchar] (120)  NOT NULL ,
	[category] [varchar] (255)  NOT NULL ,
	[poststatus] [tinyint] NOT NULL ,
	[commentstatus] [tinyint] NOT NULL ,
	[postupdatetime] [datetime] NOT NULL ,
	[commentcount] [int] NOT NULL ,
	[views] [int] NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spaceposttags'))
begin
CREATE TABLE [dnt_spaceposttags] (
	[tagid] [int] NOT NULL ,
	[spacepostid] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacetabs'))
begin
CREATE TABLE [dnt_spacetabs] (
	[tabid] [int] NOT NULL ,
	[uid] [int] NOT NULL ,
	[displayorder] [int] NOT NULL ,
	[tabname] [nvarchar] (50)  NOT NULL ,
	[iconfile] [varchar] (50)  NULL ,
	[template] [varchar] (50)  NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_spacethemes'))
begin
CREATE TABLE [dnt_spacethemes] (
	[themeid] [int] IDENTITY (1, 1) NOT NULL ,
	[directory] [varchar] (100)  NOT NULL ,
	[name] [nvarchar] (50)  NOT NULL ,
	[type] [int] NOT NULL ,
	[author] [nvarchar] (100)  NOT NULL ,
	[createdate] [nvarchar] (50)  NOT NULL ,
	[copyright] [nvarchar] (100)  NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_tags'))
begin
CREATE TABLE [dnt_tags] (
	[tagid] [int] NOT NULL ,
	[tagname] [nchar] (10)  NOT NULL ,
	[userid] [int] NOT NULL ,
	[postdatetime] [datetime] NOT NULL ,
	[orderid] [int] NOT NULL ,
	[color] [char] (6)  NOT NULL ,
	[count] [int] NOT NULL ,
	[fcount] [int] NOT NULL ,
	[pcount] [int] NOT NULL ,
	[scount] [int] NOT NULL ,
	[vcount] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_topicidentify'))
begin
CREATE TABLE [dnt_topicidentify] (
	[identifyid] [int] IDENTITY (1, 1) NOT NULL ,
	[name] [nvarchar] (50)  NOT NULL ,
	[filename] [varchar] (50)  NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_topictagcaches'))
begin
CREATE TABLE [dnt_topictagcaches] (
	[tid] [int] NOT NULL ,
	[linktid] [int] NOT NULL ,
	[linktitle] [nchar] (60)  NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_topictags'))
begin
CREATE TABLE [dnt_topictags] (
	[tagid] [int] NOT NULL ,
	[tid] [int] NOT NULL 
) ON [PRIMARY]
end
;

if not exists(select 1 from sysobjects where parent_obj=object_id('dnt_topictypes'))
begin
CREATE TABLE [dnt_topictypes] (
	[typeid] [int] IDENTITY (1, 1) NOT NULL ,
	[displayorder] [int] NOT NULL ,
	[name] [nvarchar] (30)  NOT NULL ,
	[description] [nvarchar] (500)  NOT NULL 
) ON [PRIMARY]
end
;

if exists (select * from dbo.sysobjects where id = object_id(N'[dnt_smilies]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dnt_smilies];
CREATE TABLE [dnt_smilies] (
	[id] [int] NOT NULL ,
	[displayorder] [int] NOT NULL ,
	[type] [int] NOT NULL ,
	[code] [nvarchar] (30)  NOT NULL ,
	[url] [varchar] (60)  NOT NULL 
) ON [PRIMARY]
;

ALTER TABLE [dnt_albumcategories] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_albumcategories] PRIMARY KEY  CLUSTERED 
	(
		[albumcateid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_albumcategories] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_albumcategories_albumcount] DEFAULT (0) FOR [albumcount],
	CONSTRAINT [DF_dnt_albumcategories_displayorder] DEFAULT (0) FOR [displayorder]
;

ALTER TABLE [dnt_albums] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacealbums] PRIMARY KEY  CLUSTERED 
	(
		[albumid]
	)  ON [PRIMARY] 
;

ALTER TABLE [dnt_albums] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacealbums_userid] DEFAULT ((-1)) FOR [userid],
	CONSTRAINT [DF_dnt_albums_username] DEFAULT ('') FOR [username],
	CONSTRAINT [DF_dnt_spacealbums_title] DEFAULT ('') FOR [title],
	CONSTRAINT [DF_dnt_spacealbums_description] DEFAULT ('') FOR [description],
	CONSTRAINT [DF_dnt_spacealbums_logo] DEFAULT ('') FOR [logo],
	CONSTRAINT [DF_dnt_spacealbums_password] DEFAULT ('') FOR [password],
	CONSTRAINT [DF_dnt_spacealbums_imgcount] DEFAULT (0) FOR [imgcount],
	CONSTRAINT [DF_dnt_spacealbums_views] DEFAULT (0) FOR [views],
	CONSTRAINT [DF_dnt_spacealbums_type] DEFAULT (0) FOR [type],
	CONSTRAINT [DF_dnt_spacealbums_createdatetime] DEFAULT (getdate()) FOR [createdatetime]
;

ALTER TABLE [dnt_help] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_help_orderby] DEFAULT (0) FOR [orderby]
;

ALTER TABLE [dnt_photocomments] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_photocomments_ip] DEFAULT ('') FOR [ip]
;

ALTER TABLE [dnt_photos] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacephoto] PRIMARY KEY  CLUSTERED 
	(
		[photoid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_photos] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacephoto_description] DEFAULT ('') FOR [description],
	CONSTRAINT [DF_dnt_spacephoto_postdate] DEFAULT (getdate()) FOR [postdate],
	CONSTRAINT [DF_dnt_photos_username] DEFAULT ('') FOR [username],
	CONSTRAINT [DF_dnt_photos_viewcount] DEFAULT (0) FOR [views],
	CONSTRAINT [DF_dnt_photos_commentstatus] DEFAULT (0) FOR [commentstatus],
	CONSTRAINT [DF_dnt_photos_tagstatus] DEFAULT (0) FOR [tagstatus],
	CONSTRAINT [DF_dnt_photos_comments] DEFAULT (0) FOR [comments],
	CONSTRAINT [DF_dnt_photos_isattachment] DEFAULT (0) FOR [isattachment]
;

ALTER TABLE [dnt_phototags] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_phototags_tagid] DEFAULT (0) FOR [tagid],
	CONSTRAINT [DF_Table3_pid] DEFAULT (0) FOR [photoid]
;
ALTER TABLE [dnt_spaceattachments] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spaceattachments] PRIMARY KEY  CLUSTERED 
	(
		[aid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spaceattachments] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spaceattachments_uid] DEFAULT (0) FOR [uid],
	CONSTRAINT [DF_dnt_spaceattachments_spacepostid] DEFAULT (0) FOR [spacepostid],
	CONSTRAINT [DF_dnt_spaceattachments_postdatetime] DEFAULT (getdate()) FOR [postdatetime],
	CONSTRAINT [DF_dnt_spaceattachments_filename] DEFAULT ('') FOR [filename],
	CONSTRAINT [DF_dnt_spaceattachments_filetype] DEFAULT ('') FOR [filetype],
	CONSTRAINT [DF_dnt_spaceattachments_filesize] DEFAULT (0) FOR [filesize],
	CONSTRAINT [DF_dnt_spaceattachments_attachment] DEFAULT ('') FOR [attachment],
	CONSTRAINT [DF_dnt_spaceattachments_downloads] DEFAULT (0) FOR [downloads]
;


ALTER TABLE [dnt_spacecategories] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacecategory] PRIMARY KEY  CLUSTERED 
	(
		[categoryid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spacecategories] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacecategory_title] DEFAULT ('') FOR [title],
	CONSTRAINT [DF_dnt_spacecategory_uid] DEFAULT (0) FOR [uid],
	CONSTRAINT [DF_dnt_spacecategorys_description] DEFAULT ('') FOR [description],
	CONSTRAINT [DF_dnt_spacecategory_typeid] DEFAULT (0) FOR [typeid],
	CONSTRAINT [DF_dnt_spacecategory_categorycount] DEFAULT (0) FOR [categorycount],
	CONSTRAINT [DF_dnt_spacecategory_displayorder] DEFAULT (0) FOR [displayorder]
;

ALTER TABLE [dnt_spacecomments] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacecomments] PRIMARY KEY  CLUSTERED 
	(
		[commentid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spacecomments] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacecomments_postid] DEFAULT (0) FOR [postid],
	CONSTRAINT [DF_dnt_spacecomments_author] DEFAULT ('') FOR [author],
	CONSTRAINT [DF_dnt_spacecomments_email] DEFAULT ('') FOR [email],
	CONSTRAINT [DF_dnt_spacecomments_url] DEFAULT ('') FOR [url],
	CONSTRAINT [DF_dnt_spacecomments_ip] DEFAULT ('') FOR [ip],
	CONSTRAINT [DF_dnt_spacecomments_postdatetime] DEFAULT (getdate()) FOR [postdatetime],
	CONSTRAINT [DF_dnt_spacecomments_content] DEFAULT ('') FOR [content]
;

ALTER TABLE [dnt_spaceconfigs] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spaceconfig] PRIMARY KEY  CLUSTERED 
	(
		[spaceid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spaceconfigs] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spaceconfig_spacetitle] DEFAULT ('') FOR [spacetitle],
	CONSTRAINT [DF_dnt_spaceconfig_description] DEFAULT ('') FOR [description],
	CONSTRAINT [DF_dnt_spaceconfig_blogdispmode] DEFAULT (0) FOR [blogdispmode],
	CONSTRAINT [DF_dnt_spaceconfig_bpp] DEFAULT (16) FOR [bpp],
	CONSTRAINT [DF_dnt_spaceconfig_commentpref] DEFAULT (0) FOR [commentpref],
	CONSTRAINT [DF_dnt_spaceconfig_messagepref] DEFAULT (0) FOR [messagepref],
	CONSTRAINT [DF_dnt_spaceconfig_rewritename] DEFAULT ('') FOR [rewritename],
	CONSTRAINT [DF_dnt_spaceconfig_theme] DEFAULT (0) FOR [themeid],
	CONSTRAINT [DF_dnt_spaceconfig_template] DEFAULT ('') FOR [themepath],
	CONSTRAINT [DF_dnt_spaceconfigs_postcount] DEFAULT (0) FOR [postcount],
	CONSTRAINT [DF_dnt_spaceconfigs_commentcount] DEFAULT (0) FOR [commentcount],
	CONSTRAINT [DF_dnt_spaceconfigs_visitedtimes] DEFAULT (0) FOR [visitedtimes],
	CONSTRAINT [DF_dnt_spaceconfigs_createdatetime] DEFAULT (getdate()) FOR [createdatetime],
	CONSTRAINT [DF_dnt_spaceconfigs_updatedatetime] DEFAULT (getdate()) FOR [updatedatetime],
	CONSTRAINT [DF_dnt_spaceconfigs_defaulttab] DEFAULT (0) FOR [defaulttab],
	CONSTRAINT [DF_dnt_spaceconfigs_status] DEFAULT (0) FOR [status]
;

ALTER TABLE [dnt_spacecustomizepanels] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacecustomizepanels] PRIMARY KEY  CLUSTERED 
	(
		[moduleid],
		[userid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spacecustomizepanels] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacecustomizepanels_panelcontent] DEFAULT ('') FOR [panelcontent]
;

ALTER TABLE [dnt_spacelinks] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacelink] PRIMARY KEY  CLUSTERED 
	(
		[linkid]
	)  ON [PRIMARY] 
;

ALTER TABLE [dnt_spacemoduledefs] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacemoduledefs] PRIMARY KEY  CLUSTERED 
	(
		[moduledefid]
	)  ON [PRIMARY] 
;

ALTER TABLE [dnt_spacemodules] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacemodules_uid] DEFAULT (0) FOR [uid]
;
ALTER TABLE [dnt_spacepostcategories] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacepostcategorys] PRIMARY KEY  CLUSTERED 
	(
		[id]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spacepostcategories] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spacepostcategorys_postid] DEFAULT (0) FOR [postid],
	CONSTRAINT [DF_dnt_spacepostcategorys_categoryid] DEFAULT (0) FOR [categoryid]
;

ALTER TABLE [dnt_spaceposts] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spaceposts] PRIMARY KEY  CLUSTERED 
	(
		[postid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_spaceposts] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spaceposts_views] DEFAULT (0) FOR [views]
;

ALTER TABLE [dnt_spaceposttags] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_spaceposttags_tagid] DEFAULT (0) FOR [tagid],
	CONSTRAINT [DF_dnt_spaceposttags_spacepostid] DEFAULT (0) FOR [spacepostid]
;

ALTER TABLE [dnt_spacethemes] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_spacethemes] PRIMARY KEY  CLUSTERED 
	(
		[themeid]
	)  ON [PRIMARY] 
;

ALTER TABLE [dnt_tags] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_tags] PRIMARY KEY  CLUSTERED 
	(
		[tagid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_tags] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_tags_userid] DEFAULT (0) FOR [userid],
	CONSTRAINT [DF_dnt_tags_orderid] DEFAULT (0) FOR [orderid],
	CONSTRAINT [DF_dnt_tags_count] DEFAULT (0) FOR [count],
	CONSTRAINT [DF_dnt_tags_fcount] DEFAULT (0) FOR [fcount],
	CONSTRAINT [DF_dnt_tags_pcount] DEFAULT (0) FOR [pcount],
	CONSTRAINT [DF_dnt_tags_scount] DEFAULT (0) FOR [scount],
	CONSTRAINT [DF_dnt_tags_vcount] DEFAULT (0) FOR [vcount]
;

ALTER TABLE [dnt_topicidentify] WITH NOCHECK ADD 
	CONSTRAINT [PK_dnt_topicidentify] PRIMARY KEY  CLUSTERED 
	(
		[identifyid]
	)  ON [PRIMARY] 
;
ALTER TABLE [dnt_topictagcaches] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_topictagcaches_tid] DEFAULT (0) FOR [tid],
	CONSTRAINT [DF_dnt_topictagcaches_linktid] DEFAULT (0) FOR [linktid]
;
ALTER TABLE [dnt_topictags] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_topictags_tagid] DEFAULT (0) FOR [tagid],
	CONSTRAINT [DF_dnt_topictags_tid] DEFAULT (0) FOR [tid]
;
ALTER TABLE [dnt_topictypes] WITH NOCHECK ADD 
	CONSTRAINT [DF_dnt_topictypes_displayorder] DEFAULT (0) FOR [displayorder],
	CONSTRAINT [DF_dnt_topictypes_name] DEFAULT ('') FOR [name],
	CONSTRAINT [DF_dnt_topictypes_description] DEFAULT ('') FOR [description]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_photos]') AND name = N'albumid') drop index [dnt_photos].[albumid];
 CREATE INDEX [albumid] ON [dnt_photos]([albumid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_photos]') AND name = N'photoiduserid') drop index [dnt_photos].[photoiduserid];
 CREATE INDEX [photoiduserid] ON [dnt_photos]([photoid], [userid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_photos]') AND name = N'userid') drop index [dnt_photos].[userid];
 CREATE INDEX [userid] ON [dnt_photos]([userid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceattachments]') AND name = N'tid') drop index [dnt_photos].[tid];
 CREATE INDEX [tid] ON [dnt_spaceattachments]([spacepostid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceattachments]') AND name = N'uid') drop index [dnt_photos].[uid];
 CREATE INDEX [uid] ON [dnt_spaceattachments]([uid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceattachments]') AND name = N'spacepostiduserid') drop index [dnt_photos].[spacepostiduserid];
 CREATE INDEX [spacepostiduserid] ON [dnt_spaceattachments]([spacepostid], [uid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceattachments]') AND name = N'userid') drop index [dnt_photos].[userid];
 CREATE UNIQUE  INDEX [userid] ON [dnt_spacecategories]([uid], [displayorder], [categoryid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceconfigs]') AND name = N'userid') drop index [dnt_photos].[userid];
 CREATE UNIQUE  INDEX [userid] ON [dnt_spaceconfigs]([userid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spacelinks]') AND name = N'linkiduserid') drop index [dnt_photos].[linkiduserid];
 CREATE INDEX [linkiduserid] ON [dnt_spacelinks]([linkid], [userid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spacemoduledefs]') AND name = N'configfile') drop index [dnt_photos].[configfile];
 CREATE INDEX [configfile] ON [dnt_spacemoduledefs]([configfile]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceposts]') AND name = N'postiduid') drop index [dnt_photos].[postiduid];
 CREATE INDEX [postiduid] ON [dnt_spaceposts]([postid], [uid]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spaceposts]') AND name = N'postidcommentcount') drop index [dnt_photos].[postidcommentcount;
 CREATE INDEX [postidcommentcount] ON [dnt_spaceposts]([postid], [commentcount]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spacetabs]') AND name = N'uid') drop index [dnt_photos].[uid];
 CREATE INDEX [uid] ON [dnt_spacetabs]([uid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_spacethemes]') AND name = N'type') drop index [dnt_photos].[type];
 CREATE INDEX [type] ON [dnt_spacethemes]([type]) ON [PRIMARY]
;

if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_pms]') AND name = N'msgtoid') drop index [dnt_photos].[msgtoid];
 CREATE INDEX [msgtoid] ON [dnt_pms] ([msgtoid]) ON [PRIMARY]
;



if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_albums]') AND name = N'list_albumcateid') drop index [dnt_photos].[list_albumcateid];
CREATE  INDEX [list_albumcateid] ON [dnt_albums]([imgcount], [albumcateid], [albumid]) ON [PRIMARY]
;


if exists (select * from dbo.sysindexes where id = object_id(N'[dnt_albums]') AND name = N'list_userid') drop index [dnt_photos].[list_userid];
CREATE  INDEX [list_userid] ON [dnt_albums]([type], [imgcount], [userid], [albumid]) ON [PRIMARY]
;

ALTER TABLE [dnt_admingroups] ADD [allowviewrealname] [tinyint] NULL;
UPDATE [dnt_admingroups] SET [allowviewrealname] = 1;
ALTER TABLE [dnt_admingroups] ALTER column [allowviewrealname] [tinyint] NOT NULL;

EXEC sp_rename '[dnt_advertisements].[code]',  'code2',  'COLUMN';
ALTER TABLE [dnt_advertisements] ADD [code] [ntext] NOT NULL DEFAULT ('');
UPDATE [dnt_advertisements] SET [code]=[code2];
ALTER TABLE [dnt_advertisements] DROP COLUMN [code2];

EXEC sp_rename '[dnt_advertisements].[parameters]',  'parameters2',  'COLUMN';
ALTER TABLE [dnt_advertisements] ADD [parameters] [ntext] NOT NULL DEFAULT ('');
UPDATE [dnt_advertisements] SET [parameters]=[parameters2];
ALTER TABLE [dnt_advertisements] DROP COLUMN [parameters2];

ALTER TABLE [dnt_favorites] ADD [typeid] [tinyint] NOT NULL DEFAULT ('0');

ALTER TABLE [dnt_forumfields] ADD [applytopictype] [tinyint] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_forumfields] ADD [postbytopictype] [tinyint] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_forumfields] ADD [viewbytopictype] [tinyint] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_forumfields] ADD [topictypeprefix] [tinyint] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_forumfields] ADD [permuserlist] [ntext]  NULL;

ALTER TABLE [dnt_topics] ADD [identify] [int] NOT NULL DEFAULT ('0');
DECLARE @i varchar(500) SET @i='' SELECT @i=@i+' ALTER TABLE ['+b.name+'] DROP CONSTRAINT ['+d.name+']' FROM syscolumns a JOIN sysobjects b ON a.id=b.id JOIN syscomments c ON a.cdefault=c.id JOIN sysobjects d ON c.id=d.id WHERE b.name='dnt_topics' AND (a.name='identify') EXEC(@i);
ALTER TABLE [dnt_topics] WITH NOCHECK ADD CONSTRAINT [DF_dnt_topics_identify] DEFAULT ('0') FOR [identify];

ALTER TABLE [dnt_userfields] ADD [realname] [nvarchar] (10) NOT NULL DEFAULT ('');
ALTER TABLE [dnt_userfields] ADD [idcard] [varchar] (20) NOT NULL DEFAULT ('');
ALTER TABLE [dnt_userfields] ADD [mobile] [varchar] (20) NOT NULL DEFAULT ('');
ALTER TABLE [dnt_userfields] ADD [phone] [varchar] (20) NOT NULL DEFAULT ('');

ALTER TABLE [dnt_usergroups] ADD [allowspace] [smallint] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_usergroups] ADD [maxspaceattachsize] [int] NOT NULL DEFAULT ('0');
ALTER TABLE [dnt_usergroups] ADD [maxspacephotosize] [int] NOT NULL DEFAULT ('0');

ALTER TABLE [dnt_users] ADD [spaceid] [int] NOT NULL DEFAULT ('0');

DECLARE @s varchar(500) SET @s='' SELECT @s=@s+' ALTER TABLE ['+b.name+'] DROP CONSTRAINT ['+d.name+']' FROM syscolumns a JOIN sysobjects b ON a.id=b.id JOIN syscomments c ON a.cdefault=c.id JOIN sysobjects d ON c.id=d.id WHERE b.name='dnt_users' AND (a.name='newsletter') EXEC(@s);
ALTER TABLE [dnt_users] DROP COLUMN [newsletter];
ALTER TABLE [dnt_users] ADD [newsletter] [int] NOT NULL DEFAULT ('7');

ALTER TABLE [dnt_photos] ADD [width] [int] NULL;
ALTER TABLE [dnt_photos] ADD [height] [int] NULL;

INSERT INTO [dnt_spacethemes] VALUES ('', '默认皮肤', 0, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('', '部落窝', 0, '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');
INSERT INTO [dnt_spacethemes] VALUES ('default', '默认皮肤', 1, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('fadgirl', '时尚女孩', 1, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('dream', '梦幻', 1, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('patina', '古色古香', 1, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('romantic', '浪漫传奇', 1, 'Discuz!NT', '2007-08-23', 'Copyright 2007 Comsenz Inc.');
INSERT INTO [dnt_spacethemes] VALUES ('window', '窗', 2, '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');
INSERT INTO [dnt_spacethemes] VALUES ('orange', '桔色', 2,  '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');
INSERT INTO [dnt_spacethemes] VALUES ('green', '幽静夜空', 2, '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');
INSERT INTO [dnt_spacethemes] VALUES ('bird', '山水麻雀', 2,  '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');
INSERT INTO [dnt_spacethemes] VALUES ('promise', '约定一生', 2,  '部落窝', '2007-08-23', 'Copyright©2005-2007 BlogWorld. All rights reserved');

INSERT INTO [dnt_spacemoduledefs] VALUES ('友情链接', 0, 'builtin_linkmodule.xml', 'Discuz.Space.Modules.LinkModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('个人信息', 0, 'builtin_userinfomodule.xml', 'Discuz.Space.Modules.builtin.forum.UserInfoModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('帖子调用', 0, 'builtin_showtopicmodule.xml', 'Discuz.Space.Modules.builtin.forum.ShowTopicModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('日历', 0, 'builtin_calendarmodule.xml', 'Discuz.Space.Modules.CalendarModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('用户菜单', 0, 'builtin_leftmenumodule.xml', 'Discuz.Space.Modules.LeftMenuModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('最新评论', 0, 'builtin_newcommentmodule.xml', 'Discuz.Space.Modules.NewCommentModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('最新文章', 0, 'builtin_newpostmodule.xml', 'Discuz.Space.Modules.NewPostModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('文章列表', 0, 'builtin_postlistmodule.xml', 'Discuz.Space.Modules.PostListModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('便条纸', 0, 'builtin_notepadmodule.xml', 'Discuz.Space.Modules.builtin.notepad, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('数据统计', 0, 'builtin_statisticmodule.xml', 'Discuz.Space.Modules.StatisticModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('我的相册', 0, 'builtin_showalbummodule.xml', 'Discuz.Web.space.modules.builtin.album.ShowAlbumModule, Discuz.Web');
INSERT INTO [dnt_spacemoduledefs] VALUES ('自定义面板', 0, 'builtin_customizepanel.xml', 'Discuz.Space.Modules.builtin.CustomizePanel, Discuz.Web');

INSERT INTO [dnt_albumcategories] VALUES ('人物', '生活随拍 朋友恋人 偶像明星 帅哥美女 网友自拍', 0, 1);
INSERT INTO [dnt_albumcategories] VALUES ('风景', '自然风景 名胜古迹 建筑雕塑 民俗风情 城市魅影', 0, 2);
INSERT INTO [dnt_albumcategories] VALUES ('动物', '狗 猫 鸟类 鱼类 昆虫', 0, 3);
INSERT INTO [dnt_albumcategories] VALUES ('植物', '花卉 树木', 0, 4);
INSERT INTO [dnt_albumcategories] VALUES ('艺术', '邮票 古玩 绘画 书法 篆刻', 0, 5);
INSERT INTO [dnt_albumcategories] VALUES ('娱乐', '搞笑 游戏 动漫 电影', 0, 6);
INSERT INTO [dnt_albumcategories] VALUES ('体育', '足球 篮球 奥运会 世界杯', 0, 7);
INSERT INTO [dnt_albumcategories] VALUES ('时尚', '汽车 时装 家居 美食 手机', 0, 8);
INSERT INTO [dnt_albumcategories] VALUES ('科技', '天文 地理 海洋 科普 计算机', 0, 9);

INSERT INTO [dnt_topicidentify] VALUES ('找抽帖', 'zc.gif');
INSERT INTO [dnt_topicidentify] VALUES ('变态帖', 'bt.gif');
INSERT INTO [dnt_topicidentify] VALUES ('吵架帖', 'cj.gif');
INSERT INTO [dnt_topicidentify] VALUES ('炫耀帖', 'xy.gif');
INSERT INTO [dnt_topicidentify] VALUES ('炒作帖', 'cz.gif');
INSERT INTO [dnt_topicidentify] VALUES ('委琐帖', 'ws.gif');
INSERT INTO [dnt_topicidentify] VALUES ('火星帖', 'hx.gif');
INSERT INTO [dnt_topicidentify] VALUES ('精彩帖', 'jc.gif');
INSERT INTO [dnt_topicidentify] VALUES ('无聊帖', 'wl.gif');
INSERT INTO [dnt_topicidentify] VALUES ('温情帖', 'wq.gif');
INSERT INTO [dnt_topicidentify] VALUES ('XX帖', 'xx.gif');
INSERT INTO [dnt_topicidentify] VALUES ('跟风帖', 'gf.gif');
INSERT INTO [dnt_topicidentify] VALUES ('垃圾帖', 'lj.gif');
INSERT INTO [dnt_topicidentify] VALUES ('推荐帖', 'tj.gif');
INSERT INTO [dnt_topicidentify] VALUES ('搞笑帖', 'gx.gif');
INSERT INTO [dnt_topicidentify] VALUES ('悲情帖', 'bq.gif');
INSERT INTO [dnt_topicidentify] VALUES ('牛帖', 'nb.gif');

INSERT INTO [dnt_smilies] VALUES (1, 0, 0, '默认表情', 'default');
INSERT INTO [dnt_smilies] VALUES (2, 0, 1, ':default1:', 'default/0.gif');
INSERT INTO [dnt_smilies] VALUES (3, 0, 1, ':default2:', 'default/1.gif');
INSERT INTO [dnt_smilies] VALUES (4, 0, 1, ':default3:', 'default/10.gif');
INSERT INTO [dnt_smilies] VALUES (5, 0, 1, ':default4:', 'default/11.gif');
INSERT INTO [dnt_smilies] VALUES (6, 0, 1, ':default5:', 'default/12.gif');
INSERT INTO [dnt_smilies] VALUES (7, 0, 1, ':default6:', 'default/13.gif');
INSERT INTO [dnt_smilies] VALUES (8, 0, 1, ':default7:', 'default/14.gif');
INSERT INTO [dnt_smilies] VALUES (9, 0, 1, ':default8:', 'default/15.gif');
INSERT INTO [dnt_smilies] VALUES (10, 0, 1, ':default9:', 'default/16.gif');
INSERT INTO [dnt_smilies] VALUES (11, 0, 1, ':default10:', 'default/17.gif');
INSERT INTO [dnt_smilies] VALUES (12, 0, 1, ':default11:', 'default/18.gif');
INSERT INTO [dnt_smilies] VALUES (13, 0, 1, ':default12:', 'default/19.gif');
INSERT INTO [dnt_smilies] VALUES (14, 0, 1, ':default13:', 'default/2.gif');
INSERT INTO [dnt_smilies] VALUES (15, 0, 1, ':default14:', 'default/20.gif');
INSERT INTO [dnt_smilies] VALUES (16, 0, 1, ':default15:', 'default/21.gif');
INSERT INTO [dnt_smilies] VALUES (17, 0, 1, ':default16:', 'default/22.gif');
INSERT INTO [dnt_smilies] VALUES (18, 0, 1, ':default17:', 'default/23.gif');
INSERT INTO [dnt_smilies] VALUES (19, 0, 1, ':default18:', 'default/24.gif');
INSERT INTO [dnt_smilies] VALUES (20, 0, 1, ':default19:', 'default/25.gif');
INSERT INTO [dnt_smilies] VALUES (21, 0, 1, ':default20:', 'default/26.gif');
INSERT INTO [dnt_smilies] VALUES (22, 0, 1, ':default21:', 'default/27.gif');
INSERT INTO [dnt_smilies] VALUES (23, 0, 1, ':default22:', 'default/28.gif');
INSERT INTO [dnt_smilies] VALUES (24, 0, 1, ':default23:', 'default/29.gif');
INSERT INTO [dnt_smilies] VALUES (25, 0, 1, ':default24:', 'default/3.gif');
INSERT INTO [dnt_smilies] VALUES (26, 0, 1, ':default25:', 'default/30.gif');
INSERT INTO [dnt_smilies] VALUES (27, 0, 1, ':default26:', 'default/31.gif');
INSERT INTO [dnt_smilies] VALUES (28, 0, 1, ':default27:', 'default/32.gif');
INSERT INTO [dnt_smilies] VALUES (29, 0, 1, ':default28:', 'default/33.gif');
INSERT INTO [dnt_smilies] VALUES (30, 0, 1, ':default29:', 'default/34.gif');
INSERT INTO [dnt_smilies] VALUES (31, 0, 1, ':default30:', 'default/35.gif');
INSERT INTO [dnt_smilies] VALUES (32, 0, 1, ':default31:', 'default/36.gif');
INSERT INTO [dnt_smilies] VALUES (33, 0, 1, ':default32:', 'default/37.gif');
INSERT INTO [dnt_smilies] VALUES (34, 0, 1, ':default33:', 'default/38.gif');
INSERT INTO [dnt_smilies] VALUES (35, 0, 1, ':default34:', 'default/39.gif');
INSERT INTO [dnt_smilies] VALUES (36, 0, 1, ':default35:', 'default/4.gif');
INSERT INTO [dnt_smilies] VALUES (37, 0, 1, ':default36:', 'default/40.gif');
INSERT INTO [dnt_smilies] VALUES (38, 0, 1, ':default37:', 'default/41.gif');
INSERT INTO [dnt_smilies] VALUES (39, 0, 1, ':default38:', 'default/42.gif');
INSERT INTO [dnt_smilies] VALUES (40, 0, 1, ':default39:', 'default/43.gif');
INSERT INTO [dnt_smilies] VALUES (41, 0, 1, ':default40:', 'default/44.gif');
INSERT INTO [dnt_smilies] VALUES (42, 0, 1, ':default41:', 'default/45.gif');
INSERT INTO [dnt_smilies] VALUES (43, 0, 1, ':default42:', 'default/46.gif');
INSERT INTO [dnt_smilies] VALUES (44, 0, 1, ':default43:', 'default/47.gif');
INSERT INTO [dnt_smilies] VALUES (45, 0, 1, ':default44:', 'default/48.gif');
INSERT INTO [dnt_smilies] VALUES (46, 0, 1, ':default45:', 'default/49.gif');
INSERT INTO [dnt_smilies] VALUES (47, 0, 1, ':default46:', 'default/5.gif');
INSERT INTO [dnt_smilies] VALUES (48, 0, 1, ':default47:', 'default/50.gif');
INSERT INTO [dnt_smilies] VALUES (49, 0, 1, ':default48:', 'default/51.gif');
INSERT INTO [dnt_smilies] VALUES (50, 0, 1, ':default49:', 'default/52.gif');
INSERT INTO [dnt_smilies] VALUES (51, 0, 1, ':default50:', 'default/53.gif');
INSERT INTO [dnt_smilies] VALUES (52, 0, 1, ':default51:', 'default/54.gif');
INSERT INTO [dnt_smilies] VALUES (53, 0, 1, ':default52:', 'default/55.gif');
INSERT INTO [dnt_smilies] VALUES (54, 0, 1, ':default53:', 'default/56.gif');
INSERT INTO [dnt_smilies] VALUES (55, 0, 1, ':default54:', 'default/57.gif');
INSERT INTO [dnt_smilies] VALUES (56, 0, 1, ':default55:', 'default/58.gif');
INSERT INTO [dnt_smilies] VALUES (57, 0, 1, ':default56:', 'default/59.gif');
INSERT INTO [dnt_smilies] VALUES (58, 0, 1, ':default57:', 'default/6.gif');
INSERT INTO [dnt_smilies] VALUES (59, 0, 1, ':default58:', 'default/60.gif');
INSERT INTO [dnt_smilies] VALUES (60, 0, 1, ':default59:', 'default/61.gif');
INSERT INTO [dnt_smilies] VALUES (61, 0, 1, ':default60:', 'default/62.gif');
INSERT INTO [dnt_smilies] VALUES (62, 0, 1, ':default61:', 'default/63.gif');
INSERT INTO [dnt_smilies] VALUES (63, 0, 1, ':default62:', 'default/64.gif');
INSERT INTO [dnt_smilies] VALUES (64, 0, 1, ':default63:', 'default/65.gif');
INSERT INTO [dnt_smilies] VALUES (65, 0, 1, ':default64:', 'default/66.gif');
INSERT INTO [dnt_smilies] VALUES (66, 0, 1, ':default65:', 'default/67.gif');
INSERT INTO [dnt_smilies] VALUES (67, 0, 1, ':default66:', 'default/68.gif');
INSERT INTO [dnt_smilies] VALUES (68, 0, 1, ':default67:', 'default/69.gif');
INSERT INTO [dnt_smilies] VALUES (69, 0, 1, ':default68:', 'default/7.gif');
INSERT INTO [dnt_smilies] VALUES (70, 0, 1, ':default69:', 'default/70.gif');
INSERT INTO [dnt_smilies] VALUES (71, 0, 1, ':default70:', 'default/71.gif');
INSERT INTO [dnt_smilies] VALUES (72, 0, 1, ':default71:', 'default/72.gif');
INSERT INTO [dnt_smilies] VALUES (73, 0, 1, ':default72:', 'default/73.gif');
INSERT INTO [dnt_smilies] VALUES (74, 0, 1, ':default73:', 'default/74.gif');
INSERT INTO [dnt_smilies] VALUES (75, 0, 1, ':default74:', 'default/75.gif');
INSERT INTO [dnt_smilies] VALUES (76, 0, 1, ':default75:', 'default/76.gif');
INSERT INTO [dnt_smilies] VALUES (77, 0, 1, ':default76:', 'default/77.gif');
INSERT INTO [dnt_smilies] VALUES (78, 0, 1, ':default77:', 'default/78.gif');
INSERT INTO [dnt_smilies] VALUES (79, 0, 1, ':default78:', 'default/79.gif');
INSERT INTO [dnt_smilies] VALUES (80, 0, 1, ':default79:', 'default/8.gif');
INSERT INTO [dnt_smilies] VALUES (81, 0, 1, ':default80:', 'default/80.gif');
INSERT INTO [dnt_smilies] VALUES (82, 0, 1, ':default81:', 'default/81.gif');
INSERT INTO [dnt_smilies] VALUES (83, 0, 1, ':default82:', 'default/82.gif');
INSERT INTO [dnt_smilies] VALUES (84, 0, 1, ':default83:', 'default/83.gif');
INSERT INTO [dnt_smilies] VALUES (86, 0, 1, ':default84:', 'default/84.gif');
INSERT INTO [dnt_smilies] VALUES (87, 0, 1, ':default85:', 'default/85.gif');
INSERT INTO [dnt_smilies] VALUES (88, 0, 1, ':default86:', 'default/86.gif');
INSERT INTO [dnt_smilies] VALUES (89, 0, 1, ':default87:', 'default/9.gif');

UPDATE [dnt_usergroups] SET [maxspaceattachsize]=2048000, [maxspacephotosize]=2048000 WHERE [groupid] < 4 OR [groupid] > 9;

DELETE FROM [dnt_bbcodes] WHERE tag = 'silverlight';

INSERT INTO [dnt_bbcodes] VALUES (1,'silverlight','silverlight.gif','[silverlight]http://localhost/123.wmv[/silverlight]',3,1,'在帖子中使用Silverlight播放器', '<script type="text/javascript" src="silverlight/player/showtopiccontainer.js"></script><div id="divPlayer_{RANDOM}"></div><script>Silverlight.InstallAndCreateSilverlight("1.0",document.getElementById("divPlayer_{RANDOM}"),installExperienceHTML,"InstallPromptDiv",function(){new StartPlayer_0("divPlayer_{RANDOM}", parseInt("{2}"), parseInt("{3}"), "{1}", forumpath)})</script>', '请输入音频或视频的地址,请输入音频或视频的宽度,请输入视频的高度(音频无效)', 'http://,400,300');

INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('用户须知', '', 0, 1);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('论坛常见问题', '', 0, 2);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('个人空间常见问题', '', 0, 3);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('相册常见问题', '', 0, 4);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我必须要注册吗？', '这取决于管理员如何设置 Discuz!NT 论坛的用户组权限选项，您甚至有可能必须在注册成正式用户后后才能浏览帖子。当然，在通常情况下，您至少应该是正式用户才能发新帖和回复已有帖子。请 <a href="register.aspx" target="_blank">点击这里</a> 免费注册成为我们的新用户！<br /><br />强烈建议您注册，这样会得到很多以游客身份无法实现的功能。', 1, 1);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何登录论坛？', '如果您已经注册成为该论坛的会员，那么您只要通过访问页面右上的<a href="login.aspx" target="_blank">登录</a>，进入登陆界面填写正确的用户名和密码（如果您设有安全提问，请选择正确的安全提问并输入对应的答案），点击“提交”即可完成登陆如果您还未注册请点击这里。<br /><br />如果需要保持登录，请选择相应的 Cookie 时间，在此时间范围内您可以不必输入密码而保持上次的登录状态。', 1, 2);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('忘记我的登录密码，怎么办？', '当您忘记了用户登录的密码，您可以通过注册时填写的电子邮箱重新设置一个新的密码。点击登录页面中的 <a href="getpassword.aspx" target="_blank">取回密码</a>，按照要求填写您的个人信息，系统将自动发送重置密码的邮件到您注册时填写的 Email 信箱中。如果您的 Email 已失效或无法收到信件，请与论坛管理员联系。', 1, 3);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用个性化头像', '在<a href="usercppreference.aspx" target="_blank">用户中心</a>中的 个人设置  -> 个性设置，可以使用论坛自带的头像或者自定义的头像。', 1, 4);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何修改登录密码', '在<a href="usercpnewpassword.aspx" target="_blank">用户中心</a>中的 个人设置 -> 更改密码，填写“原密码”，“新密码”，“确认新密码”。点击“提交”，即可修改。', 1, 5);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用个性化签名和昵称', '在<a href="usercpprofile.aspx" target="_blank">用户中心</a>中的 个人设置 -> 编辑个人档案，有一个“昵称”和“个人签名”的选项，可以在此设置。', 1, 6);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何发表新主题，以及投票', '在论坛版块中，点“发帖”，点击即可进入功能齐全的发帖界面。<br /><br />注意：需要发布投票时请在发帖界面的下方开启投票选项进行设置即可。如发布普通主题，直接点击“发帖”，当然您也可以使用版块下面的“快速发帖”发表新帖(如果此选项打开)。一般论坛都设置为需要登录后才能发帖。', 2, 1);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何发表回复', '回复有分三种：第一、帖子最下方的快速回复； 第二、在您想回复的楼层点击右下方“回复”； 第三、完整回复页面，点击本页“新帖”旁边的“回复”。', 2, 2);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何编辑自己的帖子', '在帖子的右上角，有编辑，回复，报告等选项，点击编辑，就可以对帖子进行编辑。', 2, 3);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何出售购买主题', '<li>出售主题：当您进入发贴界面后，如果您所在的用户组有发买卖贴的权限，在“售价(金钱)”后面填写主题的价格，这样其他用户在查看这个帖子的时候就需要进入交费的过程才可以查看帖子。</li><li>购买主题：浏览你准备购买的帖子，在帖子的相关信息的下面有[查看付款记录] [购买主题] [返回上一页] 等链接，点击“购买主题”进行购买。</li>', 2, 4);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何上传附件', '<li>发表新主题的时候上传附件，步骤为：写完帖子标题和内容后点上传附件右方的浏览，然后在本地选择要上传附件的具体文件名，最后点击发表话题。</li><li>发表回复的时候上传附件，步骤为：写完回复楼主的内容，然后点上传附件右方的浏览，找到需要上传的附件，点击发表回复。</li>', 2, 5);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何实现发帖时图文混排效果', '<li>发表新主题的时候点击上传附件左侧的“[插入]”链接把附件标记插入到帖子中适当的位置即可。</li>', 2, 6);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用Discuz!NT代码', '<table width="99%" cellpadding="2" cellspacing="2"><tr><th width="50%">Discuz!NT代码</th><th width="402">效果</th></tr><tr><td>[b]粗体文字 Abc[/b]</td><td><strong>粗体文字 Abc</strong></td></tr><tr><td>[i]斜体文字 Abc[/i]</td><td><i>斜体文字 Abc</i></td></tr><tr><td>[u]下划线文字 Abc[/u]</td><td><u>下划线文字 Abc</u></td></tr><tr><td>[color=red]红颜色[/color]</td><td><font color="red">红颜色</font></td></tr><tr><td>[size=3]文字大小为 3[/size] </td><td><font size="3">文字大小为 3</font></td></tr><tr><td>[font=仿宋]字体为仿宋[/font] </td><td><font face="仿宋">字体为仿宋</font></td></tr><tr><td>[align=Center]内容居中[/align] </td><td><div align="center">内容居中</div></td></tr><tr><td>[url]http://www.comsenz.com[/url]</td><td><a href="http://www.comsenz.com" target="_blank">http://www.comsenz.com</a>（超级链接）</td></tr><tr><td>[url=http://nt.discuz.net]Discuz!NT 论坛[/url]</td><td><a href="http://nt.discuz.net" target="_blank">Discuz!NT 论坛</a>（超级链接）</td></tr><tr><td>[email]myname@mydomain.com[/email]</td><td><a href="mailto:myname@mydomain.com">myname@mydomain.com</a>（E-mail链接）</td></tr><tr><td>[email=support@discuz.net]Discuz!NT 技术支持[/email]</td><td><a href="mailto:support@discuz.net">Discuz!NT 技术支持（E-mail链接）</a></td></tr><tr><td>[quote]Discuz!NT Board 是由康盛创想（北京）科技有限公司开发的论坛软件[/quote] </td><td><div style="font-size: 12px"><br /><br /><div class="quote"><h5>引用:</h5><blockquote>原帖由 <i>admin</i> 于 2006-12-26 08:45 发表<br />Discuz!NT Board 是由康盛创想（北京）科技有限公司开发的论坛软件</blockquote></div></td></tr> <tr><td>[code]Discuz!NT Board 是由康盛创想（北京）科技有限公司开发的论坛软件[/code] </td><td><div style="font-size: 12px"><br /><br /><div class="blockcode"><h5>代码:</h5><code id="code0">Discuz!NT Board 是由康盛创想（北京）科技有限公司开发的论坛软件</code></div></td></tr><tr><td>[hide]隐藏内容 Abc[/hide]</td><td>效果:只有当浏览者回复本帖时，才显示其中的内容，否则显示为“<b>**** 隐藏信息 跟帖后才能显示 *****</b>”</td></tr><tr><td>[list][*]列表项 #1[*]列表项 #2[*]列表项 #3[/list]</td><td><ul><li>列表项 ＃1</li><li>列表项 ＃2</li><li>列表项 ＃3 </li></ul></td></tr><tr><td>[img]http://nt.discuz.net/templates/default/images/clogo.gif[/img] </td><td>帖子内显示为：<img src="http://nt.discuz.net/templates/default/images/clogo.gif" /></td></tr><tr><td>[img=88,31]http://nt.discuz.net/templates/default/images/clogo.gif[/img] </td><td>帖子内显示为：<img src="http://nt.discuz.net/templates/default/images/clogo.gif" /></td> </tr> <tr><td>[fly]飞行的效果[/fly]</td><td><marquee scrollamount="3" behavior="alternate" width="90%">飞行的效果</marquee></td></tr><tr><td>[flash]Flash网页地址 [/flash] </td><td>帖子内嵌入 Flash 动画</td></tr><tr><td>X[sup]2[/sup]</td><td>X<sup>2</sup></td></tr><tr><td>X[sub]2[/sub]</td><td>X<sub>2</sub></td></tr></table>', 2, 7);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用短消息功能', '您登录后，点击导航栏上的短消息按钮，即可进入短消息管理。点击[发送短消息]按钮，在"发送到"后输入收信人的用户名，填写完标题和内容，点提交(或按 Ctrl+Enter 发送)即可发出短消息。<br /><br />如果要保存到发件箱，以在提交前勾选"保存到发件箱中"前的复选框。<ul><li>点击收件箱可打开您的收件箱查看收到的短消息。</li><li>点击发件箱可查看保存在发件箱里的短消息。 </li></ul>', 2, 8);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何查看论坛会员数据', '点击导航栏上面的会员，然后显示的是此论坛的会员数据。注：需要论坛管理员开启允许你查看会员资料才可看到。', 2, 9);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用搜索', '点击导航栏上面的搜索，输入搜索的关键字并选择一个范围，就可以检索到您有权限访问论坛中的相关的帖子。', 2, 10);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用“我的”功能', '<li>会员必须首先<a href="login.aspx" target="_blank">登录</a>，没有用户名的请先<a href="register.aspx" target="_blank">注册</a>；</li><li>登录之后在论坛的左上方会出现一个“我的”的超级链接，点击这个链接之后就可进入到有关于您的信息。</li>', 2, 11);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何向管理员举报帖子', '打开一个帖子，在帖子的右上角可以看到："举报” | "树型“ | "收藏" | "编辑" | "删除" |"评分" 等等几个按钮，单击“举报”按钮即可完成举报某个帖子的操作。', 2, 12);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何“收藏”帖子', '当你浏览一个帖子时，在它的右上角可以看到："举报” | "树型“ | "收藏" | "编辑" | "删除" |"评分"，点击相对应的文字连接即可完成相关的操作。', 2, 13);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用RSS订阅', '在论坛的首页和进入版块的页面的右上角就会出现一个rss订阅的小图标<img src="templates/default/images/rss.gif" border="0">，鼠标点击之后将出现本站点的rss地址，你可以将此rss地址放入到你的rss阅读器中进行订阅。', 2, 14);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何清除Cookies', '介绍3种常用浏览器的Cookies清除方法(注：此方法为清除全部的Cookies,请谨慎使用)<ul><li>Internet Explorer: 工具（选项）内的Internet选项→常规选项卡内，IE6直接可以看到删除Cookies的按钮点击即可，IE7为“浏 览历史记录”选项内的删除点击即可清空Cookies。对于Maxthon,腾讯TT等IE核心浏览器一样适用。 </li><li>FireFox:工具→选项→隐私→Cookies→显示Cookie里可以对Cookie进行对应的删除操作。 </li><li>Opera:工具→首选项→高级→Cookies→管理Cookies即可对Cookies进行删除的操作。</li></ul>', 2, 15);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何使用表情代码', '表情是一些用字符表示的表情符号，如果打开表情功能，Discuz!NT 会把一些符号转换成小图像，显示在帖子中，更加美观明了。同时Discuz!NT支持表情分类，分页功能。插入表情时只需使用鼠标点击表情即可。', 2, 16);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何开通个人空间', '如果您有权限开通“我的个人空间”，当用户登录论坛以后在论坛首页，在搜索框下方有申请个人空间连接点击提交申请，如果管理员已经开启了手动开通则需要等待管理员来审核通过您的申请', 3, 1);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何在个人空间发表日志', '如果您已经开通“个人空间”，当用户登录论坛以后在论坛用户中心 -> 个人空间 -> 管理文章内可以进行发表和管理日志的操作。', 3, 2);
INSERT INTO [dnt_help] ([title], [message], [pid], [orderby]) VALUES ('我如何在相册中上传图片', '如果您已经开通“相册功能”，当用户登录论坛以后在论坛用户中心 -> 相册 -> 管理相册内可以进行发表和管理相册的操作。', 4, 1);
