|
From: Doug K. <dou...@us...> - 2001-10-16 01:00:50
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv32362/admin
Modified Files:
admin_forums.php
Log Message:
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.
Index: admin_forums.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forums.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** admin_forums.php 2001/10/14 15:46:53 1.23
--- admin_forums.php 2001/10/16 01:00:47 1.24
***************
*** 331,338 ****
$max_order = $row['max_order'];
$next_order = $max_order + 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']) . ")";
if( !$result = $db->sql_query($sql) )
{
--- 331,349 ----
$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_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) )
{
|