From 8f45c77883d9349e974e19f7db8526176d09f201 Mon Sep 17 00:00:00 2001 From: dougk_ff7 Date: Tue, 16 Oct 2001 01:00:47 +0000 Subject: Just the start to the wonderful world of global announcements. Adds support for them as well as creates a new forum, id -1. Do not delete the forum. I'll write the admin later. git-svn-id: file:///svn/phpbb/trunk@1215 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_forums.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'phpBB/admin/admin_forums.php') diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 6fe927c24b..f206fd7f59 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -330,10 +330,21 @@ if( !empty($mode) ) $max_order = $row['max_order']; $next_order = $max_order + 1; + + $sql = "SELECT MAX(forum_id) AS max_id + FROM " . FORUMS_TABLE; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get order number from forums table", "", __LINE__, __FILE__, $sql); + } + $row = $db->sql_fetchrow($result); + + $max_id = $row['max_id']; + $next_id = $max_id + 1; // There is no problem having duplicate forum names so we won't check for it. - $sql = "INSERT INTO " . FORUMS_TABLE . " (forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable) - VALUES ('" . $HTTP_POST_VARS['forumname'] . "', " . intval($HTTP_POST_VARS['cat_id']) . ", '" . $HTTP_POST_VARS['forumdesc'] . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ")"; + $sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable) + VALUES ('" . $next_id . "', '" . $HTTP_POST_VARS['forumname'] . "', " . intval($HTTP_POST_VARS['cat_id']) . ", '" . $HTTP_POST_VARS['forumdesc'] . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ")"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, $sql); -- cgit v1.2.1