diff options
author | the_systech <the_systech@users.sourceforge.net> | 2002-03-12 21:46:34 +0000 |
---|---|---|
committer | the_systech <the_systech@users.sourceforge.net> | 2002-03-12 21:46:34 +0000 |
commit | 3d375a794e71d65d3e89d6ff475439687fe7954f (patch) | |
tree | 80c389da436f898d2ad2a08d230a2e87fcbc5d72 /phpBB/admin | |
parent | 9135d2f63cda9c759af0c4bf230b33c81b04067c (diff) | |
download | forums-3d375a794e71d65d3e89d6ff475439687fe7954f.tar forums-3d375a794e71d65d3e89d6ff475439687fe7954f.tar.gz forums-3d375a794e71d65d3e89d6ff475439687fe7954f.tar.bz2 forums-3d375a794e71d65d3e89d6ff475439687fe7954f.tar.xz forums-3d375a794e71d65d3e89d6ff475439687fe7954f.zip |
Fix for bug #528319, can't check currval of a sequence when the sequence doesn't exist... We manually determine and assign the forum id so no need to get currval anyway :D
git-svn-id: file:///svn/phpbb/trunk@2298 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/admin')
-rw-r--r-- | phpBB/admin/admin_forums.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 453551b05a..faf51852af 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -390,7 +390,6 @@ if( !empty($mode) ) if( $HTTP_POST_VARS['prune_enable'] ) { - $new_forum_id = $db->sql_nextid(); if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "") { @@ -398,7 +397,7 @@ if( !empty($mode) ) } $sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq) - VALUES($new_forum_id, " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")"; + VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")"; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't insert row in prune table", "", __LINE__, __FILE__, $sql); @@ -647,6 +646,13 @@ if( !empty($mode) ) { message_die(GENERAL_ERROR, "Couldn't delete forum", "", __LINE__, __FILE__, $sql); } + + $sql = "DELETE FROM " . PRUNE_TABLE . " + WHERE forum_id = $from_id"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't delete forum prune information!", "", __LINE__, __FILE__, $sql); + } $message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], "<a href=\"" . append_sid("admin_forums.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); |