|
From: Jonathan H. <the...@us...> - 2002-03-12 21:46:39
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv7005
Modified Files:
admin_forums.php
Log Message:
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
Index: admin_forums.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forums.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** admin_forums.php 24 Jan 2002 02:51:00 -0000 1.37
--- admin_forums.php 12 Mar 2002 21:46:34 -0000 1.38
***************
*** 391,395 ****
if( $HTTP_POST_VARS['prune_enable'] )
{
- $new_forum_id = $db->sql_nextid();
if( $HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
--- 391,394 ----
***************
*** 399,403 ****
$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']) . ")";
if( !$result = $db->sql_query($sql) )
{
--- 398,402 ----
$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
! VALUES('" . $next_id . "', " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
if( !$result = $db->sql_query($sql) )
{
***************
*** 647,650 ****
--- 646,656 ----
{
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);
}
|