aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/admin/admin_forums.php
diff options
context:
space:
mode:
authordougk_ff7 <dougk_ff7@users.sourceforge.net>2001-10-16 01:00:47 +0000
committerdougk_ff7 <dougk_ff7@users.sourceforge.net>2001-10-16 01:00:47 +0000
commit8f45c77883d9349e974e19f7db8526176d09f201 (patch)
tree5616afc2168c05c83635e9337497d76912966d91 /phpBB/admin/admin_forums.php
parenta1c1036b8c8c1bbb27105df9c4b7b6d11612c888 (diff)
downloadforums-8f45c77883d9349e974e19f7db8526176d09f201.tar
forums-8f45c77883d9349e974e19f7db8526176d09f201.tar.gz
forums-8f45c77883d9349e974e19f7db8526176d09f201.tar.bz2
forums-8f45c77883d9349e974e19f7db8526176d09f201.tar.xz
forums-8f45c77883d9349e974e19f7db8526176d09f201.zip
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
Diffstat (limited to 'phpBB/admin/admin_forums.php')
-rw-r--r--phpBB/admin/admin_forums.php15
1 files changed, 13 insertions, 2 deletions
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);