|
From: Paul S. O. <ps...@us...> - 2002-05-14 15:25:37
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv16332
Modified Files:
Tag: phpBB-2_0_0
update_to_201.php
Log Message:
oops, need to re-sync forums just in case too
Index: update_to_201.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/Attic/update_to_201.php,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** update_to_201.php 14 May 2002 15:19:20 -0000 1.1.2.2
--- update_to_201.php 14 May 2002 15:25:34 -0000 1.1.2.3
***************
*** 9,12 ****
--- 9,13 ----
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/functions.'.$phpEx);
+ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
***************
*** 83,136 ****
FROM " . TOPICS_TABLE . "
WHERE topic_moved_id <> 0";
- if ( !($result = $db->sql_query($sql)) )
- {
- die("Couldn't update version info");
- }
-
- $topic_ary = array();
- while ( $row = $db->sql_fetchrow($result) )
- {
- $topic_ary[$row['topic_id']] = $row['topic_moved_id'];
- }
-
- while ( list($topic_id, $topic_moved_id) = each($topic_ary) )
- {
- $sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
- FROM " . POSTS_TABLE . "
- WHERE topic_id = $topic_moved_id";
if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
}
! if ( $row = $db->sql_fetchrow($result) )
{
! $sql = "UPDATE " . TOPICS_TABLE . "
! SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . "
! WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
{
! message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
}
}
}
- }
! unset($sql);
! $sql = "UPDATE " . CONFIG_TABLE . "
! SET config_value = '.0.1'
! WHERE config_name = 'version'";
! if ( !($result = $db->sql_query($sql)) )
! {
! die("Couldn't update version info");
! }
! die("UPDATING COMPLETE -> 2.0.1 Final installed");
! break;
! default:
! die("NO UPDATES REQUIRED");
! break;
}
}
--- 84,139 ----
FROM " . TOPICS_TABLE . "
WHERE topic_moved_id <> 0";
if ( !($result = $db->sql_query($sql)) )
{
! die("Couldn't update version info");
! }
!
! $topic_ary = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $topic_ary[$row['topic_id']] = $row['topic_moved_id'];
}
! while ( list($topic_id, $topic_moved_id) = each($topic_ary) )
{
! $sql = "SELECT MAX(post_id) AS last_post, MIN(post_id) AS first_post, COUNT(post_id) AS total_posts
! FROM " . POSTS_TABLE . "
! WHERE topic_id = $topic_moved_id";
! if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
! }
!
! if ( $row = $db->sql_fetchrow($result) )
! {
! $sql = "UPDATE " . TOPICS_TABLE . "
! SET topic_replies = " . ( $row['total_posts'] - 1 ) . ", topic_first_post_id = " . $row['first_post'] . ", topic_last_post_id = " . $row['last_post'] . "
! WHERE topic_id = $topic_id";
! if ( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
! }
}
}
}
! unset($sql);
! $sql = "UPDATE " . CONFIG_TABLE . "
! SET config_value = '.0.1'
! WHERE config_name = 'version'";
! if ( !($result = $db->sql_query($sql)) )
! {
! die("Couldn't update version info");
! }
!
! sync('all forums');
! die("UPDATING COMPLETE -> 2.0.1 Final installed");
! break;
! default:
! die("NO UPDATES REQUIRED");
! break;
}
}
|