CREATE PROCEDURE [dbo].[spInsertForum] 
	@frm_name	varchar(255),
	@frm_desc	text,
	@frm_link	varchar(255),
	@frm_image	varchar(255),
	@frm_type	int,
	@frm_status	int,
	@frm_posts	bigint,
	@frm_topics	bigint,
	@frm_last_post_id	bigint,
	@frm_last_post_subject	varchar(100),
	@frm_last_post_time		datetime,
	@frm_last_poster_name	varchar(50)
AS
BEGIN
	declare @nextOrder int
	SELECT @nextOrder = ISNULL(MAX(forum_order),0)+1 FROM tblForum
	INSERT INTO tblForum (
		forum_name,
		forum_desc,
		forum_link,
		forum_image,
		forum_type,
		forum_status,
		forum_order,
		forum_posts,
		forum_topics,
		forum_last_post_id,
		forum_last_post_subject,
		forum_last_post_time,
		forum_last_poster_name
		) 
	VALUES(
		@frm_name,
		@frm_desc,
		@frm_link,
		@frm_image,
		@frm_type,
		@frm_status,
		@nextOrder,
		@frm_posts,
		@frm_topics,
		@frm_last_post_id,
		@frm_last_post_subject,
		@frm_last_post_time,
		@frm_last_poster_name
		);
END